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.

multiple timers - for each gamer its own

Old posts that have not been replied to for several years.
Locked
a
ahrens

multiple timers - for each gamer its own

Post by ahrens »

Hey folks, first time asking, since the search couldn't help me with this:

I wrote a quite nice script that triggers !joined and !returned from gamers and writes them with their actual game-ip and game into a .txt which is displayed on my website and on !gamers in the chan.

Now I got the problem, that - if a gamer times out on IRC during he's on a server, my Bot can't notice when he's back from gaming - so he'd stay on the list forever.
I solved this so far sind i made a !makereturned-proc where I can remove gamers by will, but that's not the best solution since i can't check the list 24/7.

I decided to set up timers that do remove a gamer after a while, let's say five hours from putting on the list. Because I did not find any clear documentation on advanced timers, I hope you guys can tell me how to realize this stuff.

I thougt I would use something like

Code: Select all

timer($hand) 300 returned
which should open a personalized timer every time the !joined-proc is called. But how do i pass the searchstring for the list to make the !returned- or the !makereturned-proc know, who is to be deleted?

In my words:

timer(testgamer) 300 returned

should open the proc returned which should remove "testgamer" from the list. The !returned-proc goes like this:

Code: Select all

proc returned { name uhost hand text { dest ""}} {
putlog "---+++--- Received return-command from $hand. ---+++---"
set found 0 
set index "" 
set file [open file.txt r] 
while {![eof $file]} { 
set lines [split [read $file] "\n"] 
foreach line $lines { 
if {$line == ""} { continue } 
if {[lsearch $line $hand] > 0} { 
set found 1 
} else { lappend index $line } 
} 
if {$found == 0} { 
putlog "---+++--- $hand not in gamer's list. ---+++---"
putquick "NOTICE $name : U were not on the list."
return } 
} 
catch {close $file} 
set file [open file.txt w] 
foreach line $index { 
puts $file $line 
} 
catch {close $file} 
putlog "---+++--- $hand removed from gamer's list. ---+++---"
putquick "NOTICE $name : Successfully removed."
}
Any help would be greatly welcome :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

timer($hand) 300 [list returned $name $uhost $hand $text]
add this line into your code
Last edited by Papillon on Fri Apr 25, 2003 7:28 pm, edited 1 time in total.
Elen sila lúmenn' omentielvo
a
ahrens

Post by ahrens »

Thank you very much!

timer($hand) 300 [list returned $name $uhost $hand $text] worked fine.
Locked