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.

Online Time Counter

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
Hellboarder
Voice
Posts: 3
Joined: Mon Oct 22, 2007 1:12 pm

Online Time Counter

Post by Hellboarder »

Hi all

First : Sorry for bad english ;)

Im searching for a script which counts the online times of all users in a channel the past 7 days.

Then it should send a message to all users who were at least 48 hours in the channel.


Greets Hellboarder

PS : If this is to complicated , an script which does only the first part whould help me too
H
Hellboarder
Voice
Posts: 3
Joined: Mon Oct 22, 2007 1:12 pm

Post by Hellboarder »

Nobody an idea ?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I guess something like this should do the trick:

Code: Select all

#Returns the number of seconds nick has been visiting channel
proc onlinetime {nick channel} {
 return [expr [clock seconds] - [getchanjoin $nick $channel]]
}

Code: Select all

#Sends message to all members of channel who joined more than 48hours ago
proc checkjoined {channel message} {
 set threshold [expr [clock seconds] - 172800]
 foreach nick [chanlist $channel] {
  if {[getchanjoin $nick $channel] < $threshold} {
   puthelp "PRIVMSG $nick :$message"
  }
 }
}
You'll most likely need some glue-code to implement this...
NML_375
H
Hellboarder
Voice
Posts: 3
Joined: Mon Oct 22, 2007 1:12 pm

Post by Hellboarder »

hm think its not clear what the script should do^^

It should register the complete time a user was on the channel.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Where should it "register" the information? Data format/layout?
NML_375
Post Reply