View previous topic :: View next topic |
Author |
Message |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Thu Sep 29, 2005 1:45 pm Post subject: rehash error |
|
|
hello
i looking for a script that when it's a error message when rehash, egg write it on the channel.
It's possible??
thx |
|
Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Thu Sep 29, 2005 2:27 pm Post subject: |
|
|
Code: | trace add variable ::errorInfo write {puthelp "PRIVMSG #YOURCHANNEL :TCL ERROR: $::errorInfo";#} |
|
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Thu Sep 29, 2005 3:15 pm Post subject: |
|
|
hum thanks avilon,
but how use that? |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Thu Sep 29, 2005 3:40 pm Post subject: |
|
|
run it on party line.
however i would suggest to use [lindex [split $::errorInfo \n] 0] within the puthelp argument to avoid your bot from sending invalid IRC commands to the server. You could also use [string map {\n " | "} $::errorInfo] or something like that, but that print loong lines without any proper formatation . _________________ 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... |
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Fri Sep 30, 2005 9:11 am Post subject: |
|
|
Yes thanks, it works.
But egg write several error message and several times.How write just last message error?? |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Sep 30, 2005 11:55 am Post subject: |
|
|
if the var changes several times, several diffrent errors occured ^-^. no way to find out the "last" error, since every single error is at the moment it occurs the "last one". _________________ 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... |
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Fri Sep 30, 2005 12:15 pm Post subject: |
|
|
hello,
I've restart and it's ok.Thanks
Another question: It's possible to write the name of the proc where there's a error  |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Sep 30, 2005 1:56 pm Post subject: |
|
|
follow the 2nd suggestion of my 1st post here. this will send the statement where the error occurs plus a full traceback how it was called. however the line will be cut so the full line is only 512byte (including \r\n) _________________ 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... |
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Fri Sep 30, 2005 3:51 pm Post subject: |
|
|
Hello,
I've a script test where missing " and the egg write on the channel Quote: | [21:34:40] ( mybot ): missing "
[21:34:41] ( mybot): invalid command name "::errorInfo" | while executing | "::errorInfo {} write" | while compiling | "putquick "privmsg #toto :pol | "
[21:34:42] ( mybot ): missing "
[21:34:44] ( mybot ): invalid command name "::errorInfo" | while executing | "::errorInfo {} write" | (compiling body of proc "test", line 3)
[21:34:47] (mybot): missing "
[21:34:49] ( mybot ): invalid command name "::errorInfo" | while executing | "::errorInfo {} write" | while executing | "test $_pub1 $_pub2 $_pub3 $_pub4 $_pub5" |
I've just this code Code: | trace add variable ::errorInfo write {
putserv "PRIVMSG #yeah :[string map {\n " | "} $::errorInfo]"
} |
How make for just write on the channel Quote: | tlc error:missing " of proc "test" |
 |
|
Back to top |
|
 |
avilon Halfop

Joined: 13 Jul 2004 Posts: 64 Location: Germany
|
Posted: Fri Sep 30, 2005 5:41 pm Post subject: |
|
|
Code: | trace add variable ::errorInfo write foo
proc foo {name1 name2 op} {
foreach line [longtextout $::errorInfo] { puthelp "PRIVMSG #YOURCHANNEL :$line" }
}
proc longtextout text {
set text [split [string map {\n " "} $text]];set curpos 0
for {set x 1} {$x<=[llength $text]} {incr x} {
if {[string length [join [lrange $text $curpos $x]]]>400} {
lappend curout [join [lrange $text $curpos [expr {$x-1}]]]
set curpos $x
}
}
if {$curpos!=[expr {[llength $text]-1}]} {lappend curout [join [lrange $text $curpos end]]}
set curout
} |
Last edited by avilon on Sat Oct 01, 2005 8:32 am; edited 1 time in total |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Oct 01, 2005 3:07 am Post subject: |
|
|
hmm, strange, missing " usually returns some more infos. have you checked raw logging in partyline? maybe it breaks on some special char which I cant think of . _________________ 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... |
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Sat Oct 01, 2005 6:47 am Post subject: |
|
|
Hum,
I don't understand.
In partyline i've just Quote: | <mybot> [12:27] Tcl error [test]: missing " |
And i will want that the eggdrop write on the channel this message.
But with avilon's script the egg write Quote: | [12:27:34] (@mybot) : TCL ERROR ->
[12:27:36] (@mybot) : missing "
[12:27:38] (@mybot) : TCL ERROR ->
[12:27:40] (@mybot) : missing " while compiling "putquick "privmsg #toto :pol "
[12:27:42] (@mybot) : TCL ERROR ->
[12:27:44] (@mybot) : missing "
[12:27:46] (@mybot) : TCL ERROR ->
[12:27:48] (@mybot) : missing " (compiling body of proc "test", line 3)
[12:27:50] (@mybot) : TCL ERROR ->
[12:27:52] (@mybot) : missing "
[12:27:54] (@mybot) : TCL ERROR ->
[12:27:56] (@mybot) : missing " while executing "test $_pub1 $_pub2 $_pub3 $_pub4 $_pub5" |
And with other message error, the egg writes more message error
It's possible write the proc and the script where there's error? |
|
Back to top |
|
 |
ranny Halfop
Joined: 22 Jun 2005 Posts: 49 Location: switzerland
|
Posted: Tue Oct 04, 2005 2:59 am Post subject: |
|
|
Hello,
it's ok for error message.Thanks for help.
Just,i don't now how write the proc where there is an error.It's possible to find that  |
|
Back to top |
|
 |
|