Botscript / !mute/!unmute

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Botscript / !mute/!unmute

Postby Cristian » Sat Dec 01, 2007 4:09 pm

Code: Select all
;# 
;# visit http://sp00fed.org for updates or support.
;# script by Sumsar
;#

;# Tested and works on version 6.15

;# (!mute)      When triggered, devoice every voice and sets channelmode +m (moderator), and will 'mute' any regular user.
;# (!unmute)    When triggered, removes the channelmode +m, making it possible to write for regular users again.

;# Triggers:
;#    !mute
;#    !unmute

on *:TEXT:!mute:#:{
  if ($nick isop $chan) {
    if ($me isop $chan) {
      .mode $chan +m
      var %x = $nick($chan,0,v),%list
      while (%x) {
        var %list = $addtok(%list,$nick($chan,%x,v),32)
        if ($numtok(%list,32) == 6) {
          .mode $chan $str(-v,$numtok(%list,32)) %list | var %list
        }
        dec %x
      }
      if ($numtok(%list,32) > 0) {
        .mode $chan $str(-v,$numtok(%list,32)) %list
      }
      .msg $chan Channel is now muted (channelmode +m) and you wont be able to write, please standby for further information.
    }
    else { .notice $nick Error: I'm not opped. }
  }
}
on *:TEXT:!unmute:#:{
  if ($nick isop $chan) {
    if ($me isop $chan) {
      .mode $chan -m
      .msg $chan Channel is now unmuted (channelmode -m) and you are able to write again.
    }
    else { .notice $nick Error: I'm not opped. }
  }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests