Top

Rock Paper Scissors game


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  6.0 (of 2 scores)
Date Added  May 05, 2008
Last Updated  Jun 25, 2008
Tags  chance  compact  game  mirc  paper  random  remotes  rock  scissors 

Description

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
<Vaseline> [ Goofy|Around ] You've got to choose Rock, Paper or Scissors!

<~Goofy|Around> !RockPaperScissors scissors
<Vaseline> [ Goofy|Around ] <Your Choice: Scissors > <My Choice: Scissors > It's a draw!

<~Goofy|Around> !RockPaperScissors Rock
<Vaseline> [ Goofy|Around ] <Your Choice: Rock > <My Choice: Scissors > 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!**



Grab the Code

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 ] <Your Choice:4 $replace($($upper($left(%PlayerChoice,1)) $+ $right(%PlayerChoice,-1)),$chr(32),$chr(32)) > <My Choice:4 %ScriptChoice > 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 ] <Your Choice:4 $replace($($upper($left(%PlayerChoice,1)) $+ $right(%PlayerChoice,-1)),$chr(32),$chr(32)) > <My Choice:4 %ScriptChoice > [4 %Winner ] has won!
}

Comments

  (5)  RSS
RagBot
Comments: 46
 
mIRC Snippet:  Rock Paper Scissors game
Posted on Jun 7, 2008 11:53 am
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)
T012m3n7oR
Comments: 21
 
mIRC Snippet:  Rock Paper Scissors game
Posted on Jun 23, 2008 10:40 pm
8/10 good script i had to change it some so its easier to use.

Code:
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?
F*U*R*B*Y*
Comments: 627
 
mIRC Snippet:  Rock Paper Scissors game
Posted on Jun 23, 2008 10:47 pm
Code:

  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

Code:

  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)
T012m3n7oR
Comments: 21
 
mIRC Snippet:  Rock Paper Scissors game
Posted on Jun 24, 2008 3:20 pm
what does the -s do? i've never seen one in a script...
vaseline28
Comments: 162
 
mIRC Snippet:  Rock Paper Scissors game
Posted on Jun 30, 2008 11:32 am
-s echoes it back to status window, e.g.:

%PlayerChoice set to Rock

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom