But it only works when someone types !
I want it to work when someone types
!randomthing
!stuff
!lollllers
Basically when someone types anything after it.
Last edited by Hamish on Tue Oct 17, 2006 12:03 pm, edited 1 time in total.
Yes but there is lots of different possible !commands I could have. I used this:
bind pubm - "% !*" proc:stuff
And that worked.
But I need a way so I can store all the possible commands after that, I tried in a text file but It didn't quite work, can someone help?
You're better off using if's to test the input for specific keywords, otherwise people will type all kinds of random junk and you'll soon find your bot behaving badly.
There are plenty of example scripts for making triggers, using either a specific comamnd with pub, or using wildcards with pubm. Check the tcl archive.
# don't inclide the prefix character in the array keys
# because it is trimmed off in the stuff proc to allow
# having several prefixes for the same command
array set stuff {
omg {what did your god do?}
lol {what are you laughing at?}
help {help yourself.}
hello {hi there!}
}
bind pubm - "% !*" stuff
bind pubm - "% @*" stuff
proc stuff {n u h t a} {
global stuff
if {[scan $a "%*c%s" w]&&[info exists stuff($w)]} {
puthelp "PRIVMSG $t :$stuff($w)"
}
}
# to make it work with private messages, add this:
bind msgm - !* pstuff
proc pstuff {n u h a} {stuff $n $u $h $n $a}
Hamish wrote:Also is there a command like, setchaninfo but to set a user's default info line instead of just the info line for that channel?