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.

Bot leave for xx minutes

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Bot leave for xx minutes

Post by area57 »

Hi,

first: my englisch is not very good, because I'm from Germany.

second: the request,

I'm looking for a script that the Bot leaves the channel if triggert for a few minutes.
i.e. i've trigger with ~shutup and the Bot parts and returnes after xx minutes.

I hope you unterstand my request ;)
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Try this:

Code: Select all

bind pub n !stfu takeAbreak
proc takeAbreak {n u h c a} {
	expr {[scan $a %d a]>0||[set a 1]}
	putquick "PRIVMSG $c :I'll be back in $a minute[expr {$a==1?"":"s"}]"
	channel set $c +inactive
	utimer [expr {$a*60}] [list channel set $c -inactive]
}
Then do "!stfu 2" and see if it leaves for 2 minutes (the default is 1)

EDIT: That was close Fz :)
EDIT2: added a message
EDIT3: you didn't find the bug? :P (messed up scan when $a was empty)
Last edited by user on Wed Jan 17, 2007 8:54 pm, edited 3 times in total.
Have you ever read "The Manual"?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub n ~shutup part:join

proc part:join {nick uhost hand chan arg} {
 channel set $chan +inactive
 timer 5 [list channel set $chan -inactive]
}
This will make the bot part and rejoin after 5 minutes.

Edit: user beat me to it :D
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Post by area57 »

Hi,

thank you very much.
but I have one more question,
is it possible that the Bot send a message in the chan before it performe the part ?

EDIT: Thanks for the Edit user ;)
a
area57
Voice
Posts: 7
Joined: Wed Jan 17, 2007 4:50 pm

Post by area57 »

user wrote:EDIT3: you didn't find the bug? :P (messed up scan when $a was empty)
Ok, this Bug is now fixed, but a have found another one, I have changed the level to o|o, and someone types a negative number like -1 the Bot dont came back to the channel -.-
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub n !stfu takeAbreak
proc takeAbreak {n u h c a} {
   expr {[scan $a %d a]>0||[set a 1]}
   putquick "PRIVMSG $c :I'll be back in $a minute[expr {$a==1?"":"s"}]"
   channel set $c +inactive
   utimer [expr {abs($a)*60}] [list channel set $c -inactive]
}
This will make it take the absolute value of $a so -1 will be taken as 1 for example.
Post Reply