0

我的 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
  }
}

我如何做到这一点,以便当主持人输入 !raffle on (number) 时。该数字将是一张票的价格。目前一张票要 3 块钱。我以为​​会是这样;

var %ra $calc( $2 * $3 - 0)

但这行不通>请有任何想法

4

1 回答 1

0

根据您的评论,以下内容应该适合您。

改变:

var %ra $calc( $2 * 3 - 0)

到:

var %ra = $calc($2 * %pricePerTicket)

并在 mIRC 命令中写入以下内容:

/set %pricePerTicket 3

这会将每张票的价格设置为 3,您可以随意更改它。

于 2014-06-23T14:36:49.103 回答