This is a simple gag/ungag, or timed ban, script. Type /silence . Easy to use, easy to manipulate. It also deops/devoices the user you have gagged, you must be an op in order for this to work. This is the original, I just modified it so it wouldn't change the access list. http://www.hawkee.com/snippet/4306/
alias silence {
describe # Hey $$1, I think it's time for you to shut up, you've been gaged for $$2 minute(s).
if ($left($nick($chan,$$1).pnick,1) == +) { mode $chan -v $$1 }
if ($left($nick($chan,$$1).pnick,1) == %) { mode $chan -hv $$1 $$1 }
if ($left($nick($chan,$$1).pnick,1) == @) { mode $chan -ohv $$1 $$1 $$1 }
if ($left($nick($chan,$$1).pnick,1) == &) { mode $chan -aohv $$1 $$1 $$1 $$1 }
mode # +b ~q: $+ $address($$1,2)
var %i = $calc($$2 * 60)
.timer 1 %i charge.timer $$1
}
alias charge.timer {
mode # -b ~q: $+ $address($$1,2)
if ($(% $+ $address($$1,2) $+ shoot,2) == 4) { mode # +v $$1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 3) { mode # +h $$1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 2) { mode # +o $$1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 1) { mode # +a $$1 }
describe # $$1 ok, you can speak again, now stop talking like an idiot
}
ok I am trying to get the one Jethro posted to work. I added an hours and days one to it. but when I type !gag (nick) (time) It comes out as
describe # Hey !gag, I think it's time for you to take some time to reflect on what you have said. $& You've been removed from chat for for (nick) minutes/hours/days(s).
and then it also plays every single one of my commands after that.
so I am just wondering what happened? I checked to see if any brackets are missing and It doesn't say there is.
Ok I changed a few things around and I got it to work. ^^ I am fine now.
how can I add it to the bot so I can type !gag from my other mirc so the bot can gag a certain person?
on @*:TEXT:$($+($strip(!gag),*)):#: {
if ($2 ison #) && ($3 isnum) && ($nick isop #) silence $2 $3
else { .msg $nick Type: !gag <nick> <time in minutes> }
}
alias silence {
describe # Hey $1, I think it's time for you to shut up. $&
You've been gaged for $2 minute(s).
if ($nick(#,$nick,+)) { mode # -v $$1 }
if ($nick(#,$nick,%)) { mode # -hv $$1 $1 }
if ($nick(#,$nick,@)) { mode # -ohv $str($$1 $+ $chr(32),3) }
if ($nick(#,$nick,&)) { mode # -aohv $str($$1 $+ $chr(32),4) }
mode # +b ~q: $+ $address($$1,2)
var %i = $calc($2 * 60) | .timer 1 %i charge.timer $$1
}
alias charge.timer {
mode # -b ~q: $+ $address($$1,2)
if ($(% $+ $address($$1,2) $+ shoot,2) == 4) { mode # +v $1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 3) { mode # +h $1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 2) { mode # +o $1 }
if ($(% $+ $address($$1,2) $+ shoot,2) == 1) { mode # +a $1 }
.describe # $1 ok, you can speak again. Now stop talking like an idiot.
}
Note: Make sure the client running the code and people who command the trigger !gag are opped in channel.