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 

Bot leave for xx minutes

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


Joined: 17 Jan 2007
Posts: 7

PostPosted: Wed Jan 17, 2007 5:35 pm    Post subject: Bot leave for xx minutes Reply with quote

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 Wink
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Jan 17, 2007 6:18 pm    Post subject: Reply with quote

Try this:
Code:
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 Smile
EDIT2: added a message
EDIT3: you didn't find the bug? Razz (messed up scan when $a was empty)
_________________
Have you ever read "The Manual"?


Last edited by user on Wed Jan 17, 2007 8:54 pm; edited 3 times in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 17, 2007 6:18 pm    Post subject: Reply with quote

Code:
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 Very Happy
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Wed Jan 17, 2007 6:29 pm    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message
area57
Voice


Joined: 17 Jan 2007
Posts: 7

PostPosted: Sun Jan 21, 2007 3:03 pm    Post subject: Reply with quote

user wrote:
EDIT3: you didn't find the bug? Razz (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 -.-
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 21, 2007 8:00 pm    Post subject: Reply with quote

Code:
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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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