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.

can some fix this for me:)

Old posts that have not been replied to for several years.
Locked
A
Atomic
Voice
Posts: 25
Joined: Thu Jun 24, 2004 9:19 pm

can some fix this for me:)

Post by Atomic »

noob request

please add a timer that kills the utimer
if an op does !secureoff

obvoisly you guys know the timer continues after it is started

so the op does !secureoff the script runs the off switch

but after the timer runs its course it displays the msg again
in the !secureoff proc it would be cool if the timer was killed
so nothing else happens if the op does !secureoff before the timer ends

or what would be even better is if the bot notes the topic before it changes it and then after secure off it changes it back to what it was before ... that is way outa my know how... :) thank you

here is the script

#Commands

bind pub o !secureon pub_do_secureon
bind pub o !secureoff pub_do_secureoff

proc pub_do_secureoff {nick host handle channel txt} {
putquick "mode $channel -mis"
putserv "PRIVMSG $channel : 4CHANNEL IS NO LONGER IN SECURE MODE"
putserv "topic $channel : 4 Welcome to $channel"
return 1
}

proc pub_do_secureon {nick host handle channel txt} {
putserv "PRIVMSG $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
putquick "MODE $channel +mis"
putquick "topic $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
timer 3 [list pub_do_secureoff $nick $host $handle $channel $txt]
return 1
}


thank you for your help

Atomic
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Try this

Code: Select all

bind pub o !secureon pub_do_secureon
bind pub o !secureoff pub_do_secureoff

proc pub_do_secureoff {nick host handle channel txt} {
    putquick "mode $channel -mis"
    putserv "PRIVMSG $channel : 4CHANNEL IS NO LONGER IN SECURE MODE"
    putserv "topic $channel : 4 Welcome to $channel"
    if {[timerexists pub_do_secureoff]!=""} { killtimer [timerexists pub_do_secureoff] }
    return
}

proc pub_do_secureon {nick host handle channel txt} {
    putserv "PRIVMSG $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
    putquick "MODE $channel +mis"
    putquick "topic $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
    timer 3 [list pub_do_secureoff $nick $host $handle $channel $txt]
    return 
}
Not tested.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
A
Atomic
Voice
Posts: 25
Joined: Thu Jun 24, 2004 9:19 pm

excellent

Post by Atomic »

thank you doom

but i fixed it already

do you see any faults int his script
your input would be appriciated :)

also any ideas on how i would set the topic
back to what it originally was?
i have no idea at all.

thank you for your time you have spent already

Atomic

script *

bind pub o !secureon pub_do_secureon
bind pub o !secureoff pub_do_secureoff

proc pub_do_secureoff {nick host handle channel txt} {
putquick "mode $channel -mis"
putserv "PRIVMSG $channel : 4CHANNEL IS NO LONGER IN SECURE MODE"
putserv "topic $channel : 4 Welcome to $channel"
foreach t [utimers] {
if [string match *pub_do_secureoff* [lindex $t 1]] {
killutimer [lindex $t end]
}
}
return 1
}

proc pub_do_secureon {nick host handle channel txt} {
putserv "PRIVMSG $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
putquick "MODE $channel +mis"
putquick "topic $channel : 4CHANNEL IS NOW IN SECURE MODE - PLEASE WAIT!"
set timerid "240"
utimer 240 [list pub_do_secureoff $nick $host $handle $channel $txt]
return 1
}
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

use [topic $channel] to save the topic in global variable

and use

Code: Select all

 tags to post code here
Locked