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 with array

Help for those learning Tcl or writing their own scripts.
b
bsdkid
Voice
Posts: 16
Joined: Wed Nov 02, 2005 1:04 am

Post by bsdkid »

I think something is wrong with this, after i reload the score array when the bot restart it screwed up.

Code: Select all

set f [open score.txt]
foreach line [split [read $f]] {
   foreach {n s} [split $line] {
      set score($n) [list $n $s]
   }
}
close $f 
b
bsdkid
Voice
Posts: 16
Joined: Wed Nov 02, 2005 1:04 am

Post by bsdkid »

Currently: expected integer but got ""
Currently: while executing
Currently: "incr sco $pointvalue"
Currently: invoked from within
Currently: "if [info exists score($lnick)] {
Currently: set sco [lindex $score($lnick) 1]
Currently: lset score($lnick) 1 [incr sco $pointvalue]
Currently: } {
Currently: set score($lnick)..."
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

well, you have 2 options: either understand completely what you've created so far using my code - and then help yourself, or paste your entire script and hope someone will fix it for you (I won't do that, I'm not in the mood for debugging right now)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply