Seb icon

Bot management

Seb | PRO | 06/21/10 04:12:48 AM UTC | 0 ⭐ | 1393 👁️ | Never ⏰ | []
mIRC |

1.52 KB

|

None

|

0 👍

/

0 👎

;;Your bot's names, any order separated by a space 
alias isbot return [1]Bot [2]Bot [3]Bot
;; Slupply the main part of your bot's nick for example
;; if your bots were [1]Bot [2]Bot, you would put Bot
alias botname return NAME
;;The hub channel must be a channel which all the bots are in
;;I don't recommend using your home channel as it spams..
alias hubchan return #CHANNEL
alias invitehandle {
  if (($1 == UPDATE) || ($1 == JOIN)) {
    msg $hubchan $me $2
    set % $+ $me $2 
  }
  elseif (($1 == PART) || ($1 == KICK)) {
    var %x $2 - 1
    msg $hubchan $me %x
    set % $+ $me %x
 
  }
}
 
ON *:TEXT:!updatechan:#: if (($chan == $hubchan) && ($nick isop $chan)) invitehandle UPDATE $chan(0)
ON *:TEXT:*:#:if (($istok($isbot,$nick,32)) && ($nick == $1) && ($2 isnum) && ($chan == $hubchan)) set % $+ $1 $2
ON *:JOIN:#:if ($nick == $me) invitehandle JOIN $chan(0)
ON *:PART:#:if ($nick == $me) invitehandle PART $chan(0) 
on *:KICK:#:if ($knick == $me) invitehandle KICK $chan(0) 
ON *:QUIT:if ($istok($isbot,$nick,32)) unset % $+ $nick
 
ctcp *:JOIN:*:if ($istok($isbot,$nick,32)) join $2
 
on *:INVITE:#: {  
  if ($var($+(%,*,$botname,*),0)) { 
    var %x 1
    while ($var($+(%,*,$botname,*),%x)) {
      var %target $($v1,2),%target-name $v1
      if ((%lowest == $null) || (%lowest > %target)) var %lowest %target,%lowest-name %target-name
      inc %x
    }
    var %y $remove(%lowest-name,%)
    ctcp %y JOIN $chan
  }
  else notice $nick Please see the support channel and ask them to type !updatechan
}

Comments