I'm having an issue with vars, one proc is making the var, and I want another proc to be able to read that var.
Code: Select all
bind pub m|m "!LockDown" LockDown
bind pub m|m "!UnLock" UnLock
bind pubm - "*CONNECT*" CONNECTLOCKDOWN
proc LockDown { nick host hand chan text } {
global botnick LockDown
set LockDown on
putquick "MODE $botnick +s +cFs"
foreach chan [channels] {
putquick "MODE $chan +mNipCRS"
putquick "MODE $chan +k LockDownModeInitiated"
putquick "PRIVMSG $chan Network is going into lockdown mode, from this point until LockDown is removed, no one will be able to connect to this network."
}
}
proc UnLock { nick host hand chan text } {
global botnick LockDown
set LockDown off
putquick "MODE $botnick -s -cFs"
foreach chan [channels] {
putquick "MODE $chan -mNipCRS"
putquick "MODE $chan -k LockDownModeInitiated"
putquick "PRIVMSG $chan Network is off of LockDown, everything is back to normal."
}
}
proc CONNECTLOCKDOWN { nick host hand chan text } {
global LockDown
set User [lindex [split $text] 3]
if {$chan == "#4ct1v1ty" && $LockDown == "on"} {
putserv "GLINE [stripcodes bcruag $User] 5m :Network is in lockdown mode, this ban will expire in 5 minuets, please reconnect at that time"
} else {
return
}
}
I get this error:
[10/04/08][14:48:04] <NightCrawler> [11:41] Tcl error [CONNECT]: can't read "LockDown": no such variable