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.

Caesar's tsunami.tcl shows an error in partyline.

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I haven't got any "no such element in array" errors in the tsunami.tcl and/or even not in the njf.tcl (version 0.3) wich should be working fine.
Once the game is over, the king and the pawn go back in the same box.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

It looks like you initialize the array at the beginning of the script. So if somebody does a .+chan after it's loaded, that entry won't exist. Maybe instead you should use if {![info exists bla(chan)]} {set bla(chan) 0} at the top of each proc where you access the array? Or better, put it in a proc called init_chan $chan, which does that line.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Yes, in this one I have forgot to add this, but in the njf.tcl it exists:
# fix after an .chanset on a channel
if {![info exists val([strlwr $chan])]} { set val([strlwr $chan]) 0 }
For the tsunami.tcl this should be somehting like this:

Code: Select all

if {![info exists bla([strlwr $chan])]} { set bla([strlwr $chan]) 0 }
Anyway, as I have wrote in it is a beta thing so yah, it's buggy.
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, replace from:

Code: Select all

if {[string length [join [split $text] ""]] > "$linelength"} {
to:

Code: Select all

if {[llength [split $text ""]] > "$linelength"} {
and there goes another fixed "bug" :)

Ps: the "if {![info exists bla([strlwr $chan])]} { set bla([strlwr $chan]) 0 } " should be added before the "set linelength [lindex [split $::ltl ":"] 3]" somewhere..
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Replace from:

Code: Select all

if {[string match [strlwr [strlwr $chan]] $arr_part]} {
to:

Code: Select all

if {[string match [strlwr $chan] $arr_part]} {
there is no need to make it lower case twice, duno how I've missed that. :oops:
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok I added the "if {![info exists bla([strlwr $chan])]} { set bla([strlwr $chan]) 0 }" right before the "set linelength...", so now its:

Code: Select all

if {![info exists bla([strlwr $chan])]} { set bla([strlwr $chan]) 0 }
  set linelength [lindex [split $::ltl ":"] 3]
and I replaced those 2 codes u told me to
--but should I keep this code ?:

Code: Select all

# array fix #
foreach chan [channels] {
  set bla([strlwr $chan]) 0
}
or should I remove it ?
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Yes, it should be there.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok thanx :)
No usch errors are appearing anymore :D
Locked