Multi chan silence script

By GrimReaper on Sep 27, 2010

I had a /silence script before that uses variables and could never get it to work when silencing two nick's at once.. It would cause an error in the script.. so decided to make a silence script using .ini files.

Syntax: /sil

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Silence script by GrimReaper       ;;
;; irc.GeekShed.net chan: #hell       ;;
;; irc.SassIRC.com chan: #SassIRC.com ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias sil {
  if ($me isop $chan) || ($me ishop $chan) {
    if (!$1) || (!$2) { echo -at * Error: Incorrect syntax used, /sil <nick> <timer in minutes> }
    elseif ($1) || ($2) {
      mode $chan +bb ~q: $+ $address($1,2) ~n: $+ $address($1,2)
      writeini Silence.ini $$1 chan $active
      if ($$1 ishop $active) { writeini Silence.ini $1 status HOP | mode $active -h $1 }
      if ($$1 isvoice $active) { writeini Silence.ini $1 status VOP | mode $active -v $1 }
      $iif($$1 isreg $active,writeini Silence.ini $1 status REG)
      .timer 1 $calc($2 * 60) desil $1 $address($1,2) $chan
    }
  }
}

on *:JOIN:#: {
  if ($ini(Silence.ini,$nick,chan)) {
    if ($readini(Silence.ini,$nick,status) == HOP) {
      mode $chan -h $nick
    }
    elseif ($readini(Silence.ini,$nick,status) == VOP) {
      mode $chan -v $nick
    }
  }
}

alias -l desil {
  if ($1 ison $3) {
    if ($readini(Silence.ini,$1,status) == HOP) { mode $$3 +h $1 | remini Silence.ini $1 }
    if ($readini(Silence.ini,$1,status) == VOP) { mode $$3 +v $1 | remini Silence.ini $1 }
    mode $3 -bb ~q: $+ $2 ~n: $+ $2
  }
  elseif ($1 !ison $3) { mode $3 -bb ~q: $+ $2 ~n: $+ $2 | remini Silence.ini $1 }
}

Comments

Sign in to comment.
FordLawnmower   -  Nov 03, 2010

I would definitely use On Help and On Voice instead of On Join GrimReaper.
It's a good idea though. If you don't script something to enforce it, ~q: mute ban is useless.

 Respond  
DarkGamer120   -  Nov 03, 2010

Awesome work there Danneh
i use it to silence the trolls in my channel

Thx, DG

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.