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.

Putting a timer on for each user

Old posts that have not been replied to for several years.
Locked
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Putting a timer on for each user

Post by Sc0rp »

Im writing a code that will add rating to my members member rating (at my forum) when they join my chan.. Ive put a timer on so they can hop all the time.. only problem is I dont know how to put a timer on for differemt users.. currently I have the following:

Code: Select all

bind join - *!*@*.* join_canal
set rater(timer) 10800

proc join_canal {nick uhost hand chan} {
   global botnick
   if { $nick != $botnick } {
      if {[info exists activatetimer($nick)]} {
         if { $activatetimer($nick) < $rater(timeset) } {
            set url http://www.zero-force.net/irc.php?invalidjoin=$nick
            set conn [http::geturl $url]
            upvar #0 $conn state
            putserv "PRIVMSG $chan : $nick joined again"
         }
      } else {
         set activatetimer($nick) [clock seconds]
         set url http://www.zero-force.net/irc.php?join=$nick
         set conn [http::geturl $url]
         upvar #0 $conn state
         putserv "PRIVMSG $chan : $nick joined"
      }
   }
}
though now activatetimer($nick) doesnt seem to go well cuz it just takes the 'else' all the time.. so was wondering what would be the best way to do this.. putting a timer on each user who joins..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

for starters add "raters" in the global line.
also I think there must be some set for the activatetimer in the proc before the else part too.
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Post by Sc0rp »

what do u mean by

'I think there must be some set for the activatetimer in the proc before the else part too.'

cant exacly follow what ur saying there
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

you have:

else {
set activatetimer($nick) [clock seconds]

but at first you only have:

if {[info exists activatetimer($nick)]} {
if { $activatetimer($nick) < $rater(timeset) } {

as you see $activetimer is not set, thus it can't be compared with $rater (which is a number therefore $activetimer should be set into a number)

also global botnick should be global botnick rater so that $rater(bla) is valid.
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Post by Sc0rp »

hmm but then how could I set a timer per user that joins?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well setting a timer for each use is too much fir the cpu to handle...
I can't help you with that... wait for the PRO's :p
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Post by Sc0rp »

cant I write it into an ini or something?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

what do you mean ?
S
Sc0rp
Voice
Posts: 11
Joined: Tue Sep 09, 2003 5:06 pm

Post by Sc0rp »

well whenever a user joins have it check an ini file.. when a user is not in the ini file write down the time joined and the nick of the user.. ?
Locked