Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l channels { return #one,#two,#three } ; Enter channels here (multi-channels allowed)
- alias -l check_delay { return 600 } ; Enter here how often you want the code to check to remove the bans, 600 is 10 mins in seconds, place seconds only here
- alias -l unban_delay { return 600 } ; Enter here the seconds you want to check and remove the bans (example 600 will remove all bans that have been set from 10 mins and more)
- ON ME:*:JOIN:$($channels): {
- set -eu10 %raw_ [ $+ [ $chan ] $+ ] _bans 1
- mode $chan b
- .timer[CLEARBANS_ $+ $chan $+ _AUTO] 0 $check_delay clearbans $chan
- }
- raw 367:*: {
- if (%raw_ [ $+ [ $2 ] $+ ] _bans) { haltdef }
- }
- raw 368:*: {
- if (%raw_ [ $+ [ $2 ] $+ ] _bans) { unset %raw_ $+ $2 $+ _bans | haltdef }
- }
- alias clearbans {
- ; /clearbans <#channel>
- if (!$1) { echo 4 -ste * /clearbans: Error, not enough parameters! | return }
- if ($status !== connected) { echo 4 -ste * /clearbans: Error, You are not connected to a server! | return }
- if ($left($1,1) !== $chr(35)) { echo 4 -ste * /clearbans: Error, enter a valid channel! | return }
- if ($me !ison $1) { echo 4 -ste * /clearbans: Error, you are not on $1 channel! | return }
- if ($me !isop $1) { echo 4 -ste * /clearbans: Error, you must have @ on $1 channel! | return }
- var %t = $ibl($1,0)
- if (!%t) { echo 4 -ste * /clearbans: Not any bans set on $1 channel! | return }
- var %i = 1
- while (%i <= %t) {
- var %b = $ibl($1,%i)
- var %s = $ibl($1,%i).ctime
- if (%b) && (%s) && ($ctime > $calc(%s + $unban_delay)) { var %a = $calc(%a + 1) | mode $1 -b %b }
- inc %i
- }
- if (%a) { echo -ste * /clearbans: Automatically removed %a ban(s) from $1 channel. }
- else { echo -ste * /clearbans: There are bans set on $1 channel but not yet to remove any of them. }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement