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.

ping bug

Old posts that have not been replied to for several years.
Locked
User avatar
jsilvestre
Voice
Posts: 20
Joined: Sat Mar 05, 2005 6:02 am
Location: Lisbon, Portugal

ping bug

Post by jsilvestre »

Code: Select all

bind pub - !ping pub:ping
bind ctcr - PING pub:pingr

proc say {who what} {
   puthelp "PRIVMSG $who :$what"
}


set pub_pingchan "#teste"

proc pub:ping {nick uhost hand chan args} {
   set args [split [cleanarg $args]]
   if {[llength $args]<1} {
      set who $nick
   } else {
      set who [lindex $args 0]
   }
   global pub_pingchan
   set time [unixtime]
   say $who "\001PING $time\001"
   set pub_pingchan $chan
}

proc pub:pingr {nick uhost hand dest keyword args} {
   global pub_pingchan
   set temp [unixtime]
   set time [expr $temp - $args]
   say $pub_pingchan "PING reply from $nick: $time seconds"
}

Code: Select all

[15:01] <teste> [16:04] Tcl error [pub:ping]: invalid command name "cleanarg"

Code: Select all

[15:06] <made_of_storm> .set errorInfo
[15:06] <teste> [16:08] tcl: builtin dcc call: *dcc:set made_of_storm 9 errorInfo
[15:06] <teste> [16:08] #made_of_storm# set errorInfo
[15:06] <teste> Currently: invalid command name "cleanarg"
[15:06] <teste> Currently:     while executing
[15:06] <teste> Currently: "cleanarg $args"
[15:06] <teste> Currently:     (procedure "pub:ping" line 2)
[15:06] <teste> Currently:     invoked from within
[15:06] <teste> Currently: "pub:ping $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Best Regards

José Eduardo Silvestre
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you have to find a script with the proc cleanarg :P. i dont know what it does, but try to remove it and use the var name "arg" instead of "args"
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...
t
the_crow
Halfop
Posts: 42
Joined: Fri Feb 28, 2003 7:37 am
Location: Lisboa, Portugal

Post by the_crow »

Oh português :) O cleanarg é um procedure...

Code: Select all

proc cleanarg {arg} {
  set response ""
  for {set i 0} {$i < [string length $arg]} {incr i} {
    set char [string index $arg $i]
    if {($char != "\12") && ($char != "\15")} {
      append response $char
    }
  }
  return $response
}

tenta utilizar isso :)
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

then use a regsub or string map so filter \n and \r @_o. I believe a search on the forum wil help if you don't know how to use them.
*still hates redudant functions that are already solved by built in ones*.
just looking at these 10 lines of nonsense gives me the chill :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...
Locked