Rock Paper Scissors game

By vaseline28 on May 05, 2008

Again, the idea here was to keep it compact. The script randomly picks one type for itself and then uses math(s) to determine who the winner is.
I've been seeing a number of Rock,Paper,Scissors games around and decided to make one for myself.
Script is prompted by !RockPaperScissors <your choice of Rock,Paper,Scissors> .
The math(s) works simply that the way it is worked out, whichever wins, the only available winning calculations are 1 or -2. All others lose.
This also converts the user's first letter of their word to capital (!Rockpaperscissors rock would turn to "Rock")

Examples:

<~Goofy|Around> !RockPaperScissors pencilsharpenings

**[ Goofy|Around ]** You've got to choose Rock, Paper or Scissors! <~Goofy|Around> !RockPaperScissors scissors **[ Goofy|Around ]** It's a draw! <~Goofy|Around> !RockPaperScissors Rock **[ Goofy|Around ]** **Goofy|Around** has won! ***Thanks to Goofy|Around (Scakk here) for the endless testing and the script for changing the first letter of the user's input to a capital!*** ```mirc on *:text:!RockPaperScissors*:#: { if ($2 !isin $1) { msg $chan [4 $nick ] You've got to choose Rock, Paper or Scissors! | halt } var %PlayerChoice $2 | /var %PlayerChoiceNum $replace(%PlayerChoice,Paper,2,Rock,1,Scissors,0) | /var %ScriptChoiceNum $rand(0,2) | /var %ScriptChoice $replace(%ScriptChoiceNum,2,Paper,1,Rock,0,Scissors) if (%PlayerChoice == %ScriptChoice) { msg $chan [4 $nick ] It's a draw! halt } elseif (($calc(%ScriptChoiceNum - %PlayerChoiceNum) == 1) || ($calc(%ScriptChoiceNum - %PlayerChoiceNum) == -2)) { var %winner $me } else { var %winner $nick } msg $chan [4 $nick ] [4 %Winner ] has won! } ```

Comments

Sign in to comment.
vaseline28   -  Jun 30, 2008

-s echoes it back to status window, e.g.:

%PlayerChoice set to Rock

 Respond  
T012m3n7oR   -  Jun 24, 2008

what does the -s do? i\'ve never seen one in a script...

 Respond  
F*U*R*B*Y*   -  Jun 23, 2008
  var -s %PlayerChoice $2 | /var -s %PlayerChoiceNum $replace(%PlayerChoice,Paper,2,Rock,1,Scissors,0) | /var -s %ScriptChoiceNum $rand(0,2) | /var -s %ScriptChoice $replace(%ScriptChoiceNum,2,Paper,1,Rock,0,Scissors)

can\'t that be changed to

  var -s %PlayerChoice $2, -s %PlayerChoiceNum $replace(%PlayerChoice,Paper,2,Rock,1,Scissors,0), -s %ScriptChoiceNum $rand(0,2), -s %ScriptChoice $replace(%ScriptChoiceNum,2,Paper,1,Rock,0,Scissors)
 Respond  
T012m3n7oR   -  Jun 23, 2008

8/10 good script i had to change it some so its easier to use.

on *:text:!rps*:#: {
  if ($2 == p) { var %PlayerChoice Paper | goto rps }
  if ($2 == r) { var %PlayerChoice Rock | goto rps }
  if ($2 == s) { var %PlayerChoice Scissors | goto rps }
  if ($2 == paper) { var %PlayerChoice $2 | goto rps }
  if ($2 == rock) { var %PlayerChoice $2 | goto rps }
  if ($2 == scissors) { var %PlayerChoice $2 | goto rps }
  else { msg $chan [4 $nick ] You\'ve got to choose Rock, Paper or Scissors! | halt }
  :rps
  var %ScriptChoiceNum $rand(0,2)
  var %ScriptChoice $replace(%ScriptChoiceNum,2,Paper,1,Rock,0,Scissors)
  if (%PlayerChoice == %ScriptChoice) { msg $chan [4 $nick ] <Your Choice:4 $replace($($upper($left(%PlayerChoice,1)) $+ $right(%PlayerChoice,-1)),$chr(32),$chr(32)) > <My Choice:4 %ScriptChoice > It\'s a draw! | halt }
  var %PlayerChoiceNum $replace(%PlayerChoice,Paper,2,Rock,1,Scissors,0)
  if (($calc(%ScriptChoiceNum - %PlayerChoiceNum) == 1) || ($calc(%ScriptChoiceNum - %PlayerChoiceNum) == -2)) { var %winner $me }
  else { var %winner $nick }
  msg $chan [4 $nick ] <Your Choice:4 $replace($($upper($left(%PlayerChoice,1)) $+ $right(%PlayerChoice,-1)),$chr(32),$chr(32)) > <My Choice:4 %ScriptChoice > [4 %Winner ] has won!
}

lol ragbot you gave him a 4/10 if you voted if you didn\'t, well then sorry for the odd accusation.

all those \'4\'s in my script are sopose to have the color box.. it isn\'t showing up in code... i wonder why?

 Respond  
RagBot   -  Jun 07, 2008

It\'s a good rock paper scissors script, but it would be better if the commands was shorter, so i just changed it to !RPS (8/10)

 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.