This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
bsdkid
Voice
Posts: 16 Joined: Wed Nov 02, 2005 1:04 am
Post
by bsdkid » Wed Dec 07, 2005 1:18 pm
problem solved. thanks guys!
Last edited by
bsdkid on Sun Dec 11, 2005 12:12 am, edited 2 times in total.
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Wed Dec 07, 2005 3:01 pm
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...
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Wed Dec 07, 2005 7:53 pm
I'm fascinated as to how one who is apparently ignorant of Tcl could determine there was even a "memory leak".
Last edited by
Alchera on Thu Dec 08, 2005 12:03 am, edited 1 time in total.
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
bsdkid
Voice
Posts: 16 Joined: Wed Nov 02, 2005 1:04 am
Post
by bsdkid » Wed Dec 07, 2005 10:28 pm
Thank you De Kus!
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Wed Dec 07, 2005 10:57 pm
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
. making it absolutely misstake proof you would probably need to lsearch the sublist in a foreach loop
.
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...
bsdkid
Voice
Posts: 16 Joined: Wed Nov 02, 2005 1:04 am
Post
by bsdkid » Thu Dec 08, 2005 3:12 pm
hey man, how do i remove nick in team array?
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Fri Dec 09, 2005 4:06 pm
XplaiN but think of me as stupid
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Fri Dec 09, 2005 4:50 pm
thats not what he is looking for.
thats how far we got yesterday:
Code: Select all
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...