egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"set" problem..

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
SaW
Voice


Joined: 19 Jan 2007
Posts: 8
Location: Turkey

PostPosted: Tue Jun 26, 2007 3:42 pm    Post subject: "set" problem.. Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Jun 26, 2007 3:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
SaW
Voice


Joined: 19 Jan 2007
Posts: 8
Location: Turkey

PostPosted: Wed Jun 27, 2007 8:20 am    Post subject: Reply with quote

thanks nml375.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber