| View previous topic :: View next topic |
| Author |
Message |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sat Jun 10, 2006 10:44 am Post subject: Anything better than getchanjoin? [SOLVED] |
|
|
Hi everyone!
Sorry I've been away for a long while and have been out of action for quite a while, just that I slowly lost interest in TCL scripting as a hobby.
Anyway I was developing a small script, to detect people who join a channel and say a word say exactly after they join, supposingly with in one or two seconds of their join.
Now mostly people use 'getchanjoin' to find the time and convert the unixtime. But the eggdrop takes time to update the usercount of the channel with getchanjoin it and will not give a precise value say in milliseconds, especially for channel who have large usercounts (200+ or so) since it has a bit of delay in updating.
| Quote: |
getchanjoin <nickname> <channel>
Returns: timestamp (unixtime format) of when the specified nickname joined the channel
Module: irc
|
Is there anyway I can integrate say bind join with some other bind to detect when a person has joined a channel and has said something within 1-2secs of their joining or is their a way to do this through getchanjoin say maybe, but in milliseonds.
I have been away for a long time, so I am not that well aquatined with TCL as good as I was before. All help is appreciated. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Last edited by awyeah on Tue Jun 13, 2006 12:22 am; edited 1 time in total |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jun 10, 2006 6:36 pm Post subject: |
|
|
While using [getchanjoin] isn't a problem as you described it, what you can do is bind join and timestamp the user's join manually (array of nicks probably set to their times) and use the array in the pub(m) proc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sun Jun 11, 2006 9:15 am Post subject: |
|
|
manually savnig 'clock clicks -milliseconds' timestamps seem to be the only solution. Addionaly you would have to be aware of getchanjoin possibly being zero (meaning a '$chanjoin - $now < 2' would be true ^-^). Alternately you could try to modify the eggdrops source to save a high resolution timer instead of seconds. something like a list of timestamps as '#seconds #clicks' as return of getexactchanjoin or something funny like that . This would of course involve changing the struct memberlist and hopefully only getchanjoin and the function which adds new members to the list. _________________ 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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jun 11, 2006 10:12 pm Post subject: |
|
|
| De Kus wrote: | manually savnig 'clock clicks -milliseconds' timestamps seem to be the only solution. Addionaly you would have to be aware of getchanjoin possibly being zero (meaning a '$chanjoin - $now < 2' would be true ^-^). Alternately you could try to modify the eggdrops source to save a high resolution timer instead of seconds. something like a list of timestamps as '#seconds #clicks' as return of getexactchanjoin or something funny like that . This would of course involve changing the struct memberlist and hopefully only getchanjoin and the function which adds new members to the list. |
quoting Alchera, it would appear you still fail to understand that egdrop is NOT an embedded microcontroller and dealing with milliseconds in eggdrop and generally on IRC is completely pointless
awyeah, [getchanjoin] is the best you can do - doing it via [bind join] is virtually the same; your real problem is intrinsic to IRC and you can't do anything about it - except maybe experimenting moving your bot to other servers which would hopefully minimize or at least reduce channel sync time _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Jun 11, 2006 11:39 pm Post subject: |
|
|
Okay thanks for all the comments and suggestions. The milliseconds thing is a bit more complicated so I've chosen to leave that, because am I bit confused.
1) 'clock clicks -milliseconds' does give a time format but is it not the same as the unix time format?
How could I change that into unixtime? because I want a similar format for getchanjoin (unixtime) to compare those both.
Currently I am using the logic,
| Code: |
[getchanjoin $nick $chan] >= {expr [clock seconds]-$delay}
;am using this procedure with bind pubm - "*"
|
Where 'delay' is the time which can be chosen within text can be said and the bot can detect, else if it is after that interval then the logic doesn't work.
The thing is this works great, but suppose if the bot is restarted, connects back to the server again and rejoins its channels, and someother bot on the channel or some script greets it on join, then this code also activates.. how could I simply ignore or bypass that.
What I mean to say, when a bot joins a channel, people already in the channel before the bot came in, would have unknown getchanjoin time or 0? kind of weird. I don't think there is a way to get the getchanjoin time for users who were already present before the bot joined the channel! _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Jun 12, 2006 2:19 am Post subject: |
|
|
| awyeah wrote: |
What I mean to say, when a bot joins a channel, people already in the channel before the bot came in, would have unknown getchanjoin time or 0? kind of weird. I don't think there is a way to get the getchanjoin time for users who were already present before the bot joined the channel! |
it's 0, and you need to pass on those
and forget about that millisecond stuff already, you don't need millisecond precision with eggdrop, not now, not ever, period. _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Jun 12, 2006 9:32 pm Post subject: |
|
|
| demond wrote: | | De Kus wrote: | manually savnig 'clock clicks -milliseconds' timestamps seem to be the only solution. Addionaly you would have to be aware of getchanjoin possibly being zero (meaning a '$chanjoin - $now < 2' would be true ^-^). Alternately you could try to modify the eggdrops source to save a high resolution timer instead of seconds. something like a list of timestamps as '#seconds #clicks' as return of getexactchanjoin or something funny like that . This would of course involve changing the struct memberlist and hopefully only getchanjoin and the function which adds new members to the list. |
quoting Alchera, it would appear you still fail to understand that egdrop is NOT an embedded microcontroller and dealing with milliseconds in eggdrop and generally on IRC is completely pointless
.... |
I am fascinated by the pointless obsession regarding eggdrops and micro/milliseconds that De Kus has. Very strange indeed! _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Tue Jun 13, 2006 12:25 am Post subject: |
|
|
Hi thanks for all the help and suggestions. This problem has now been solved.
I guess it is impossible to get the exact join time of users in a channel who have joined in before you, which is simple logic.
JD _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Tue Jun 13, 2006 4:20 am Post subject: |
|
|
| Alchera wrote: | | demond wrote: | quoting Alchera, it would appear you still fail to understand that egdrop is NOT an embedded microcontroller and dealing with milliseconds in eggdrop and generally on IRC is completely pointless
.... |
I am fascinated by the pointless obsession regarding eggdrops and micro/milliseconds that De Kus has. Very strange indeed! |
I was just giving her the 2 alterntives with which it would be possible to store a high resolution timer, I haven't said anything about how actually usefull that would be and just tried to help without flaming.
@awyeah: just to answer your question about milliseconds and unixtime... you probably could convert it, assuming milliseconds is "timeofday" (which might differ from system to system), but it would then again be only second precision (either round down int or as double value with 3 dezimals) . _________________ 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 |
|
 |
|