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.

Timers not dying[solved]

Help for those learning Tcl or writing their own scripts.
Post Reply
v
vigilant
Halfop
Posts: 48
Joined: Thu Jan 05, 2006 12:06 am

Timers not dying[solved]

Post by vigilant »

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: Select all

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
}
}
}
}
 } }
Last edited by vigilant on Fri Dec 14, 2007 9:17 pm, edited 1 time in total.
Anser Quraishi
Website: http://www.anserq.com
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

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: Select all

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
v
vigilant
Halfop
Posts: 48
Joined: Thu Jan 05, 2006 12:06 am

Post by vigilant »

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: Select all

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: Select all

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 8)
Anser Quraishi
Website: http://www.anserq.com
Post Reply