All pastes #455599 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-24 09:13 UTC
rendered paste body
on *:TEXT:!coinfilp*:#tokens: { 
  if ($2 == $null) { notice $nick notice $nick Syntax: !cionflip Heads/Tails}
    else { notice $nick You filp a coin...  } 
    else if ($2 == heads)
    set %cointosshead $rand(1,4) 
  else if (%cointoss isnum 1) /notice $nick The coin landed tails up... you have lost 25 Tokens. | dec %tokens. [ $+ [ $nick ] ] $25 }
else if (%cointoss isnum 2) /notice $nick Congratulations! The coin landed heads up and you have won 50 Tokens! | inc %tokens. [ $+ [ $nick ] ] 50 }
else if (%cointoss isnum 3) /notice $nick The coin landed tails up... you have lost 25 Tokens. | dec %tokens. [ $+ [ $nick ] ] 25 }
else if (%cointoss isnum 4) /notice $nick Congratulations! The coin landed heads up and you have won 50 Tokens! | inc %tokens. [ $+ [ $nick ] ] 50 }
else if ($2 == tails) 
set %cointostail $rand(1,4)
else if (%cointoss isnum 1) { /notice $nick The coin landed heads up... you have lost 25 Tokens. | dec %tokens. [ $+ [ $nick ] ] 25 }
else if (%cointoss isnum 2) { /notice $nick Congratulations! The coin landed tails up and you have won 50 Tokens! | inc %tokens. [ $+ [ $nick ] ] 50 }
else if (%cointoss isnum 3) { /notice $nick The coin landed heads up... you have lost 25 Tokens. | dec %tokens. [ $+ [ $nick ] ] $nick 25 }
else if (%cointoss isnum 4) { /notice $nick Congratulations! The coin landed tails up and you have won 50 Tokens! | inc %tokens. [ $+ [ $nick ] ] 50 }
else if (%cointoss isnum 5) { /notice $nick You have lost your coin. You have to buy one by saying !Token BuyCoin amount. | dec %coins. [ $+ [ $nick ] ] }     
}