channel info

By PuNkTuReD on Oct 11, 2008

can be used in a bot or for yourself

didnt add no protection as i dont use this in a bot

if you want to use it in a bot you will need to uncomment the on text event
trigger is .chans

when using in your own mirc its in your menu

[04:56] <~PuNkTuReD> -[CHANNEL INFO]- I am currently on 1 Channel(s). With a total of 4 User(s).
[04:56] <~PuNkTuReD> -[CHANNEL INFO]- #Sin_And_Sacrifice : +nrt : @ % + : 4 User(s) .

************************
*Channel Info For A Bot* 
*    By PuNkTuReD      *
************************
;---------------------on text event for using in a bot
;on *:text:*:*: {
;  if (.chans == $strip($1)) {
;    cci
;  }
;}
;---------------------menu for using in your own mirc
menu * {
  Check My Channel Info:cci
}
alias cci {
  tu
  var %a = 1
  var %b = $chan(0)
  while %a <= %b {
    if (%a == 1) { 
      msg $chan -[CHANNEL INFO]- I am currently on $chan(0) Channel(s). With a total of %tu User(s).
      .unset %tu
      goto continue1 
    }
    else {
      :continue1
      if ($chan(%a).mode == $null) { .set %chaninfo %chaninfo -[CHANNEL INFO]- $chan(%a) : No Channel Modes : | goto continue2 }
      else { .set %chaninfo %chaninfo -[CHANNEL INFO]- $chan(%a) : $chan(%a).mode : | goto continue2 }
      :continue2
      if ($me isop $chan(%a)) { .set %chaninfo %chaninfo @ }
      if ($me ishop $chan(%a)) { .set %chaninfo %chaninfo % }
      if ($me isvoice $chan(%a)) { .set %chaninfo %chaninfo + }
      if ($me isreg $chan(%a)) { .set %chaninfo %chaninfo Regular Status }
      .set %chaninfo %chaninfo  :
      .set %chaninfo %chaninfo $nick($chan(%a), 0) User(s) .
      if (Q ison $chan(%a)) { .set %chaninfo %chaninfo Q - Service Bot is on this channel. }
      if (S ison $chan(%a)) { .set %chaninfo %chaninfo S - Spam Scan Bot is on this channel. }
      msg $chan %chaninfo
      .unset %chaninfo
      .inc %a
    }
  }
  while %a > %b { .halt }
}
alias tu {
  var %a = 1
  var %b = $chan(0)
  while %a <= %b {
    .set %tu $calc( %tu + $nick($chan(%a), 0) )
    .inc %a
  }
  .haltdef
}

Comments

Sign in to comment.
napa182   -  Oct 11, 2008

i like this idea but,
you should make it echo the info cuz if ur on alot of channels it floods or make it on one line..
you can also make this useing 1 while loop.
this will do the same thing for the most part

alias CInfo {
  var %^ = $chan(0)
  while (%^) {
    var %@ $addtok(%@,$+($chr(91),$chr(32),$chan(%^),$chr(32),$iif(!$chan(%^).mode,No Chan Mode's,$chan(%^).mode),$chr(32),:My User Status:,$chr(32),$iif($istok(~ & @ % +,$left($nick($chan(%^),$me).pnick,1),32),$replace($left($nick($chan(%^),$me).pnick,1),~,Owner,&,Admin,@,Op,%,HalfOp,+,Voice),Regular),$chr(32),:User Count:,$chr(32),$nick($chan(%^),0),$chr(32),$chr(93),$chr(32)),32), %! = $calc(%! + $nick($chan(%^),0)) 
    dec %^
  }
  msg # I am currently on $chan(0) Channels With a total of %! Users. %@ 
}

well if you are on too many channels it may cut off useing 1 line so heres this to stop that

alias CInfo {
  var %^ = $chan(0)
  while (%^) {
    var %@ $addtok(%@,$+([,$chr(32),$chan(%^),$chr(32),$iif(!$chan(%^).mode,No Chan Mode's,$chan(%^).mode),$chr(32),:My User Status:,$chr(32),$iif($istok(~ & @ % +,$left($nick($chan(%^),$me).pnick,1),32),$replace($left($nick($chan(%^),$me).pnick,1),~,Owner,&,Admin,@,Op,%,HalfOp,+,Voice),Regular),$chr(32),:User Count:,$chr(32),$nick($chan(%^),0),$chr(32),],$chr(32)),32), %! = $calc(%! + $nick($chan(%^),0)) 
    dec %^
  }
  msg # I am currently on $chan(0) Channels With a total of %! Users. | msg # $iif($chan(0) == 1,%@,$+($gettok(%@,$+(1-,$calc($numtok(%@,93) /2)),93),$chr(93))) |  $iif($chan(0) != 1,msg # $+($gettok(%@,$+($calc($numtok(%@,93) /2 +1),-),93),$chr(93)))
}
 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.