Channel list + total

By xelent on Jul 16, 2008

Introductions: Change out #YourChannel with Your main/bot channel.

Commands:
; !chans shows you all chans your bot is on and total how many.

on *:text:!chans:#YourChannel: {
  if ($nick isop $chan) {
    var %x = 1
    set %y
    while (%x <= $calc($chan(0) + 1)) {
      if (%x == $calc($chan(0) + 1)) {
        .notice $nick Channels: %y $chr(91) $+ Total: $chan(0) $+ $chr(93)
        unset %y      
        break
      }
      else {   
        set %y $addtok(%y,$chan(%x),32)
        inc %x
      }
    }
  }
  else {
    .notice $nick ERROR! You are not authorized to use this command. 
  }
}

Comments

Sign in to comment.
Yilena   -  Jul 17, 2008

I have the same sorta script in my own bot.. but with whois raw..

on *:TEXT:!Where:#: {
  raw whois $me
  set %chan $chan
}
raw 319:*: {
  msg %chan Channels im in: $Remove($3-,~,&,@,%,+)  Thats a total of $chan(0) channels.
  halt
}
 Respond  
guest598594   -  Jul 17, 2008

Jamiie, I think you meant to say change \"isop\" but anyway, on @ checks if $me isop, not $nick.

 Respond  
Jamiie   -  Jul 17, 2008

Instead of if ($nick ison $chan) just put a @.

on @text:!chans:#yourchannel: {
 Respond  
guest598594   -  Jul 16, 2008

Instead of doing the number of channels + 1 thing, you can just notice after the while, like this:

while $chan(%x) {
  var %y = %y $v1
  inc %x
}
.notice $nick I\'m on these channels: %y Total: $chan(0)
 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.