mIRC Homepage
Posted By: ToRmEnTeD Peak users script with No !command needed - 20/10/08 12:01 AM
Hey i am trying to find a simple but yet nice looking script that will keep track of the record high count of users in a channel. I find a few but they all want you to do a !command. I just want it to announce to the room that the Room has a new high record count and what the number is.
Would also be nice to have a !command to get the script to display the record to the room whenever a @ does it...

Any help on this would be apprecated
thanks for reading smile
Code:

on *:JOIN:*:.timer 1 1 maxjoin $chan
alias maxjoin {
  echo -a JOIN $1 $nick($1,0,a) $($+(%,chanmax.,$1),2)
  if ($nick($1,0) < $($+(%,chanmax.,$1),2)) { return }
  set $+(%,chanmax.,$1) $v1
  ;;;; Your actions below this line ;;;;
  msg $1 New high count: $v1
}

on *:TEXT:!maxusers:*:{
  if ($($+(%,chanmax.,$chan),2) !isnum 1-) return
  ;;;; Your actions below this line ;;;;
  msg $chan Current high count: $v1
}



Currently, the code keeps track of any channel that the bot/script is run on.

-genius_at_work
Hey thanks for that! It worked perfect. I just changed the message a little bit and it looked exactly like i want! Really apprecate it! smile
I been trying to play with the script to make it use the /me command to send the msgs to the channel and it dont seem to work. I also tried ACTION and it also didnt work. It shows correctly in the script thats being used to send the msg but the room users dont see it...kinda weird.
Any ideas?
Posted By: Miyako Re: Peak users script with No !command needed - 20/10/08 08:27 PM
try: describe <roomname> <text>
perfect ! smile Thank you so very much !
thought i would post it as its working in case anyone else needs it.

on *:JOIN:*:.timer 1 1 maxjoin $chan
alias maxjoin {
echo -a JOIN $1 $nick($1,0,a) $($+(%,chanmax.,$1),2)
if ($nick($1,0) < $($+(%,chanmax.,$1),2)) { return }
set $+(%,chanmax.,$1) $v1
;;;; Your actions below this line ;;;;
describe #chat18+ The New record High user count for #chat18+ is: $v1
}

on *:TEXT:!count:*:{
if ($($+(%,chanmax.,$chan),2) !isnum 1-) return
;;;; Your actions below this line ;;;;
describe #chat18+ Current Record high user count for #Chat18+ is: $v1
}
In future, please use the Code Tags button (looks like a # character) around code.

I would recommend you change the second * in the ON TEXT event to a # character.
The reason for this, is that with the * a person could pm/query the client with the !count command, but the client wouldn't know what information to relay, as $chan (as required for the %chanmax<channel> variable) will return $null, therefore making the accessed variable read as %chanmax. rather than %chanmax.help (as an example).
By using the # character, mIRC will not recognize the !count command unless it comes from within the channel.
im not even going to lie. I am new to this and i understand about placing the code with the (brackets)but i am kinda lost on the command thing . Could you give me an example or snipit or something that i can look at?
Code:
on *:JOIN:*:.timer 1 1 maxjoin $chan
alias maxjoin {
  echo -a JOIN $1 $nick($1,0,a) $($+(%,chanmax.,$1),2)
  if ($nick($1,0) < $($+(%,chanmax.,$1),2)) { return }
  set $+(%,chanmax.,$1) $v1
  ;;;; Your actions below this line ;;;;
  describe #chat18+ The New record High user count for #chat18+ is: $v1
}

on *:TEXT:!count:#:{
  if ($($+(%,chanmax.,$chan),2) !isnum 1-) return
  ;;;; Your actions below this line ;;;;
  describe $chan Current Record high user count for $chan is: $v1
} 

Ok thank you i see what you did. Thanks for that smile
© mIRC Discussion Forums