mIRC Homepage

Variables

Posted By: AlphaKennyHuan

Variables - 27/11/13 08:42 PM

Hey guys, i have set up a giveaway system for my channel where it picks a random user and they win using this:

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) {
  msg # $upper($nick(#,$rand(1,$nick(#,0)))) Just won the giveaway, we'll send you a message with details on how to obtain. }
  else { msg # Dear $nick , You do not have permission to use this command! }
}


I was wondering if there was a way to get the name that it randomly picks, as i have a points system set up and what it to display the amount of points that the winner has

This is the coding that i would normally use to make it read a number of points that the user has:

Code:
$readini(Points.ini,$+(#,.,$nick),Points)



How would i make it so that when the bot picks a random user, that i can put it into the $readini coding instaed of where the $nick lies, so it would say:

BLAHBLAH ( Has 124 Points) Just won the giveaway, we'll send you a message with details on how to obtain.
Posted By: Wims

Re: Variables - 27/11/13 09:23 PM

Looks like you knew the title of your post is the answer: use a variable:

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) {
   var %randnick $nick(#,$rand(1,$nick(#,0)))
   msg # $upper(%randnick) ( $+ $readini(points.ini,n,$+(#,%randnick),points) $+ ) Just won the giveaway, we'll send you a message with details on how to obtain.
  }
  else { 
msg # Dear $nick , You do not have permission to use this command!
 }
}
Posted By: AlphaKennyHuan

Re: Variables - 28/11/13 10:53 PM

thank you, i am face palming so hard right now
© 2020 mIRC Discussion Forums