I want to have my tcl script post a message to the channel if a user's text matches my regexp.
Here is the script i have so far:
Code: Select all
bind pubm - * helptext
proc helptext {nick uhost hand chan text} {
set response default
set helptext [string tolower $text]
if [regexp {(admin|op|pm).*(admin|op|pm)} $helptext] {
set response "Please ask your question in the channel before asking an admin/op to PM you."
}
if [regexp {(\dv\d|\d v \d).*(our|your)} $helptext] {
set response "Please use #findscrim to find scrims"
}
if ![regexp -nocase {default} $response] {
putmsg $chan "\002\037$nick:\037\002 $response"
}
}
For example - Say a user posts this:
5v5 | east | yours | cal o | dust 2
I want it to say "Please use #findscrim to find scrims"
But if they say this:
5v5 | east | yours | cal o | dust 2
5v5 | east | yours | cal o | dust 2
5v5 | east | yours | cal o | dust 2
5v5 | east | yours | cal o | dust 2
5v5 | east | yours | cal o | dust 2
5v5 | east | yours | cal o | dust 2
I want it to say "Please use #findscrim to find scrims" once then wait five seconds then if they repeat the line 5v5 | east | yours | cal o | dust 2 again (after 5 seconds), I want the eggdrop bot to say it again (and possibly kick them out of the channel giving them the reason again: "Didn't I tell you to use #findscrim?")
Sorry if this is confusing, I hope someone can give me a hand with this.
Thanks,
-Noah