mIRC Homepage
Posted By: The_Game on join.. - 14/04/03 03:16 AM
I'm looking for a scipt. Usually when I would enter the channel it would display the following:


*Number of Total People
*Number of Channel Ops
*Number of Channel Voices
*Number of Regulars
*Number of Aways
*Number of Bans


I don't remember if it was a snippet or an addon but I can't seem to locate it. Anyone know how I may be able do something similar? Any help would be appreciated.
Posted By: Othello Re: on join.. - 14/04/03 03:31 AM
Here is something to work with


Code:
  [color:red]on *:join:#: {
  echo 1 »14»15» 12Quick Channel Stats for # $+  
  echo 1 »14»15» 2Ops:14(18 $+ $opnick(#,0) $+ 14)2 
  echo 1 »14»15» Voice:14(18 $+ $vnick(#,0) $+ 14)2
  echo 1 »14»15» Non-Ops:14(18 $+ $nvnick(#,0) $+ 14)2
  echo 1 »14»15» Total:14(18 $+ $nick(#,0) $+ 14)
}  [/color]  

Posted By: The_Game Re: on join.. - 14/04/03 04:17 AM
Ok somethings not right with that...When I join the channel with approximately 6 ops in the services channel on the network I frequent, 7 including myself I get this:

»»» Quick Channel Stats for #Services
»»» Ops:(0)
»»» Voice:(0)
»»» Non-Ops:(1)
»»» Total:(1)

I think thats somewhat a bit off...also if possible I would like to be able to have it list the number of bans for that channel (if any) and any aways. But so far this is the general idea I was hoping for...any additional suggestions? Thanks again!
Posted By: Watchdog Re: on join.. - 14/04/03 05:17 AM
Code:
ON *:JOIN:#: {
  if ($nick == $me) {
    echo -ta User levels are: $nick($active,0,o) Ops, $nick($active,0,v) Voices, $nick($active,0,h) Halfops, $nick($active,0,u) Userops, $nick($active,0,r) Normal users, $nick($active,0) Total users, $ibl($active,0) Bans.
  }
}


Not tested in the ON JOIN environment but in theory should work. Just edit out the mode types that don't apply to your network. :grin;

I do know that if you have access to the channel this won't be shown here unless you run the /echo as an alias.

Code:
EG ON *:JOIN:#: {
  if ($nick == $me) {
    .timer 1 1 cumodes
  }
}


...then

Code:
alias cumodes {
  echo -ta User levels are: $nick($active,0,o) Ops, $nick($active,0,v) Voices, $nick($active,0,h) Halfops, $nick($active,0,u) Userops, $nick($active,0,r) Normal users, $nick($active,0) Total users, $ibl($active,0) Bans.
}
Posted By: Nimue Re: on join.. - 14/04/03 05:19 AM
Well that can't work because at the moment you join a channel, mIRC knows of only ONE user for that channel, You smile

You have to wait until you've recieved the names list, (Raw) 366 YourNick #channel :End of /NAMES list.
Code:
raw 366:*:{
  echo $2 1 »14»15» 12Quick Channel Stats for $2
  echo $2 1 »14»15» 2Ops:14(18 $+ $nick(#,0,o) $+ 14)2
  echo $2 1 »14»15» Voice:14(18 $+ $nick(#,0,v) $+ 14)2
  echo $2 1 »14»15» Non-Ops:14(18 $+ $nick(#,0,r) $+ 14)2
  echo $2 1 »14»15» Total:14(18 $+ $nick(#,0) $+ 14)
}


To get the other items,
- /who #channel
- - raw 352 <- parse the replies to inc a var or something if G in $7
- - raw 315 <- echo how many users are away

- /mode #channel b
- raw 368 is end of banlist, now you can echo the total number of bans

Check Hammers snippet Here

[edit] raw 368 is the end of banlist smile
Posted By: codemastr Re: on join.. - 14/04/03 05:52 AM
$ibl(#,0) would be a cleaner way to get the number of bans.
Posted By: Nimue Re: on join.. - 14/04/03 05:55 AM
Cleaner than what?
Posted By: Othello Re: on join.. - 14/04/03 06:07 AM
Thanks Nimue and Watchdog

I did not check the on join The Script I Use is in popup channel
and it returned this

1 »14»15» 12Quick Channel Stats for #mpgoldies
1 »14»15» 2Ops:14(18914)2 Voice:14(18714)2 Non-Ops:14(182314)2 Total:14(183914)

Now if The_Game can get a clone count on top of that, then he would have full channel stats grin
Posted By: Watchdog Re: on join.. - 14/04/03 06:18 AM
You can't always get a clone count. Some networks mask hostnames and IP addresses (an increasingly popular policy) and in this situation a clone scanner is completely out of the question unless you are an oper and the IRCd you use is capable of telling you when concurrent connections from one IP reach a given level.
Posted By: codemastr Re: on join.. - 14/04/03 05:13 PM
Quote:
- /mode #channel b
- raw 368 is end of banlist, now you can echo the total number of bans


Cleaner than that...
Posted By: Nimue Re: on join.. - 14/04/03 05:25 PM
My post didn't say HOW to display it, rather when you COULD display it. smile
Without first doing a "/mode # b" mIRC can't know the full banlist. wink
Posted By: The_Game Re: on join.. - 15/04/03 12:16 AM
Thanks everyone...as for what i was looking for, I think hammers snippett was the one that i saw...anyways it does what i wanted so im not complaining grin

Thanks again everyone
Posted By: Watchdog Re: on join.. - 15/04/03 02:16 AM
I wonder where Hammer disapeared to, he suddnely stopped coming...

'Spose it's a mans right to come and go but he was the top poster for a long time.
Posted By: The_Game Re: on join.. - 15/04/03 08:25 AM
Probably taking the well deserved break. Many of his posts were mainly coding. Either he's taking the long vacation or he found a new hobby LOL smile
Posted By: Chimera Re: on join.. - 18/04/03 06:22 PM
When someone joins a channel you are on, is there any difference between
on *:JOIN:#: if ($istok($aop($fulladdress).type,$chan,44)) { do something }
and
on *:JOIN:#: if ($nick isaop $chan) { do something }
I did it the long way first forgetting about isaop, but is there a circumstance where it would give a different result?
Posted By: Nimue Re: on join.. - 18/04/03 07:27 PM
Yes.

on *:JOIN:#: if ($istok($aop($fulladdress).type,$chan,44)) { do something }
Will be $true if you have added $nick to your aop list for that channel.

BTW:
on *:JOIN:#:if $ial($nick) isaop # { do something }
Does exactly the same thing. smile

and

on *:JOIN:#: if ($nick isop $chan) { do something }
Will always be false.
A user can not be opped at the time of joining a channel.
You must first be ON the chan (after the 'on join') before you can be opped on it.
© mIRC Discussion Forums