Jump to content

Buzzen Snippets


err0r

Recommended Posts

on text remote !mode command

 

Usage !mode <modes> <limitnum> <key>

Example !mode itumlk 100 blah

 

Note this is a toggle command meaning that if the mode is + it will change it to -

 

If current modes are + ilu and you do !mode ilut 100

 

the output would be -iu+tl 100

 

if you have l or k in the string of modes make sure you have $3 or $4 set as needed

 

Output for +l and k will be on a different line. The rest will be on the same line.

 

This is just a sample and can be improved upon. Note this will go in your on text command preferably under a userlevel or op status

 

  if ($1 == !mode) && ($2) {
    var %m 1
    while ($mid($2,%m,1)) {
      if ($mid($2,%m,1) isincs $chan($chan).mode) { 
        if ($mid($2,%m,1) == l) && ($3 isnum) { /mode $chan +l $3 }
        elseif ($mid($2,%m,1) == k) && ($3) { /mode $chan -k $iif($4,$4,$3) }
        else { var %modes.minus %modes.minus $+ $mid($2,%m,1) } 
      }
      else { 
        if ($mid($2,%m,1) == k) && ($3) { /mode $chan +k $iif($4,$4,$3) }
        else { var %modes.plus %modes.plus $+ $mid($2,%m,1) }
      }
      inc %m
    }
    mode $chan $+($iif(%modes.plus,$+(+,%modes.plus)),$iif(%modes.minus,$+(-,%modes.minus)))
  }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...