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 

memory leak

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


Joined: 02 Nov 2005
Posts: 16

PostPosted: Wed Dec 07, 2005 1:18 pm    Post subject: memory leak Reply with quote

problem solved. thanks guys!

Last edited by bsdkid on Sun Dec 11, 2005 12:12 am; edited 2 times in total
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Dec 07, 2005 3:01 pm    Post subject: Reply with quote

I don't see anything that should cause a memory leak.
for only 1 team per nick, you should do a lsearch for the nick in the array like:
lsearch -exact [array get ::team] $n

PS: reading the rest of the srcipt and the TCL manual is everything you need to know to insert that code.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Dec 07, 2005 7:53 pm    Post subject: Reply with quote

I'm fascinated as to how one who is apparently ignorant of Tcl could determine there was even a "memory leak". Neutral
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM


Last edited by Alchera on Thu Dec 08, 2005 12:03 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
bsdkid
Voice


Joined: 02 Nov 2005
Posts: 16

PostPosted: Wed Dec 07, 2005 10:28 pm    Post subject: Reply with quote

Thank you De Kus!
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Dec 07, 2005 10:57 pm    Post subject: Reply with quote

i dont exactly know if it will work on teams with more than 1 nick. I dont have the time to check exactly how array get will look like. you could use -glob and *$n* instead than, but that might lead into wrong matchs again Very Happy. making it absolutely misstake proof you would probably need to lsearch the sublist in a foreach loop Very Happy.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
bsdkid
Voice


Joined: 02 Nov 2005
Posts: 16

PostPosted: Thu Dec 08, 2005 3:12 pm    Post subject: Reply with quote

hey man, how do i remove nick in team array?
Back to top
View user's profile Send private message
Ofloo
Owner


Joined: 13 May 2003
Posts: 953
Location: Belguim

PostPosted: Fri Dec 09, 2005 4:06 pm    Post subject: Reply with quote

try array unset
_________________
XplaiN but think of me as stupid
Back to top
View user's profile Send private message Visit poster's website
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Dec 09, 2005 4:50 pm    Post subject: Reply with quote

thats not what he is looking for.

thats how far we got yesterday:
Code:
Dez 09 04:58:26 EvilMan   set refresh [lsearch [array get ::team] $nick]
Dez 09 04:58:28 EvilMan     set a [array get ::team]
Dez 09 04:58:28 EvilMan     set remove [lsearch -all -inline -glob [lindex $a $refresh] *$nick*]
Dez 09 04:58:28 EvilMan     set ::team([lindex $a [expr {$refresh - 1}]) [lreplace [lindex $a $refresh] $remove $remove]]
Dez 09 05:00:38 De_Kus   dont use -all and -inline ^-^
Dez 09 05:01:34 EvilMan    Tcl error [partteam]: bad index "0)": must be integer or end?-integer?
Dez 09 05:02:46 De_Kus   have you a close brake behind the lsearch  statement? :P
Dez 09 05:03:25 EvilMan   set remove [lsearch -glob [lindex $a $refresh] *$nick*]
Dez 09 05:04:08 De_Kus   look at the completet error, maybe you are missing something again :D
Dez 09 05:04:47 EvilMan   Currently: bad index "0)": must be integer or end?-integer?
Dez 09 05:04:47 EvilMan   Currently:     while executing
Dez 09 05:04:47 EvilMan   Currently: "lindex $a [expr {$refresh - 1}]) [lreplace [lindex $a $refresh] $remove $remove]"
Dez 09 05:04:47 EvilMan   Currently:     (procedure "partteam" line 9)
Dez 09 05:04:47 EvilMan   Currently:     invoked from within
Dez 09 05:04:48 EvilMan   Currently: "partteam $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"

_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
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