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
}
}
我如何使它,当抽奖上(号码)是由主持人。这个数字就是一张票的价格。目前一张票要3英镑。我以为会是这样的;
var %ra $calc( $2 * $3 - 0)
但是行不通>有什么想法请告诉我
根据您的意见,以下内容应该适合您。
改变:
var %ra $calc( $2 * 3 - 0)
:
var %ra = $calc($2 * %pricePerTicket)
并在mIRC中写入以下命令:
/set %pricePerTicket 3
这将把每张票的价格设置为3美元,您可以随意更改。