I'm a noob in TCL scripting... Hope someone else out there would be able to help out in my "tcl"... This TCL must be able to detect netsplit and set +m to the channel (#abc) and after 30secs, bot must set -m to the channel...
This is not correct. To bind to a signoff/quit message, you should use the bind SIGN... (10) SIGN (stackable)
bind sign <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <reason>
Description: triggered by a signoff, or possibly by someone who got
netsplit and never returned. The signoff message is the last
argument to the proc. Wildcards can be used in the mask, which is
matched against '#channel nick!user@host'.
Module: irc
bind sign - * netsplit:lock
proc netsplit:lock {nick uhost hand chan text {reason ""}} {
global botnick netsplit_lock
set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"]
if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} {
putquick "MODE $chan +m" -next; set netsplit_lock 1
putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next
utimer 10 [list putquick "MODE $chan -m" -next]
utimer 15 [list unset netsplit_lock]
}
return 0
}
For more security you can check if control codes are not present in the message, or if any upper-case character is not present and string range or lrange and match the reason.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
This is not correct. To bind to a signoff/quit message, you should use the bind SIGN... (10) SIGN (stackable)
bind sign <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <reason>
Description: triggered by a signoff, or possibly by someone who got
netsplit and never returned. The signoff message is the last
argument to the proc. Wildcards can be used in the mask, which is
matched against '#channel nick!user@host'.
Module: irc
Oh okie... Thanks
WeiJie
Admin of IntelFusion Http://dj-online.org
#Sparks@Boatquay @ mIRC Galaxynet
bind sign - * netsplit:lock
proc netsplit:lock {nick uhost hand chan text {reason ""}} {
global botnick netsplit_lock
set checkmode [string trim [lindex [split [getchanmode $chan]] 0] "+"]
if {(![info exists netsplit_lock]) && ([lsearch -exact $checkmode "m"] == -1) && ([string match "*.*.galaxynet.org" [lindex $reason 0]]) && ([string match "*.*.galaxynet.org" [lindex $reason 1]]) && ([llength $reason] == 2]) && ([lindex $reason 2] == "")} {
putquick "MODE $chan +m" -next; set netsplit_lock 1
putquick "NOTICE $chan :Netsplit detected, channel set to +m for 10 secs. ;)" -next
utimer 10 [list putquick "MODE $chan -m" -next]
utimer 15 [list unset netsplit_lock]
}
return 0
}
For more security you can check if control codes are not present in the message, or if any upper-case character is not present and string range or lrange and match the reason.
Hmm, but how do i add in those channel that I want the bot to work on?
Does...
For those working channels you need to an another lsearch -exact to check if the channel the script is triggered on the channel which is in the working channel list.
Yes utimer with list should work.
Your channel is not #abc, its $chan.
Replace all #abc in your script by $chan.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
No this will not work, because the script will try to match a netsplit message, not a public trigger bind. Only if your trigger message has the same text as a netsplit message and nothing else. Moreover {reason ""} would be replaced simply by reason or text if you like.