All pastes #557069 Raw Edit

toss

public text v1 · immutable
·published 2007-06-10 21:12 UTC
rendered paste body
on *:TEXT:!toss*:#:{
  if ($2 == heads) || ($2 == tails) {
    /set %pi $2
    var %flip = $rand(1,2) 
    if (%flip == 1) {
      /set %outcome Heads
      else { /set %outcome Tails }
      if (%outcome == %pi) { msg $chan $nick needs %pi to win. | describe $chan flips the coin. | timertoss 1 1.5 /msg $chan It lands on %outcome $+ . $nick wins!  
      else { msg $chan $nick needs %pi to win. | describe $chan flips the coin. | timertoss 1 1.5 /msg $chan It lands on %outcome . $nick loses. 
      }
    }
  }
  else notice $nick Sorry, $2- is not an actual outcome.
}