chans peak mass counter all chans)

By XpLoiTeR on Jan 09, 2006

that snippet will let u know the number of users on every channel ur on....works so easily with an alias /masscount...
watch it works :) note:dont write /masscount while ur not on channels

alias masscount {
  if ($chan($me) != 0) {
    var %channel.numbers $chan(me)
    var %temp 0
    :process
    if (%temp < %channel.numbers) {
      inc %temp 1
      Echo -a  12(!)--> 2[4 $+ $chan(%temp) $+ 2]4  4Has A Record Of 2[4 $+ ! $+ $nick($chan(%temp),0) $+ ! $+ 2]4 4Users.
      goto process
    }
    else { halt }
  }
  else { echo -a (!) Your Not On Any Channels !! }
}

Comments

Sign in to comment.
FiberOPtics   -  Jan 10, 2006

No problem :)

 Respond  
XpLoiTeR   -  Jan 10, 2006

fiberoptics ;) now i respect u :) thx for the link and for $comchan illustration ur really good scripter

 Respond  
QuickStep   -  Jan 10, 2006

Thanks for the link, finally a good example where the var without = shows an unexpected error. Have to remember that one.

 Respond  
Yoinx   -  Jan 10, 2006

good point fiberoptics.

 Respond  
FiberOPtics   -  Jan 10, 2006

Yikes that url didn\'t get formatted.

Btw you should loop through $comchan($me,%i) instead of $chan, because $chan makes no distinction between channels that you are in, and channels you are not in. When you disconnect from IRC, and have the optoin \"keep channels open\", and you reconnect, without rejoining those chans, those channel windows stay open and $chan includes those.

$comchan($me,N) only takes into account actual online channels.

 Respond  
FiberOPtics   -  Jan 10, 2006

The reason why you get errors when not using the correct syntax is explained here

 Respond  
Yoinx   -  Jan 10, 2006

yeah, I wouldnt have done two vars either, except it was to show him how to do it in one line.

 Respond  
XpLoiTeR   -  Jan 10, 2006

this is a code i respect :) .... thanks atom man who ever u r??i think u hve another nick dont u??

 Respond  
atom_man   -  Jan 10, 2006

This is how I would have made it, without 2 vars.

alias masscount {
if ($chan(0)) {
var %x = $chan(0)
while (%x) {
echo -a COUNT $chan(%x) has $nick($chan(%x),0) users.
dec %x
}
}
}

 Respond  
atom_man   -  Jan 10, 2006

this is how I would have made it... u don\'t need 2 vars...

alias masscount {
  if ($chan(0)) {
    var %x = $chan(0)
    while (%x) {
      echo -a ***COUNT*** $chan(%x) has $nick($chan(%x),0) users.
      dec %x
    }
  }
}
 Respond  
XpLoiTeR   -  Jan 10, 2006

thanks...but still has no bugs :D i know that the shorter the code is the better the result will be...but u cant say its that bad ;) it still working clean of bugs ;) and for the cases uve ran into..i will be glad if u told me abt them in case uve remembered.. thx

 Respond  
Yoinx   -  Jan 09, 2006

although, I didnt include an error. but, that can just use an
else echo -a You arent on any channels. at the end, like you have.

also... when using the var command, its good practice to use
var = %var

there are some cases (I\'ve run into them, but cant remember the exact cases) where not using the = will produce unexpected results.

 Respond  
Yoinx   -  Jan 09, 2006

this isnt a channel peak of any sort. it lets you know how many people are currently on the chan. and what kutsum means. is the code looks cleaner with a while loop. For example.

alias chanusers {
if ($chan(0)) {
var %x = 1,%z = $v1
while (%x <= %z) {
echo -a $chan(%x) has a user cout of $nick($chan(%x),0)
inc %x
}
}
}

shorter, and cleaner looking. No offense. Just a tip. Comments are all about teaching people cleaner/ more efficient ways to do things.

 Respond  
XpLoiTeR   -  Jan 09, 2006

KuTsuM...thx but u cant consider it bugs....u just use a different method of coding :) thats all....its still workin and has no bugs
... nothing but thanks

 Respond  
KuTsuM   -  Jan 09, 2006

Two things, 1. Use the var command only once (var %channel.numbers = $chan(me),%temp = 0 2. Why not use a while loop. It\'s much cleaner:
while (%temp <= %channel.numbers) {
commands
inc %temp
}

 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.