Group Control Remote

By Scakk on Sep 13, 2008

This allows you to remotely control your #group you have on your bot or other client as needed.

/
Usage:
!groups list = List all the groups you have to choose from.
!groups all on/off = Turns all #group on/off as specified
!groups #group on/off = Will turn #group off/on as specified if not already as specified.
/

/*
Usage:
!groups list = List all the groups you have to choose from.
!groups all on/off = Turns all #group on/off as specified
!groups #group on/off = Will turn #group off/on as specified if not already as specified.
*/
on *:text:!group*:#: { 
  if (!$3) {
    if ($2 == list) { 
      var %t 1
      while (%t <= $group(0)) {
        set %groups $sorttok($addtok(%groups,$group(%t),32),32,a)
        inc %t
      }
      .notice $nick Groups: %groups | unset %groups
    }
  }
  if ($3) {
    if ($2 == all) {  
      if ($3 == off) { .disable #* | msg $chan All groups are now turned off. }
      if ($3 == on) { .enable #* | msg $chan All groups are now turned on. }
    }
    if ($left($2,1) != $chr(35)) { msg $chan All groups must start with a $chr(35) }
    if (!$group($2)) { msg $chan That is not a valid group name. }
    if ($group($2) && $3) {
      if ($3 == off) { 
        if ($group($2).status == off) { msg $chan The group $qt($2) is already off. }
        if ($group($2).status != off) { .disable $2 | msg $chan The group $qt($2) is off. }
      }
      if ($3 == on) { 
        if ($group($2).status == on) { msg $chan The group $qt($2) is already on. }
        if ($group($2).status != on) { .enable $2 | msg $chan The group $qt($2) is on. }
      }
    }
  }
}

Comments

Sign in to comment.
EL   -  Sep 13, 2008

Oh nice rofl im a use this in my bot wen i get around to it ,another nice useful snippet Scakk."Rate it or Hate it?"...7/10.`-.-´

 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.