Hehe, yeah I use pushmode with flushmode alot in my scripts, although I never knew it could be as fast as putquick '-next' or putdccraw. I'll modify my current scripts to enforce it as well.
*user* is a revered one now!
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Stealthx wrote:Could anyone see what's wrong with the coding?
Yes...anyone could see it. (Compare your code to mine)
Thanks for your answer but I've change the [ ] to " ", the reason I've changed is because the timer doesn't work. Although it did +m and -m, but definitely not after the time that the timer (15sec) set
There could be a few more seconds added before the -m is sent due to the internal delay to prevent flooding. Removing the brackets ([]) will not change this. How long did it take to mode the channel -m?
list makes a list (which is what utimer expects - passing it a string like you do now is not a good idea)
It's depends. Sometime the bot would take up to 15 secs (one or two time) and majority it only took 1-3 secs and the bot would -m to the channel. Just like this -
::20:22:31:: <@Bot> Netsplit detected, channel set to +m for 15 secs.
::20:22:32:: * Bot sets mode: +m
::20:22:35:: * Bot sets mode: -m
::20:22:31:: <@Bot> Netsplit detected, channel set to +m for 15 secs.
::20:22:32:: * Bot sets mode: +m
::20:22:35:: * Bot sets mode: -m
Although I've set the timer to 15secs.
When did the split occur? Do you have any other scripts sending stuff to the server on splits? Is your bot in many channels that are moded +m by this script? Try adding a flushmode after the first pushmode
bind splt - * netsplit:lock
proc netsplit:lock {n u h c {r " "}} {
global netsplit_lock
if {![info exists netsplit_lock($c)]} {
if {![string match *m* [scan [getchanmode $c] %s]]} {
pushmode $c +m
puthelp "PRIVMSG $c :Netsplit detected, channel will be set to moderated for 30 seconds."
utimer 30 [list pushmode $c -m]
}
set netsplit_lock($c) "#abc"
utimer 30 [list unset netsplit_lock($c)]
}
}
But doesn't work, the bot doesn't set +m to the channel anymore and I see no error in the TCL. What's wrong?
I'm using the locking system on my bot with another script and it works fine for me, plus it is proving to be very effective especially for channel notice and long text floods. So much effective that I've removed sentinel.tcl from my bot as it made the bot alot slower, and replaced it by adding a clone kicker detecting fast joins. I modified the lock timer to be removed after 10secs and it works fine for me.
Here are my settings, if we replace them into this script:
There is nothing complicated between his code and my code. Didn't modify anything in the original procedure, just added an extra proc, so the bot doesn't remove un-necessary modes, i.e. it doesn't remove modes which aren't set in the channel.
That is because when floods happen other people also set modes, and remove modes and I've seen on alot of channels causes a mode flood, so if other people do mode floods, we don't want the bot to do it atleast.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================