Anything better than getchanjoin? [SOLVED]

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Anything better than getchanjoin? [SOLVED]

Post by awyeah »

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.
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.
Last edited by awyeah on Tue Jun 13, 2006 12:22 am, edited 1 time in total.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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

Post by De Kus »

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 :D. 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...
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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 :D. 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: Select all

 tag when posting logs, code
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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: Select all

[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.
==================================
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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: Select all

 tag when posting logs, code
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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 :D. 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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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

Post by De Kus »

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) :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...
Post Reply