i am trying to write a code for when someone connecting to the server 60 seconds later my bot gonna check that nickname if this nickname is an unregistered or not if its unregistered my bot gonna send him/her to a random msg from a txt file . . i've been try to make something like this but the code wont work like that (my bot has oper flag btw.) and couldnt sent msgs to the user.it should be two procs into this code ..i guess ..but the problem is these two procs wont work together correctly like i want .
- Код: Выделить всё
bind raw * notice go:entry
proc go:entry {from keyword arg} {
set nick [lindex $arg 9]
if {[string match "*Client connecting*" $arg]} {
utimer 55 putquick "privmsg nickserv info $nick"
}
if {[string match "*is not registered*" $arg]} {
w "entry.txt" $nick
}
}
proc w {txt nick} {
set readfile [open scripts/$txt r]
set listenter [split [subst -nocommands [read $readfile]] "\n"]
set rmsg [lindex $listenter [rand [llength $listenter]]]
utimer 60 [list putquick "privmsg $nick :$rmsg"]
close $readfile
}
thanks
my best regards .