### ### vim:ts=8 ai si sw=4 sta sm: ### $Id: newcommand,v 1.5 2003/12/05 12:50:03 sec Exp sec $ ### A second class of commands & "/dev/null" fix ### # requires: nothing (so far) # warning: uses /on input alias nc.help { echo *** This is the newcommand Script. echo *** features include: echo *** + a new class of commands ( "-" ) echo *** where the ferst letter specifies the action echo *** and the second the channel to operate on. echo *** echo *** /nc.newcmd - define new command echo *** /nc.newchan - define new channel echo *** echo *** Use like this: -ju == /join #unix echo *** echo *** + You can now safely paste your df/mount-output echo *** e.g. /dev/null no longer gives: echo *** Unknown command: DEV/NULL echo *** it will be said on the current Target (\$T) instead. } eval if (!match(%+nc% $script_info)){ assign script_info $script_info+nc };set client_info Sec$script_info #We need that :) set input_protection off # the NEW command-set on ^input ^"--*" on ^input "-??" sendline /$(nc.cmd.$encode($MID(1 1 $0))) $(nc.chan.$encode($MID(2 10 $0))) on ^input "-?? *" sendline /$(nc.cmd.$encode($MID(1 1 $0))) $(nc.chan.$encode($MID(2 10 $0))) $1- alias nc.newchan ^assign nc.chan.$encode($0) $1 alias nc.newcmd ^assign nc.cmd.$encode($0) $1 # now you can safely paste your df output :) on ^input ^"//*" on -input ^"/!/*" on ^input "/%/*" sendline /msg $T $0- bind ^p parse ! ### Some more /on input examples: # # If you're a mudder :) #/on ^input "'*" sendline /me says: $MID(1 400 $0-) # # now handled in tabkey++ #/on ^input "/msg % /me *" sendline /describe $1 $3- # # Possibly usefull ? :) #/on ^input "/msg % /%" sendline $2 $1 $3 # We try to restore a bit of safety set input_protection on ### some default mappings for the new commands nc.newcmd 2 msg nc.newcmd c ctcp nc.newcmd d describe nc.newcmd i invite nc.newcmd j join nc.newcmd k kick nc.newcmd l leave nc.newcmd m mode nc.newcmd n names nc.newcmd o op nc.newcmd p ping nc.newcmd t topic nc.newcmd v lj nc.newcmd w who nc.newchan c #challenge nc.newchan e #eire nc.newchan f #FreeBSD nc.newchan g #germany nc.newchan h #highgrey nc.newchan m #muenchen nc.newchan M #MuFFiN nc.newchan p &tum_progber nc.newchan q &test nc.newchan t #tappmud nc.newchan v &muc.de nc.newchan w #wunderbar # Where I hang out nc.newchan b #BLaFaSeL nc.newchan c #ccc nc.newchan m #musin nc.newchan p #pinwheel nc.newchan u #unix nc.newchan s #spassnetz nc.newchan w !walhal #alias op mode $0 +ooo $1- alias lj {leave $0;wait;join $0}