Easy Chanmode Script

By sloth on Aug 09, 2009

A simple script born out of neccesity.
For servers that don't have services or when you don't want to use service bots, you can use this script instead.

To use, just type [+/-] in the channel.
Script also features mutes and bans (including unmutes and unbans) which you can set using [+/-][b/m]. Using +bk bans and kicks the person.

Mostly just for using modes on a channel with ease.
Nothing serious, just sharing for those who want it.

(By the way, I am aware that my brackets are all over the place))

Got bored. Added timed kickbans (Use +tkb [reason]) made it stealthy and cleaned it up a bit.
Made mutes and bans work properly.

on 1:INPUT:#: {
  if ($pos($1,+,1) == 1) || ($pos($1,-,1) == 1) && ($pos($1,b,1) != 2) && ($pos($1,m,1) != 2) && ($pos($1,t,1) != 2) {
    if ($2) {
      /mode $chan $1 $2- $2 $2 $2 $2
    }
    if (!$2) {
      /mode $chan $1 $me $me $me $me
    }
    halt
  }
  if (($pos($1,+,1) == 1) && ($pos($1,b,1) == 2)) {
    if ($2 ison $chan) {
      /mode $chan +b $address($2,2)
    } 
    else {
      /mode $chan +b $2
    }
    if ($pos($1,k,1) == 3) {
      set %ban. $+ $2 $address($2,2)
      /kick $chan $2-
    }
    halt
  }
  if (($pos($1,-,1) == 1) && ($pos($1,b,1) == 2)) {
    if (%,ban.,$2) {
      /mode $chan -b $eval($+(%,ban.,$2),2)
      .notice $2 You have been unbaned from $chan
    } 
    if (!%,ban.,$2) {
      if ($2 ison $chan) {
        /mode $chan -b $address($2,2)
      }
      else {
        mode $chan -b $2
      }
    }
    halt
  }
  if (($pos($1,+,1) == 1) && ($pos($1,m,1) == 2)) {
    if ($2) {
      if ($2 ison $chan) {
        /mode $chan +b ~q: $+ $address($2,2)
        /mode $chan -hov $2 $2 $2 $2
        set %muted. $+ $2 $eval($address($2,2))
      }
      else {
        /mode $chan +b ~q: $+ $2
      }
    }
    if (!$2) {
      /mode $chan +m
    }
    halt
  }
  if (($pos($1,-,1) == 1) && ($pos($1,m,1) == 2)) {
    if ($2) {
      if ((%,muted.,$2)) {
        /mode $chan -b ~q: $+ $eval($+(%,muted.,$2),2)
        .notice $2 You have been unmuted on $chan
        unset %muted. $+ $2
      }  
      if (!(%,muted.,$2)) {
        if ($address($2,2)) {
          /mode $chan -b ~q: $+ $address($2,2)
        }
        if (!$address($2,2)) {
          /mode $chan -b ~q: $+ $2
        }
      }
    }
    if (!$2) {
      /mode $chan -m
    }
    halt
  }
  if (($pos($1,+,1) == 1) && ($pos($1,t,1) == 2)) {
    if (($pos($1,k,1) == 3) && ($pos($1,b,1) == 4)) {
      if ($3 ison $chan) {
        var %tkbtime = $calc(($2)*60)
        /mode $chan +b $address($3,2)
        .timer 1 %tkbtime mode $chan -b $address($3,2)
        set %ban. $+ $2 $address($3,2)
        if (!$4) {
          /kick $chan $3 Time out. $2 minute(s) ( $+ %tkbtime seconds)
        }
        if ($4) {
          /kick $chan $3 Time out. Reason: $4- ( $+ $2 minute(s) ( $+ %tkbtime seconds))
        }
      }
    }
    else {
      mode $chan +t
    } 
    halt
  }
}

Comments

Sign in to comment.
sloth   -  Sep 03, 2009

@Aerialman actually you would be able to because it executes the action before it sends the text so the rest of the channel sees +bk whereas they only see their kb

Demonstrated:

  • sloth set mode: +b !@te.st
  • test left (Kicked by sloth with the foliowing reason: -) +bk test
 Respond  
Aerialman   -  Aug 11, 2009

Wow, and I mean WOW! This is a lot easier than having to type in /cs mode blah blah! The only downside is that you aren't able to catch the person you're k/b by surprise. But that's nothing.

 Respond  
Bradrin   -  Aug 10, 2009

It works. I'm happy :)

 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.