All pastes #492994 Raw Edit

BrewersBot !bgame

public text v1 · immutable
·published 2007-05-17 15:16 UTC
rendered paste body
on *:TEXT:!bgame:#: { 
  if (%bgame2 == active) { 
    notice $nick A game of Baseball(Homerun Contest) is already active. Please wait until it is finished to play. 
  halt } 

  elseif { 
    (%bgame == active) { 
      set %bgameplayer2 $nick 
      set %bgame2 active 
      Msg $chan Baseball(Homerun Contest) is set! The game is %bgameplayer1 vs %bgameplayer2 $+ ! 
      set %bgameturn 1 
    } 

    else { 
      set %bgameplayer1 $nick 
      set %bgame active 
      msg $chan %bgameplayer1 Would like to play Baseball(Homerun Contest). Type !bgame to play! 
    } 
  } 
} 

on *:TEXT:!swing:#: { 
  if (%bgame != active) { 
    notice $nick Sorry, there is no current game of Baseball(Homerun Contest), to play type !bgame. 
  halt } 

  elseif { 
    (%bgame == active) && (%bgameturn == 1) { 
      set %ball $rand(1,6) 
      if (%ball isnum 1-5) { 
        msg $chan Crack! Lucky you hit a HOMERUN! ;) 
      set %bgameturn 2 } 
    } 
  } 

  elseif { 
    (%ball == 6) { 
    msg $chan You swing and missed the bal so you lose the Baseball (Homerun Contest. %bgameplayer2 is the winner! } 
    unset %ball
    unset %bgameplayer1 
    unset %bgameplayer2 
    unset %bgame 
    unset %bgame2 
    unset %bgameturn 
  } 

  else { 
    if (%bgameturn == 2) { 
      set %ball $rand(1,6) 
      if (%ball isnum 1-5) { 
        msg $chan Crack! Lucky you hit a HOMERUN!  ;) 
        set %bgameturn 2 
      } 
    } 
  } 
}