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.

tcl error in script for..

Old posts that have not been replied to for several years.
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

tcl error in script for..

Post by chasm »

hi.

i'm having a slight problem with something within my bot. now and then, i get this error:

[15:10:23] <botnick> [15:05] Tcl error in script for 'timer1176':
[15:10:24] <botnick> [15:05] can't read "uhost": no such variable

[note: the timer is always random, so it goes from timer1XX to timer 1XXX ++]

i have no idea why and it seems like this doesn't affect the bot in any way. it is still somewhat annoying and i would like to know -where- the error is, -what- causes it and -how- i can fix it.

because i use alot of tcls (about 25.. yeah, i know its alot), i can't unload one and one. this just takes too long. believe me, i've tried.

so if anyone here has another suggestion, please reply.

thanks in advance. :wink:

//chasm
P
Photon
Op
Posts: 170
Joined: Wed Aug 28, 2002 8:00 am
Location: Liverpool, England

Post by Photon »

'Fraid not... the timer number is always pretty much random...

If you had the time you could eliminate scripts without timers in them (if there are any) by looking at the scripts, but other than that I'm afraid you are right in the 'remove one at a time' strategy.

However, if it aint broke, and you can't be arsed then I suggest strategically ignoring it... :wink:

[EDIT] if you can understand tcl, you could search through every script for timer calls, and check for a function that references uhost. However, how then to fix it is an entirely different kettle of fish. It was probably a silly mistake/typo on the behalf of the original scriptor... but that doesnt necessarily mean it would be easy to fix ...
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

eek, thats what i where / am afraid off.

hmpf, quite annoying i must say. well, if there is no other option.. i guess i'll have to start the removing of one at a time then.

thanks, photon. just keep posting if you or anyone else figures a way to make the job easier.

the -really- dumb part is that the error comes now and then, sometimes one time in one day and sometimes 4-5 times in one hour.

i can't -wait- to look into the config file.. :roll:

//chasm
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I don't have time to search, but there is a possibility, of locating the script, without having to unload them.

On this forum, there are a few posts regarding timer errors, and how to locate more information from them.

Within this, there are snippets of code (with instruction on how to use them).

They simply give a little more info on the error.

This information, will narrow down the search some.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

I really wish support would be coded in to name timers.. Argh..
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

bind dcc - test do_the_test
proc do_the_test {hand idx arg} {
  if {[llength [timers]] < 1} { putdcc $idx "No timers active"; return 0 }
  foreach b [timers] {
    putdcc $idx "$b"
  }
}
this small code will give you a littlebit more info at least ;), just type .test in partyline.
Elen sila lúmenn' omentielvo
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

oh, sweet.

i'll try it when i get home and post back with the results. i bet i'm running alot of timers and one or several of them are faulty in some way.

slennox should go through and test all the tcls that are available for download on egghelp.org [; ..because i've downloaded more or less everyone from this site. :P

//chasm
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

LO>

This is not his job to search every1 elses work.

Slennox has simply collected some of the more usful scripts for people. As for bugs, it's up to the creator.

With a full time job, do you think he has time to look through all 763 scripts.

As for the code above, that will simply display current timers.

The timer at error, may be set 1 seccond before it makes an error (people use 1 second timers to prevent loop lockup). So unless you know exactly when to hit return, there is no point.

After a little search, like most people should do

Code: Select all

rename timer _timer 
rename utimer _utimer 
proc timer {time cmd} { 
_timer $time [list debug_timer t $cmd] 
} 
proc utimer {time cmd} { 
_utimer $time [list debug_timer u $cmd] 
} 
proc debug_timer {t cmd} { 
if {[catch $cmd a]} { 
if {$t = "t"} { 
putlog "Timer error: [lindex $cmd 0] : $a" 
} else { 
putlog "Utimer error: [lindex $cmd 0] : $a" 
} 
} 
}
That should work.

Place in a file in the scripts directory, and set the bot to load it.

When a error happens, it should give more information.
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

ppslim, the slennox-comment was just a joke. thats why i used the [; smiley. okay? heh. let me use the <ironi> and </ironi> from now on. :P

i'll try that codebit too. i just need to make a rename.tcl, enter that code and load it like a normal script? no triggers or anything that i have to enter in the partyline to make it work?

i have no tcl-knowledge, but i don't see any bind and therefor my instinct tells me that there is no command.

am i right? (;

//chasm
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

ppslim:

after loadin your script, i got this error:

<botnick> [11:07] Tcl error in script for 'timer87':
<botnick> [11:07] syntax error in expression "$t = "t"": extra tokens at end of expression

this one is new to me.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

"$t = "t"" <--- it has a " extra, make it "$t = "t" and it should work
Elen sila lúmenn' omentielvo
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

i can't seem to find "$t = "t"" in the code.

take a look at ppslim's code if you can spot it. i had to shut the bot down btw, because the error i mentioned came very often after a while. :cry:

//chasm
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Papillon wrote:"$t = "t"" <--- it has a " extra, make it "$t = "t" and it should work
THis is not true, and it is caused by my own handy work.

Just to note, the message displayed is an error caused by my scritp, and not in your scripts. The phanton " is not true, as it's the way the code is displayed (IE, the message simply quotes the errornous code, within quotes. This makes it look at error).

To fix this, edit the rename.tcl script you created (with the code I provded as content).

Locat ethe line
if {$t = "t"} {
and change it to
if {$t == "t"} {
This will fix the error int his script. It should now display the correct error message you need.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

chasm wrote:i can't seem to find "$t = "t"" in the code.

take a look at ppslim's code if you can spot it. i had to shut the bot down btw, because the error i mentioned came very often after a while. :cry:

//chasm
Look again, it is there. Change it to: $t == "t".
c
chasm
Voice
Posts: 22
Joined: Tue Jan 07, 2003 7:50 am
Location: porsgrunn, telemark, norway
Contact:

Post by chasm »

egghead: there is/was no $t = "t"" on the code. that is wrong. i see you posted at the same time as ppslim, so yes.. the error has been fixed with adding one more = to the code.

ppslim: thanks again, i hope it'll work better now. the bot is restarted and i am waiting for one error or more. :P

//chasm
Locked