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.

bug with "clock clicks -milliseconds"

Old posts that have not been replied to for several years.
Locked
C
Caribou
Voice
Posts: 28
Joined: Thu Apr 15, 2004 12:51 pm
Location: France

bug with "clock clicks -milliseconds"

Post by Caribou »

Hello :D

Few weeks ago i did a ping reply on my bot using "clock clicks -milliseconds" to be more effective.

It worked nicely for about weeks, but now it is not working anymore, i did not modified the source code, its still the same...

I tried to see why its not working anymore, and i found that [clock clicks -milliseconds] is now giving a Negative number .. thats mean something like -845421547 .. then ping is not working anymore with a negative number.

Does anyone already had this sort of problem ? a [clock clicks command who give negative numbers ? i don't understand why it does this, maybe my shell hosting got bugged out ? :-?

Maybe this bot is just too much online and getting crazy..

Thanks for anyhelp and sorry for my bad english
C
Caribou
Voice
Posts: 28
Joined: Thu Apr 15, 2004 12:51 pm
Location: France

Post by Caribou »

I forgot to say, its a !ping command for users

Here is the source code :

Code: Select all

bind pubm - *!ping pub:ping
bind ctcr -|- PING ctcr:pingreply

proc pub:ping { nick uhost handle channel arg } {
 global ping status
 if {$status(listen) == "on" && [llength [split $arg " "]] == "1"} {
  set ping "[expr [clock clicks -milliseconds]]"
  putserv "PRIVMSG $nick :\001PING $ping\001"
 }
}
proc ctcr:pingreply {nick uhost hand dest key arg} {
 global ping
 set temp "[expr [expr [clock clicks -milliseconds]. - $ping.] /1000.]"
 putquick "NOTICE $nick :15,2Ton 8Ping15 avec le bot est de 9$temp15 sec"
}
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

the problem is that it has a - value i gues .. try to make it possitive i have experianced this to before it comes and goes don't know why ..
XplaiN but think of me as stupid
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Well, I think using abs() will solve the problem.

set temp "[expr abs([clock clicks -milliseconds] - $ping) / 1000.0]"
Locked