| View previous topic :: View next topic |
| Author |
Message |
[Lt]im Voice
Joined: 09 Mar 2006 Posts: 17 Location: Kaunas - Lithuania
|
Posted: Wed Aug 23, 2006 3:46 pm Post subject: need script |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Aug 23, 2006 3:52 pm Post subject: |
|
|
| 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 |
|
 |
[Lt]im Voice
Joined: 09 Mar 2006 Posts: 17 Location: Kaunas - Lithuania
|
Posted: Wed Aug 23, 2006 4:06 pm Post subject: |
|
|
this should work in dcc chat? i want this to be public command. _________________ [Lt]im |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Aug 23, 2006 4:10 pm Post subject: |
|
|
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 |
|
 |
|