bind pub -|- "!info" pub:info
proc pub:info {nick host hand chan arg} {
set fname [open ts2.txt r]
while {![eof $fname]} {
set infos [gets $fname]
putquick "PRIVMSG $chan :$infos"
}
close $fname
}
Well, the prob is, when more then 1 person types !info the bot get crased. is it possible to create a spammprotection that tells, if sombody entered !info and gets the text, the other will get a notice like " Pls be Patient, trigger !info is in use. Try again in a few mins"
And is it also possible that the text comes out timed. well I only know it from msl. there u can make it with
bind pub -|- "!info" pub:info
set inuse 0
proc pub:info {nick host hand chan arg} {
global inuse
if { $inuse == 1 } {
putquick "PRIVMSG $chan :Sorry this function is in use please wait 20 seconds and try again"
return
}
set fname [open ts2.txt r]
while {![eof $fname]} {
set infos [gets $fname]
set inuse 1
putquick "PRIVMSG $chan :$infos"
utimer 20 {set inuse 0}
}
close $fname
}
This isn't tested but should work
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
if { $inuse == 1 } {
putquick "PRIVMSG $chan :Sorry this function is in use please wait 20 seconds and try again"
return
}
set fname [open ts2.txt r]
while {![eof $fname]} {
set infos [gets $fname]
set inuse 1
putquick "PRIVMSG $chan :$infos"
utimer 20 {set inuse 0}
}
close $fname
and to slow it down try using 'putserv' rather than 'putquick'
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Your binds have to match your proc names else it will not know which proc to call when that !trigger is called. Theres no point just changing its name and not know what its doing
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
bind pub -|- "!infouk" pub:infouk
set homechan "#xyz"
if {![info exists homechan]} {set homechan "[lindex [channels] 0]"}
set inuse 0
proc pub:infouk {nick host hand chan arg} {
global inuse
if { $inuse == 1 } {
putserv "PRIVMSG $nick :Sorry this function is in use please wait 20 seconds and try again"
return
}
set fname [open voiceuk.txt r]
while {![eof $fname]} {
set infos [gets $fname]
set inuse 1
putserv "PRIVMSG $nick :$infos"
utimer 20 {set inuse 0}
}
close $fname
}
bind pub -|- "!infouk" pub:infouk
set homechan "#xyz"
set inuse 0
proc pub:infouk {nick host hand chan arg} {
global inuse homechan
if { [string tolower $chan] != [string tolower $homechan] } { return }
if { $inuse == 1 } {
putserv "PRIVMSG $nick :Sorry this function is in use please wait 20 seconds and try again"
return
}
set fname [open voiceuk.txt r]
while {![eof $fname]} {
set infos [gets $fname]
set inuse 1
putserv "PRIVMSG $nick :$infos"
utimer 20 {set inuse 0}
}
close $fname
}
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born