Advertisement
Iire

Raffle fix for Herz Beatz

Aug 16th, 2014
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on *:TEXT:!buyherz &:#:{
  2.   if (!%raffle) { msg $chan Raffle is currently closed! }
  3.   else {
  4.     if ($int($2) < 1) { msg $chan Do you really want to buy no Herz, $nick $+ ..? }
  5.     elseif ($int($2) > 10) { msg $chan Sorry $nick but you can only buy up to 10 Herz at a Time. }
  6.     else {
  7.       var %i = 0, %ticket = $int($2)
  8.       var %topic = $+(#,.,$nick), %user = $readini(Points.ini,%topic,Points), %end = 10 * %ticket, %delete = %user - %end
  9.       if (%delete > 0) {
  10.         writeini -n $qt(Points.ini) %topic Points %delete
  11.         while (%i < %ticket) {
  12.           write $qt(Raffle.txt) $nick
  13.           inc %i
  14.         }
  15.         msg $chan $nick you have bought %ticket Herz with %end Beatz.
  16.       }
  17.     }
  18.   }
  19. }
  20. on *:TEXT:!raffle &:#:{
  21.   if ($nick isop #) {
  22.     if (($2 == open) && (!%raffle)) || (($2 == close) && (%raffle))  {
  23.       msg $chan RAFFLE IS NOW $replace($upper($2!!),CLOSE,CLOSED)
  24.       if ($2 == open) { set %raffle 1 }
  25.       else unset %raffle
  26.       write -c $qt(Raffle.txt)
  27.     }
  28.   }
  29. }
  30. on *:TEXT:!roll:#:{
  31.   if ($nick isop #) && (%raffle) {
  32.     msg $chan RAFFLE IS NOW BEING ROLLED, GOOD LUCK!!
  33.     .timerCD 1 3 msg $chan /me $!calc( $!timer(CD).reps + 1 ) $!+ !
  34.     .timer 1 4 msg $chan AND THE WINNER IS:
  35.     .timer 1 5 msg $chan $read(Raffle.txt, n)
  36.     unset %raffle
  37.     write -c $qt(Raffle.txt)
  38.   }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement