If you need an additional static parameter, use this:
Code: Select all
bind pub - !sysinfo "myproc sysinfo"
bind pub - !bla "myproc bla"
proc myproc {param nick host hand chan text} {
# $param is now either "sysinfo" or "bla"
}
If you want to know which bindmask (trigger for bind pub) matched, do this:
Code: Select all
bind pub - !sysinfo myproc
bind pub - !bla myproc
proc myproc {nick host hand chan text} {
# $::lastbind contains either "!sysinfo" or "!bla" here
}
If you want a generic bind and do the matching yourself, use a bind type that supports wildcards instead of pub/msg (resp. pubm/msgm)
Code: Select all
# % is a one word wildcards and stands for channel here
bind pubm - "% *" myproc
proc myproc {nick host hand chan text} {
# $text contains the full text including !bla/!sysinfo as first word
}
The last thing you suggest is not possible. However, it just seems to be a shortcut to binding all commands to the respective proc, which you could just do with a loop
Code: Select all
set trigger !
foreach cmd {sysinfo bla uptime foobar} {
bind pub - ${trigger}$cmd "myproc $cmd"
}
here's the reference manual explaining bind types