for my spam detector eggdrop bot, but I get an error.
[20:50] Tcl error [cycle]: called "cycle" with too many arguments
It gives me an error, saying too many arguments.#Set channel to activate private spam detector on
set spamchan "#chatzone"
#Set the time when the bot will leave the channel, after staying on the channel (in mins)
set leavetime 4
#Set the time when the bot will rejoin the channel in its cycle, after parting the channel (in secs)
set rejointime 90
bind pub m .cycle cycle
timer $rejointime cycle
proc cycle {} {
global spamchan leavetime rejointime
channel set $spamchan +inactive
putlog "Cycling $spamchan to detect spammers, well rejoin $spamchan after $rejointime secs now."
utimer $rejointime { channel set $spamchan -inactive }
putlog "Rejoined $spamchan after a cycle of $rejointime secs."
timer $leavetime cycle
}
I don't understand what is wrong could you please help me out.
I can put
putserv "PART $spamchan"
putserv "JOIN $spamchan"
That makes it work, but the bot rejoins the second after it has parted, making it a quick cycle, one lasting 1 second or less.
Through the INACTIVE command I wanted to make a longer delay in cycle when it is parted. So spam bots don't ignore it for fast cycles, join/parts.
Please help me.