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 

Timers not dying[solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
vigilant
Halfop


Joined: 05 Jan 2006
Posts: 48

PostPosted: Fri Dec 14, 2007 4:59 pm    Post subject: Timers not dying[solved] Reply with quote

First i want to ask, how can kill a timer using .tcl in DCC?
Is there a way hehe?

And now, my script i'm using this code, but it's not killing the timers, it keeps starting... hehe

I am basically trying to do, if it finds itself op i want to kill the timers for the message
thanks

Code:
proc complain {} {
global services botnick
utimer $services(complaintime) complain
set chan $::channel
   puthelp "PRIVMSG $chan :No access to op myself, please op me."
set testtimer ""
foreach testtimer [utimers] {
if {[string match "complain" $testtimer]} {
utimer $services(complaintime) complain
if {[botisop $chan]} {
set killit ""
foreach killit [utimers] {
if {[string equal -nocase complain [lindex $killit 1]]} {
killutimer [lindex $killit 2]
break
}
}
}
}
 } }

_________________
Anser Quraishi
Website: http://www.anserq.com


Last edited by vigilant on Fri Dec 14, 2007 9:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Dec 14, 2007 5:03 pm    Post subject: Reply with quote

Checked the TCL Archive theres a script in there for killing timers via .dcc called Timer Tools. Search link http://www.egghelp.org/tclhtml/3478-4-0-0-1-timer.htm
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Dec 14, 2007 6:00 pm    Post subject: Reply with quote

As to your op-check, eggdrop has a mechanism to detect when it is opless, allowing you to execute custom code when that happens. Once an opless state has been detected, the code will be executed continuosly (with a slight delay inbetween invocations) until your eggdrop regains op.

Current, recommended, approach is something like this:
Code:
bind need - "% op" wewantops
proc wewantops {chan what} {
 puthelp "PRIVMSG $chan :No access to op myself, please op me."
}


An older, now deprecated approach is something like this:
Code:
channel set #yourchannel need-op { puthelp "PRIVMSG #yourchannel :No access to op myself, please op me."

Worth noting, in the second approach, the code is limited to 120 characters, whereas the first has no such limit.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
vigilant
Halfop


Joined: 05 Jan 2006
Posts: 48

PostPosted: Fri Dec 14, 2007 9:16 pm    Post subject: Reply with quote

nml375 wrote:
As to your op-check, eggdrop has a mechanism to detect when it is opless, allowing you to execute custom code when that happens. Once an opless state has been detected, the code will be executed continuosly (with a slight delay inbetween invocations) until your eggdrop regains op.

Current, recommended, approach is something like this:
Code:
bind need - "% op" wewantops
proc wewantops {chan what} {
 puthelp "PRIVMSG $chan :No access to op myself, please op me."
}


An older, now deprecated approach is something like this:
Code:
channel set #yourchannel need-op { puthelp "PRIVMSG #yourchannel :No access to op myself, please op me."

Worth noting, in the second approach, the code is limited to 120 characters, whereas the first has no such limit.



Thank you sir. This does work clearly. I got told, i was trying to reinvent the wheel haha.. so yeah.

Got it working Cool
_________________
Anser Quraishi
Website: http://www.anserq.com
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 -> Scripting Help 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