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 

rehash error

 
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
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Thu Sep 29, 2005 1:45 pm    Post subject: rehash error Reply with quote

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
View user's profile Send private message
avilon
Halfop


Joined: 13 Jul 2004
Posts: 64
Location: Germany

PostPosted: Thu Sep 29, 2005 2:27 pm    Post subject: Reply with quote

Code:
trace add variable ::errorInfo write {puthelp "PRIVMSG #YOURCHANNEL :TCL ERROR: $::errorInfo";#}
Back to top
View user's profile Send private message
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Thu Sep 29, 2005 3:15 pm    Post subject: Reply with quote

hum thanks avilon,

but how use that?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Thu Sep 29, 2005 3:40 pm    Post subject: Reply with quote

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 Very Happy.
_________________
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
View user's profile Send private message MSN Messenger
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Fri Sep 30, 2005 9:11 am    Post subject: Reply with quote

Yes thanks, it works.

But egg write several error message and several times.How write just last message error??
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Sep 30, 2005 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Fri Sep 30, 2005 12:15 pm    Post subject: Reply with quote

hello,

I've restart and it's ok.Thanks Laughing
Another question: It's possible to write the name of the proc where there's a error Question
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Sep 30, 2005 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Fri Sep 30, 2005 3:51 pm    Post subject: Reply with quote

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"


Crying or Very sad Question
Back to top
View user's profile Send private message
avilon
Halfop


Joined: 13 Jul 2004
Posts: 64
Location: Germany

PostPosted: Fri Sep 30, 2005 5:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Oct 01, 2005 3:07 am    Post subject: Reply with quote

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 Very Happy.
_________________
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
View user's profile Send private message MSN Messenger
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Sat Oct 01, 2005 6:47 am    Post subject: Reply with quote

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 Question Question

It's possible write the proc and the script where there's error?
Back to top
View user's profile Send private message
ranny
Halfop


Joined: 22 Jun 2005
Posts: 49
Location: switzerland

PostPosted: Tue Oct 04, 2005 2:59 am    Post subject: Reply with quote

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 Question
Back to top
View user's profile Send private message
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
Page 1 of 1

 
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