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 

need script

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


Joined: 09 Mar 2006
Posts: 17
Location: Kaunas - Lithuania

PostPosted: Wed Aug 23, 2006 3:46 pm    Post subject: need script Reply with quote

I need a script, when a command .+m is used bot would lock chan (with mode +m) for 5mins, and after 5mins would automaticaly set mode -m.
_________________
[Lt]im
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Aug 23, 2006 3:52 pm    Post subject: Reply with quote

Code:

bind dcc - "+m" dcc:lockdown

proc dcc:lockdown {handle idx text} {
 set chan [lindex [split $text] 0]
 if {[validchan $chan] && [botisop $chan]} {
  pushmode $chan +m
  timer 5 [list pushmode $chan -m]
 }
 return 1
}


Hav'nt tested it, but should do the trick...

edit: Minor errors in the code, use consistent variable names, give $chan as an argument to validchan...
_________________
NML_375, idling at #eggdrop@IrcNET


Last edited by nml375 on Wed Aug 23, 2006 4:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
[Lt]im
Voice


Joined: 09 Mar 2006
Posts: 17
Location: Kaunas - Lithuania

PostPosted: Wed Aug 23, 2006 4:06 pm    Post subject: Reply with quote

this should work in dcc chat? i want this to be public command.
_________________
[Lt]im
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Aug 23, 2006 4:10 pm    Post subject: Reply with quote

Okies, something like this then..

Code:

bind pub - ".+m" pub:lockdown

proc pub:lockdown {nick host handle chan text} {
 if {[botisop $chan]} {
  pushmode $chan +m
  timer 5 [list pushmode $chan -m]
 }
 return 1
}


Edit: Be aware that this does not perform any checks on the person issuing the command, so anyone in the channel would be able to use this..
Probably wanna change the binding something like this:
Code:
bind pub - ".+m" pub:lockdown

into
Code:
bind pub o ".+m" pub:lockdown


Also altered name of proc (and binding) for clarity purposes only
_________________
NML_375, idling at #eggdrop@IrcNET
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 -> 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