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.

Smart Idle + Fix + futures

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Smart Idle + Fix + futures

Post by Arkadietz »

I've searching but i can't find exactly that i want. So i will explain in next rows what i need.

1. On idle to deop/voice/halfop users ( Note: will be great to remove op/voice/halfop on one row ) Like: egg sets mode -oohv nick nick nick nick
2. Has a variable where you can set "what is the maximum idle of users they can (using timer or utimer)"
3. Has variable on what time to check idle users (using timer or utimer ( sharp as possible. ). Note: you can't use crontab for the reason you can't kill the process.
4. Has a variable for exempt users like a flag +L (This flag can be set only from perm owners)
5.It comes and the most important part. There is no one tcl can support this future. On .rehash to kill all timers.
Here is the link where has more explanations: http://tclhelp.net/unb/108
The point is to find id of timers and kill them on rehash. Till now on rehash timers still work and going a big mess. Only .restart prevent this but how we all know that's two different commands.

Hint: I believe that's the check for perm owners

Code: Select all

proc ispermowner {hand} {
  global owner

  regsub -all -- , [string tolower $owner] "" owners
  if {([matchattr $hand n]) && \
      ([lsearch -exact $owners [string tolower $hand]] != -1)} then {
    return 1
  }
  return 0
}
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

To set and kill a specified UTIMER/TIMER ID you just have to set a var for that. Just like this one


Code: Select all

<_MaDaLiN_> .tcl set var [utimer 10 [list putlog "test"]]
<(Ascenture> Tcl: timer88
<_MaDaLiN_> .tcl utimers
<(Ascenture> Tcl: {8 {putlog test} timer88}
<_MaDaLiN_> .tcl killutimer $var
<(Ascenture> Tcl: 
So you will always have $var as "putlog test" of course var's must be unique
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You got it wrong.
utimers
Returns: a list of active secondly timers. Each entry in the list contains the number of minutes left till activation, the command that will be executed, and the timerID.
Module: core
In your case

Code: Select all

{8 {putlog test} timer88}
translates into the fact that this has been executed 8 times so far, the command to be executed is putlog test and it's unique id is in fact timer88. You will need to kill this unique id, not the variable $var like you said.

Haven't tested but I think this should work.

Code: Select all

foreach {no cmd uid} [utimers] {
	killutimer $uid
}
Once the game is over, the king and the pawn go back in the same box.
Post Reply