bind sign - * netsplit:lock
proc netsplit:lock {nick uhost hand chan text {reason ""}} {
There are several problems with this part... the sign bind will not be triggered untill ${::wait-split} (180 seconds by default) has passed. The argument containing the reason is called "text" and "reason" will always be "", so all that match stuff inside the proc will fail no matter what. But I guess that's a good thing as you don't split the reason before you start using list commands on it.
How about using the splt bind like gb said?
@ Stealthx:
The *sign* bind proc expects 5 args not 6, so just remove "text" from the proc netsplit:lock line. As for your previous post, the *splt* proc expects 4 not 5 args like you have gave him.
@ awyeah:
You did a "set netsplit_lock($chan) 1" but you don't seem to use it to check again if that specific channel is locked or not. Again you call global botnick and again as always you don't use it. The lack of a "botisop" feature will eventually make it either get lagged for nothing, flood itself by trying to set some modes when he is not oped of flooding the specific channel with notes. Same goes with user's code or who wrote it in the first place.
Last edited by caesar on Wed Oct 27, 2004 5:10 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
bind sign - * netsplit:lock
proc netsplit:lock {nick uhost hand chan {reason ""}} {
global netsplit_lock
set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"]
if {(![info exists netsplit_lock($chan)]) && ([string match -nocase "*.??.galaxynet.org" [lindex $reason 0]]) && ([string match -nocase "*.??.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2)} {
if {([botisop $chan]) && ([lsearch -exact $checkmode "m"] == -1)} {
putquick "MODE $chan +m" -next
putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next
utimer 10 [list putquick "MODE $chan -m" -next]
}
set netsplit_lock($chan) ""
utimer 15 [list unset netsplit_lock($chan)]
}
return 0
}
I think we should add botisop $chan as well as caesar mentioned, but then again I didn't feel the need as I wanted the code to be simplest and general as possible.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
The lack of a "botisop" feature will eventually make it either get lagged for nothing, flood itself by trying to set some modes when he is not oped of flooding the specific channel with notes.
or what do you mean by "No. Because i set the variable on the first quit no matter if the channel is +m or not."? Haven't understood a thing..
@ awyeah:
user pointed you something too .. anyway as you wish.
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:@ user:
I was only talking about this part:
The lack of a "botisop" feature will eventually make it either get lagged for nothing, flood itself by trying to set some modes when he is not oped of flooding the specific channel with notes.
or what do you mean by "No. Because i set the variable on the first quit no matter if the channel is +m or not."? Haven't understood a thing..
My code should only pushmode once per channel - and ONLY if the channel is not already +m - and pushmode should take care of the op checking, so there's no need to check if botisop imo.
Hmm... anyway pushmode would be slower as well, when dealing with floods and when you want to set locks +m, +i or whatever, we should use a faster queue I suppose, like I intended to do.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
awyeah wrote:Hmm... anyway pushmode would be slower as well, when dealing with floods and when you want to set locks +m, +i or whatever, we should use a faster queue I suppose, like I intended to do.
putquick is using the same queue as pushmode...if you want to speed it up, just add a flushmode.