My Code for mIRC;
on *:text:!raffle *:#:{
var %hash $+(raffle.,#)
if ($nick isop #) && $2 == on && !$hget(%hash) {
hmake %hash
msg # The raffle now is open. Use !raffle and the amount of time you would like to enter to join. Remember, 1 entry = 3 PuroPoints! }
elseif $2 isnum && $2 > 0 && $hget(%hash) {
var %topic $+(#,.,$nick), %point $readini(points.ini,%topic,points)
var %ra $calc( $2 * 3 - 0)
if %point >= %ra {
var %p $calc( %point - %ra )
writeini points.ini %topic points %p
var %i $hget(%hash,0).item, %t $calc(%i + $2)
while %i < %t { inc %i | hadd %hash %i $nick }
msg # $nick $+ , You bought $2 ticket, you now have %p points
}
else { msg # $nick Sorry, you don't have enough PuroPoints }
}
elseif ($nick isop #) && $2 == winner && $hget(%hash) {
var %i $rand(1,$hget(%hash,0).data)
msg # The winner is $hget(%hash,%i).data $+ .
}
elseif ($nick isop #) && $2 == over && $hget(%hash) {
var %i $rand(1,$hget(%hash,0).data)
hfree %hash
}
}
How do I make it so that when !raffle on (number) is put in by a moderator. The number will be the price that a ticket shall cost. At the moment a ticket costs 3. I thought it would be like;
var %ra $calc( $2 * $3 - 0)
But it won't work> Any ideas please
Based on your commentes the following should suite you well.
Change:
var %ra $calc( $2 * 3 - 0)
To:
var %ra = $calc($2 * %pricePerTicket)
And write at mIRC command the following:
/set %pricePerTicket 3
This will set the price per ticket to 3, and you can change it at will.