diff --git a/mosh.conf b/mosh.conf new file mode 100644 index 0000000..df13f62 --- /dev/null +++ b/mosh.conf @@ -0,0 +1,3 @@ +Plugins Mosh, Counterstrike, Net-OSCAR +Port 5190 +HeavyLogging 0 \ No newline at end of file diff --git a/mosh.pl b/mosh.pl new file mode 100755 index 0000000..4f4b609 --- /dev/null +++ b/mosh.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +# simplified milkbone shell + +use 5.006; # milkbone might work on 5.004 or lower; someone should find out... + +use warnings; +use strict; + +use lib 'lib'; +use lib '.'; + +use Milkbone; + +$| = 1; + +sub main +{ + Milkbone->init(); + + hook("load_options", -file => 'mosh.conf'); + + hook("load_plugins"); + hook("pre_mainloop"); + + hook("create_logon_prompt"); + + MOSLoop; + + hook("post_mainloop"); +} + +# off it goes... +main(); diff --git a/plugins/Mosh.pl b/plugins/Mosh.pl new file mode 100644 index 0000000..4f529ee --- /dev/null +++ b/plugins/Mosh.pl @@ -0,0 +1,34 @@ +package Mosh; + +use Milkbone; + +register_hook("signed_in", sub { + register_hook("tick", sub { + print "% "; + my $input = ; + + eval "use Milkbone::AllHooks; use base 'Milkbone::AllHooks'; $input" or print $@; + }); +}); + +register_hook("create_logon_prompt", sub { + my ($user, $pass); + + print "Username: "; + $user = ; + chomp $user; + + print "Password: "; + system('stty -echo'); + $pass = ; + system('stty echo'); + chomp $pass; + + hook("protocol_signon", -user => $user, -pass => $pass); +}); + +register_hook('reload_mosh', sub { reload_plugin('Mosh'); }); + +register_hook('msg_in', sub { + print $ARGS{-msg}; +});