| View previous topic :: View next topic |
| Author |
Message |
SaW Voice
Joined: 19 Jan 2007 Posts: 8 Location: Turkey
|
Posted: Tue Jun 26, 2007 3:42 pm Post subject: "set" problem.. |
|
|
| Code: | bind raw * notice tsnotice
proc tsnotice {from keyword arg} {
if {[string match "*Client connecting on port*" $arg]} {
if {[info exists gr]} {
set gr [lindex $arg 9]
utimer 10 [list set gr [lrange $gr 1 end]]
return 0
}
if {[llength $gr] > "1"} {
append gr " [lindex $arg 9]"
utimer 10 [list set gr [lrange $gr 1 end]]
if {[llength $gr] >= "10"} {
foreach nck $gr {
putquick "privmsg SaW: nicks : $nck"
}
unset $gr
}
}
}
} |
i want to bot msg me if 10 joins in 10 seconds, but it didnt work..
i try to see $gr each after joins from dcc with type .set gr
but the answer is:
bot: [15:40] #SaW# set gr
bot: Currently:
what is the mistake? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Jun 26, 2007 3:54 pm Post subject: |
|
|
gr is a localspace variable (only exists within the instance of the proc when it is invoked).
Simply put, as soon as your proc exits, it will forget all about any and all variables used within it. You'll have to use globalspace variables for them to persist. either adress them as ::varname (such as "set ::gr somevalue" and "foreach nck $::gr"), or use the global-command _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
SaW Voice
Joined: 19 Jan 2007 Posts: 8 Location: Turkey
|
Posted: Wed Jun 27, 2007 8:20 am Post subject: |
|
|
| thanks nml375. |
|
| Back to top |
|
 |
|