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.

rehash error

Old posts that have not been replied to for several years.
Locked
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

rehash error

Post by ranny »

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
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Code: Select all

trace add variable ::errorInfo write {puthelp "PRIVMSG #YOURCHANNEL :TCL ERROR: $::errorInfo";#}
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

hum thanks avilon,

but how use that?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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 :D.
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...
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

Yes thanks, it works.

But egg write several error message and several times.How write just last message error??
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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...
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

hello,

I've restart and it's ok.Thanks :lol:
Another question: It's possible to write the name of the proc where there's a error :?:
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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...
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

Hello,

I've a script test where missing " and the egg write on the channel
[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: Select all

trace add variable ::errorInfo write {
putserv "PRIVMSG #yeah :[string map {\n " | "} $::errorInfo]"
}
How make for just write on the channel
tlc error:missing " of proc "test"
:cry: :?:
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Code: Select all

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.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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 :D.
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...
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

Hum,

I don't understand.

In partyline i've just
<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
[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?
r
ranny
Halfop
Posts: 49
Joined: Wed Jun 22, 2005 2:00 pm
Location: switzerland

Post by ranny »

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 :?:
Locked