egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Smart Idle + Fix + futures

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Sun Jul 28, 2013 4:22 am    Post subject: Smart Idle + Fix + futures Reply with quote

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:
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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Jul 28, 2013 6:22 am    Post subject: Reply with quote

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



Code:

<_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
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Jul 28, 2013 9:50 am    Post subject: Reply with quote

You got it wrong.
Quote:

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:
{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:

foreach {no cmd uid} [utimers] {
   killutimer $uid
}

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber