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 

Caesar's tsunami.tcl shows an error in partyline.
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 11:56 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
stdragon
Owner


Joined: 23 Sep 2001
Posts: 959

PostPosted: Tue Jun 10, 2003 12:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Wed Jun 11, 2003 12:52 am    Post subject: Reply with quote

Yes, in this one I have forgot to add this, but in the njf.tcl it exists:
Quote:

# 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:

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.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Wed Jun 11, 2003 3:04 am    Post subject: Reply with quote

Also, replace from:
Code:

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

to:
Code:

if {[llength [split $text ""]] > "$linelength"} {

and there goes another fixed "bug" Smile

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.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Wed Jun 11, 2003 5:33 am    Post subject: Reply with quote

Replace from:
Code:

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

to:
Code:

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

there is no need to make it lower case twice, duno how I've missed that. Embarassed
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jun 11, 2003 11:29 am    Post subject: Reply with quote

ok I added the "if {![info exists bla([strlwr $chan])]} { set bla([strlwr $chan]) 0 }" right before the "set linelength...", so now its:
Code:
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:
# array fix #
foreach chan [channels] {
  set bla([strlwr $chan]) 0
}

or should I remove it ?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Wed Jun 11, 2003 11:45 am    Post subject: Reply with quote

Yes, it should be there.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jun 11, 2003 12:08 pm    Post subject: Reply with quote

ok thanx Smile
No usch errors are appearing anymore Very Happy
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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