Rock, Paper, Scissors Game for Bot

By Cage on Aug 18, 2007

If you don't know where to put the code, you don't need to use it.

Paste it and type !rps help to get the commands.

on *:TEXT:!rps*:#: {
  if ($2 == help) {
    .notice $nick Rock, Paper, Scissors commands:
    .notice $nick -
    .notice $nick !rps help - Displays the RPS help file.
    .notice $nick -
    .notice $nick !rps score <nickname> - Displays a player's score.
    .notice $nick -
    .notice $nick !rps - Begins RPS game.
  }
  elseif ($2 == score) && ($3) && (% [ $+ rpsscore. $+ [ $3 ] ] == $null)  { msg $chan $3 has no score yet, $nick $+ . }
  elseif ($2 == score) && ($3) { msg $chan $3 $+ 's score: % [ $+ rpsscore. $+ [ $3 ] ] }
  elseif ($2 == score) && (!$3) { msg $chan $nick $+ 's score: % [ $+ rpsscore. $+ [ $nick ] ] }
  elseif (!$2) {
    msg $chan Rock, Paper, Scissors game has commenced!
    set %x $rand(1,3)
    set %y $rand(1,3)
    if (%x == 1) && (%y == 1) { msg $chan $nick got rock $+ . $me got rock. It's a tie! }
    if (%x == 1) && (%y == 2) { msg $chan $nick got rock $+ . $me got paper. $me wins! | inc %rpsscore $+ . $+ $me 1 }
    if (%x == 1) && (%y == 3) { msg $chan $nick got rock $+ . $me got scissors. $nick wins! | inc %rpsscore $+ . $+ $nick 1 }
    if (%x == 2) && (%y == 1) { msg $chan $nick got paper $+ . $me got rock. $nick wins! | inc %rpsscore $+ . $+ $nick 1 }
    if (%x == 2) && (%y == 2) { msg $chan $nick got paper $+ . $me got paper. It's a tie! }
    if (%x == 2) && (%y == 3) { msg $chan $nick got paper $+ . $me got scissors. $me wins! | inc %rpsscore $+ . $+ $me 1 }
    if (%x == 3) && (%y == 1) { msg $chan $nick got scissors $+ . $me got rock. $me wins! | inc %rpsscore $+ . $+ $me 1 }
    if (%x == 3) && (%y == 2) { msg $chan $nick got scissors $+ . $me got paper. $nick wins! | inc %rpsscore $+ . $+ $nick ) 1 }
    if (%x == 3) && (%y == 3) { msg $chan $nick got scissors $+ . $me got scissors. It's a tie! }
  }
}

Comments

Sign in to comment.
lillaiwazz   -  Jul 18, 2008

Nice but... cold you do multiplayer game?

 Respond  
criminal   -  Mar 13, 2008

Nice :)
you should add timers :)

 Respond  
guest598594   -  Aug 21, 2007

Should make them local variables.

 Respond  
Monky   -  Aug 18, 2007

I was about to suggest the same...

 Respond  
kerstt   -  Aug 18, 2007

i have no clue where you got the idea from.... oh wait my dialog? :\

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.