Ultimate Rock Paper Scissors v2 - Game

Platform:  mIRC
Published  Apr 01, 2009
Updated  Apr 01, 2009
This game is fairly self explanatory. You type !rps <nick> [rounds]

[rounds] is not necessary, but if you want to play more than a single game with someone, you can do this, for example:

<NIGathan> !rps testicles 3
<DUMB_BOT> NIGathan has challenged testicles to a 'first to 3' game of 'Rock, Paper, Scissors'!
<testicles> !accept
-NOTICE- <DUMB_BOT> You have 60 seconds to choose one of the following: 'gun dynamite nuke lightning devil dragon alien water bowl air axe scissors fire sun rock tree man woman monkey snake moon paper sponge wolf cockroach'. Syntax: /notice DUMB_BOT [!choicehere]
-NOTICE to DUMB_BOT- !monkey
-NOTICE- <DUMB_BOT> You have chosen monkey.
-NOTICE- <DUMB_BOT> Please wait for testicles to decide what to pick.
<DUMB_BOT> NIGathan chose monkey - testicles chose woman.
<DUMB_BOT> Congratulations NIGathan!! Monkey flings poop at woman!
<DUMB_BOT> Score: 1 - 0, NIGathan leading.
-NOTICE- <DUMB_BOT> You have 60 seconds to choose one of the following: 'gun dynamite nuke lightning devil dragon alien water bowl air axe scissors fire sun rock tree man woman monkey snake moon paper sponge wolf cockroach'. Syntax: /notice DUMB_BOT [!choicehere]

.....etc until someone has a total of 3 wins.

You can also challenge the bot as well.

If something causes an unknown error, all values will be reset and you can begin a new game, if any other type of error is triggered and causes the game to end or function improperly, you can use the /rps.reset command to manually reset all values.

I wrote the original version of this script a long time ago, and recently ported it to C++, but I completely changed everything and rewrote the entire way it all worked, so I could hardly call it a port. Pleased with the C++ version, which can be found here: http://www.mediafire.com/?nyyowvttm24 (source included, str_tok.h was written by me, if you use this header please credit me in some way.), I decided to port it back from C++ to mSL using my new method. It turned out quite nicely :D

And heres the chart:



Oh I forgot to mention.. Old script: 4752 lines, new script: 200 lines. on *:START: {
hadd -m rps results.1 fire.Gun fires.rock.Gun targets rock.sun.Gun shoots at sun.scissors.Gun destroys scissors.axe.Gun chips axe.snake.Gun shoots snake.monkey.Gun shoots monkey.woman.Gun shoots woman.man.Gun shoots man.tree.Gun targets tree.cockroach.Gun shoots cockroach.wolf.Gun shoots wolf
hadd -m rps results.2 gun.Dynamite outclasses gun.rock.Dynamite explodes rock.sun.Smoke caused by dynamite blots out the sun.fire.Dynamite starts fire.scissors.Dynamite explodes scissors.axe.Dynamite explodes axe.snake.Dynamite explodes snake.monkey.Dynamite explodes monkey.woman.Dynamite explodes woman.man.Dynamite explodes man.tree.Dynamite explodes tree.cockroach.Dynamite explodes cockroach
hadd -m rps results.3 dynamite.Nuke outclasses dynamite.gun.Nuke outclasses gun.rock.Nuke incinerates rock.sun.Nuke has the power of the sun.fire.Radiation plus fire destroys fire.scissors.Nuke incinerates scissors.snake.Nuke incinerates snake.axe.Nuke incinerates axe.monkey.Nuke incinerates monkey.woman.Nuke incinerates woman.man.Nuke incinerates man.tree.Nuke incinerates tree
hadd -m rps results.4 nuke.Lightning difuses nuke.dynamite.Lighting ignites dynamite.gun.Lightning melts gun.rock.Lightning splits rock.sun.Lightning lives in storms which block the sun.fire.Lightning starts fire.scissors.Lightning melts scissors.axe.Lightning melts axe.snake.Lightning strikes snake.monkey.Lightning strikes monkey.woman.Lightning strikes woman.man.Lightning strikes man
hadd -m rps results.5 lightning.Devil casts lightning.nuke.Devil inspires nuke.dynamite.Devil inspires dynamite.gun.Devil inspires gun.rock.Devil hurls rock.sun.Devil curses sun.fire.Devil breathes fire.scissors.Devil is immune to scissors.axe.Devil is immune to axe.snake.Devil eats snake.monkey.Devil enrages monkey.woman.Devil tempts woman.
hadd -m rps results.6 devil.Dragon commands devil.lightning.Dragon breathes lightning.nuke.Dragon lived before nukes.dynamite.Dragon flosses with dynamite.gun.Dragon is immune to guns.rock.Dragon rests upon rock.sun.Dragon blots out sun.fire.Dragon breathes fire.scissors.Dragon is immune to scissors.axe.Dragon is immune to axe.snake.Dragon spawns snake.monkey.Dragon chars monkey
hadd -m rps results.7 dragon.Alien vaporizes dragon.devil.Aliens are non-believers of the devil.lightning.Alien shoots lightning.nuke.Alien defuses nuke.dynamite.Alien defuses dynamite.gun.Alien force-fields gun.rock.Alien vaporizes rock.sun.Alien destroys sun.fire.Alien fuses fire.scissors.Alien force-fields scissors.axe.Alien force-fields axe.snake.Alien mutates snake
hadd -m rps results.8 alien.Water is toxic to alien.dragon.Water drowns dragon.devil.Water blesses devil.lightning.Water conducts lightning.nuke.Water short-circuits nuke.dynamite.Water douses dynamite.gun.Water rusts gun.rock.Water erodes rock.sun.Water reflects sun.fire.Water puts out fire.scissors.Water rusts scissors.axe.Water rusts axe
hadd -m rps results.9 water.Bowl contains water.alien.Bowl shapes craft of alien.dragon.Bowl drowns dragon.devil.Bowl blesses devil.lightning.Bowl focuses lightning.nuke.Bowl encases core of nuke.dynamite.Bowl splashes dynamite.gun.Bowl splashes gun.rock.Bowl was once made of rock.sun.Bowl focuses sun.fire.Bowl snuffs out fire.scissors.Bowl covers scissors
hadd -m rps results.10 bowl.Air tips over bowl.water.Air evaporates water.alien.Air chokes alien.dragon.Air freezes dragon.devil.Air chokes devil.lightning.Air creates lightning.nuke.Air blows astray nuke.dynamite.Air blows out dynamite.gun.Air tarnishes gun.rock.Air erodes rock.sun.Air cools heat of sun.fire.Air blows out fire
hadd -m rps results.11 snake.Axe chops snake.monkey.Axe cleaves monkey.man.Axe cleaves man.woman.Axe cleaves woman.tree.Axe chops down tree.cockroach.Axe chops cockroach.wolf.Axe cleaves wolf.sponge.Axe chops sponge.paper.Axe slices paper.moon.Axe reflects moon.air.Axe flies through air.bowl.Axe chops bowl
hadd -m rps results.12 axe.Scissors are sharper than axe.snake.Scissors stab snake.monkey.Scissors stab monkey.woman.Scissors cut woman's hair.man.Scissors cut man's hair.tree.Scissors carve tree.cockroach.Scissors stab cockroach.wolf.Scissors cut wolf's hair.sponge.Scissors cut up sponge.paper.Scissors cut paper.moon.Scissors reflect moon.air.Scissors swish through air
hadd -m rps results.13 scissors.Fire melts scissors.axe.Fire forges axe.snake.Fire burns snake.monkey.Fire burns monkey.woman.Fire burns woman.man.Fire burns man.tree.Fire burns down tree.cockroach.Fire burns cockroach.wolf.Fire burns wolf.sponge.Fire burns sponge.paper.Fire burns paper.moon.Fire campfire by moonlight
hadd -m rps results.14 fire.Sun is made of fire.scissors.Sun melts scissors.axe.Sun melts axe.snake.Sun warms snake.monkey.Sun warms monkey.woman.Sun warms woman.man.Sun warms man.tree.Sun feeds tree.cockroach.Sun warms cockroach.wolf.Sun warms wolf.sponge.Sun dries up sponge.paper.Sun shines through paper
hadd -m rps results.15 sun.Rock shades sun.fire.Rock pounds out fire.scissors.Rock smashes scissors.axe.Rock chips axe.snake.Rock crushes snake.monkey.Rock crushes monkey.woman.Rock crushes woman.man.Rock crushes man.tree.Rock blocks tree roots.cockroach.Rock squishes cockroach.wolf.Rock crushes wolf.sponge.Rock crushes sponge
hadd -m rps results.16 cockroach.Tree shelters cockroach.wolf.Tree shelters wolf.sponge.Tree outlives sponge.paper.Tree creates paper.moon.Tree blocks moon.air.Tree produces air.bowl.Tree wood creates bowl.water.Tree drinks water.alien.Tree ensnares alien ship.dragon.Tree shelters dragon.devil.Tree imprisons devil.lightning.Tree attracts lightning
hadd -m rps results.17 tree.Man plants tree.cockroach.Man steps on cockroach.wolf.Man tames wolf.sponge.Man cleans with sponge.paper.Man writes paper.moon.Man travels to moon.air.Man breathes air.bowl.Man eats from bowl.water.Man drinks water.alien.Man disproves alien.dragon.Man slays dragon.devil.Man exorcises devil
hadd -m rps results.18 man.Woman tempts man.tree.Woman plants tree.cockroach.Woman steps on cockroach.wolf.Woman tames wolf.sponge.Woman cleans with sponge.paper.Woman writes paper.moon.Woman aligns with moon.air.Woman breaths air.bowl.Woman eats from bowl.water.Woman drinks water.alien.Woman disproves alien.dragon.Woman subdues dragon
hadd -m rps results.19 woman.Monkey flings poop at woman.man.Monkey flings poop at man.tree.Monkey lives in tree.cockroach.Monkey eats cockroach.wolf.Monkey enrages wolf.sponge.Monkey rips up sponge.paper.Monkey rips up paper.moon.Monkey screeches at moon.air.Monkey breaths air.bowl.Monkey smashes bowl.water.Monkey drinks water.alien.Monkey infuriates alien
hadd -m rps results.20 monkey.Snake bites monkey.woman.Snake bites woman.man.Snake bites man.tree.Snake lives in tree.cockroach.Snake eats cockroach.wolf.Snake bites wolf.sponge.Snake swallows sponge.paper.Snake nests in paper.moon.Snake nocturnal with moon.air.Snake breathes air.bowl.Snake sleeps in bowl.water.Snake drinks water
hadd -m rps results.21 air.Moon has no air.bowl.Moon shaped like bowl.water.Moon has no water.alien.Moon houses alien.dragon.Moon shines on dragon.devil.Moon terrifies devil.lightning.Moon is far above lightning.nuke.Moon is too far for nuke.dynamite.Moon suffocates dynamite.gun.Moonshine gunfight.rock.Moon shines on rock.sun.Moon eclipses sun
hadd -m rps results.22 moon.Paper uses its magic paperness to block out the moon.air.Paper fans air.bowl.Paper mache bowl.water.Paper floats on water.alien.Paper disproves alien.dragon.Paper rebukes dragon.devil.Paper rebukes devil.lightning.Paper defines lightning.nuke.Paper defines nuke.dynamite.Paper encases dynamite.gun.Paper outlaws gun.rock.Paper covers rock
hadd -m rps results.23 paper.Sponge soaks paper.moon.Sponge looks like moon.air.Sponge uses air pockets.bowl.Sponge cleans bowl.water.Sponge absorbs water.alien.Sponge intrigues alien.dragon.Sponge cleanses dragon.devil.Sponge cleanses devil.lightning.Sponge conducts lightning.nuke.Sponge cleans nuke.dynamite.Sponge soaks dynamite.gun.Sponge cleans gun
hadd -m rps results.24 sponge.Wolf chews up sponge.paper.Wolf chews up paper.moon.Wolf howls at moon.air.Wolf breaths air.bowl.Wolf drinks from bowl.water.Wolf drinks water.alien.Wolf chases alien.dragon.Wolf outruns dragon.devil.Wolf bites heiny of devil.lightning.Wolf outruns lightning.nuke."Wolf-2" launches nuke.dynamite.Wolf outruns dynamite
hadd -m rps results.25 wolf.Cockroach sleeps in fur of wolf.sponge.Cockroach nests in sponge.paper.Cockroach nests between papers.moon.Cockroach nocturnal with moon.air.Cockroach breaths air.bowl.Cockroach hides under bowl.water.Cockroach drinks water.alien.Cockroach stows away with alien.dragon.Cockroach eats eggs of dragon.devil.Cockroach makes men devils.lightning.Cockroach hides from lightning.nuke.Cockroach survives nuke
hadd -m rps opts gun dynamite nuke lightning devil dragon alien water bowl air axe scissors fire sun rock tree man woman monkey snake moon paper sponge wolf cockroach
}
on *:UNLOAD:hfree rps
on *:EXIT:hfree rps
on *:TEXT:*:#: {
tokenize 32 $strip($1-)
if ((!$istok(!accept.!decline,$1,46)) && (($len($1) != 4) || (R !isin $1) || (P !isin $1) || (S !isin $1))) && (!$istok($hget(rps,opts),$right($1,-1),32)) && (!* !iswm $1) halt
rps.in $1-
if ($len($1) == 4) && (R isin $1) && (P isin $1) && (S isin $1) rps.challenge $2 $iif($3 > 1,$3)
if ($1 == !ACCEPT) rps.accept
if ($1 == !DECLINE) rps.decline
}
on ^*:NOTICE:*:?: {
tokenize 32 $strip($1-)
rps.in $1-
if ($nick == $hget(rps,ONE)) { var %x one | hadd -m rps one.opt $iif(!* iswm $1,$right($1,-1),$1) }
if ($nick == $hget(rps,TWO)) { var %x two | hadd -m rps two.opt $iif(!* iswm $1,$right($1,-1),$1) }
.timer.rps. $+ %x $+ * off
.notice $hget(rps,%x) You have chosen $+($iif(!* iswm $1,$right($1,-1),$1),.)
if (!$hget(rps,$remove(onetwo.opt,%x))) .notice $hget(rps,%x) Please wait for $hget(rps,$remove(onetwo,%x)) to decide what to pick.
else rps.send.result
echo -a $hget(rps,%x) has made their decision
haltdef
halt
}
alias -l sqt return $+(',$1,')
alias -l rps.in {
if ($event == TEXT) {
if ($len($1) == 4) && (R isin $1) && (P isin $1) && (S isin $1) {
if ($hget(rps,progress)) rps.out msg in_prog
if (!$2) rps.out msg no_nick
if ($2 == $nick) rps.out msg nick_collision
if ($2 !ison $chan) rps.out msg nick_not_on_chan $2
if ($3) && ($3 !isnum 1-10) rps.out msg high_rounds
}
if ($istok($hget(rps,opts),$right($1,-1),32)) && ($hget(rps,progress)) rps.out msg syntax
if ($istok(!accept.!decline,$1,46)) && ($hget(rps,progress) == 2) rps.out msg in_prog
if ($istok(!accept.!decline,$1,46)) && ((!$hget(rps,progress)) || ($hget(rps,TWO) != $nick)) rps.out msg non_prog
if ($istok(!accept.!decline,$1,46)) && ($hget(rps,progress) == 1) && ($hget(rps,chan) != $chan) rps.out msg invalid_chan
}
else if ($event == NOTICE) {
if (!$istok($hget(rps,ONE) $hget(rps,TWO),$nick,32)) || ($hget(rps,progress) != 2) halt
if (!$istok($hget(rps,opts),$iif(!* iswm $1,$right($1,-1),$1),32)) rps.out notice syntax $iif(!* iswm $1,$right($1,-1),$1)
}
}
alias -l rps.out {
if (!$istok(msg.notice,$1,46)) return
var %rps.out.msg nick_not_on_chan nick_collision in_prog syntax non_prog no_nick unknown invalid_chan high_rounds
var %rps.out.notice syntax unknown

if (!$istok($($+(%,rps.out.,$1),2),$2,32)) return

var %rps.out.msg.nick_not_on_chan $sqt($3) is not currently on the channel, $+($nick,.)
var %rps.out.msg.nick_collision You cannot play 'Rock, Paper, Scissors' with yourself, $+($nick,.)
var %rps.out.msg.in_prog Please be Patient, $+($nick,.) There is already a game of rock paper scissors in progress.
var %rps.out.msg.non_prog You we're not challenged to a game of 'Rock, Paper, Scissors'. To challenge someone, type: !RPS [nicktochallenge]
var %rps.out.msg.syntax $+($nick,:) Correct Syntax is: '/notice $me [!choicehere]' It wouldn't be a bad idea to change your choice now.
var %rps.out.msg.no_nick Who would you like to challenge, $+($nick,?)
var %rps.out.msg.invalid_chan $+($nick,:) You were challenged from a different channel, please see $hget(rps,chan)
var %rps.out.msg.high_rounds Please choose an amount of rounds no greater than 10, and atleast 1.
var %rps.out.msg.unknown An unknown error has occured with RPS, please try again. $iif($3-,$qt($v1))

var %rps.out.notice.syntax $sqt($3) is not a valid request, choose one of the following: $qt($hget(rps,opts))

$1 $iif($1 == msg,$chan,$nick) $($+(%,rps.out.,$1,.,$2),2)
if ($2 == unknown) rps.reset
halt
}
alias -l rps.challenge {
if ($hget(rps,progress)) rps.out msg unknown rps.challenge was triggered and RPS seems to already be in progress
hadd -m rps progress 1
hadd -m rps ONE $nick
hadd -m rps TWO $nick($chan,$nick($chan,$1))
hadd -m rps chan $chan
if ($2) { hadd -m rps rounds $2 | hadd -m rps one.wins 0 | hadd -m rps two.wins 0 }
msg $chan $nick has challenged $iif($1 == $me,me,$1) to a $iif($2,$sqt(first to $v1))) game of 'Rock, Paper, Scissors'!
if ($1 != $me) { .notice $1 You have been challenged, by $+($nick,$chr(44)) to a game of 'Rock, Paper, Scissors' in $+($chan,.) Type: $sqt(!accept or !decline) | .timer.rps.chal 1 60 rps.timeout 1 }
else {
hinc rps progress
.notice $hget(rps,ONE) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.timer.rps.one.timeout 1 40 .notice $hget(rps,ONE) 20 seconds left.
.timer.rps.one.ftimeout 1 60 rps.timeout 2 one
hadd -m rps two.opt $gettok($hget(rps,opts),$rand(1,$numtok($hget(rps,opts),32)),32)
}
}
alias -l rps.rematch {
if ($hget(rps,progress) != 2) rps.out msg unknown rps.challenge was triggered but RPS doesn't seem to be ready
hdel rps one.opt
hdel rps two.opt
if ($hget(rps,TWO) != $me) {
.notice $hget(rps,ONE) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.notice $hget(rps,TWO) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.timer.rps.one.timeout 1 40 .notice $hget(rps,ONE) 20 seconds left.
.timer.rps.two.timeout 1 40 .notice $hget(rps,TWO) 20 seconds left.
.timer.rps.one.ftimeout 1 60 rps.timeout 2 one
.timer.rps.two.ftimeout 1 60 rps.timeout 2 two
}
else {
.notice $hget(rps,ONE) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.timer.rps.one.timeout 1 40 .notice $hget(rps,ONE) 20 seconds left.
.timer.rps.one.ftimeout 1 60 rps.timeout 2 one
hadd -m rps two.opt $gettok($hget(rps,opts),$rand(1,$numtok($hget(rps,opts),32)),32)
}
}
alias -l rps.accept {
if ($hget(rps,progress) != 1) rps.out msg unknown rps.accept was triggered and RPS is not in challenge mode
if ($hget(rps,TWO) == $me) rps.out msg unknown rps.accept was triggered during a bot play scenario
hinc rps progress
.timer.rps.chal off
.notice $hget(rps,ONE) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.notice $hget(rps,TWO) You have 60 seconds to choose one of the following: $+($sqt($hget(rps,opts)),.) Syntax: /notice $me [!choicehere]
.timer.rps.one.timeout 1 40 .notice $hget(rps,ONE) 20 seconds left.
.timer.rps.two.timeout 1 40 .notice $hget(rps,TWO) 20 seconds left.
.timer.rps.one.ftimeout 1 60 rps.timeout 2 one
.timer.rps.two.ftimeout 1 60 rps.timeout 2 two
}
alias -l rps.decline {
if ($hget(rps,progress) != 1) rps.out msg unknown rps.decline was triggered and RPS is not in challenge mode
if ($hget(rps,TWO) == $me) rps.out msg unknown rps.decline was triggered during a bot play scenario
msg $chan $nick has declined $+($hget(rps,ONE),'s) 'Rock, Paper, Scissors' challenge.
rps.reset
}
alias -l rps.timeout {
if ($1 == 1) { msg $hget(rps,chan) $+($hget(rps,ONE),:) $hget(rps,TWO) doesn't appear to be here right now. Try challenging them later, or challenge someone else. | rps.reset }
if ($1 == 2) {
msg $hget(rps,chan) You took far too long, $+($hget(rps,$2),.)
if (!$hget(rps,$remove(onetwo.opt,$2))) msg $hget(rps,chan) You took far too long, $+($hget(rps,$remove(onetwo,$2)),.)
rps.send.result
}
}
alias -l rps.win {
if ($1 == $2) return 3
if (!$1) return two
if (!$2) return one
if ($istok($hget(rps,$+(results.,$findtok($hget(rps,opts),$1,1,32))),$2,46)) return one
else return two
}
alias -l rps.result {
var %i $rps.win($1,$2)
if (!$1) || (!$2) return
if (%i == one) {
var %r $hget(rps,$+(results.,$findtok($hget(rps,opts),$1,1,32)))
return $gettok(%r,$calc($findtok(%r,$2,1,46) +1),46)
}
if (%i == two) {
var %r $hget(rps,$+(results.,$findtok($hget(rps,opts),$2,1,32)))
return $gettok(%r,$calc($findtok(%r,$1,1,46) +1),46)
}
}
alias -l rps.send.result {
if ($hget(rps,one.opt)) && ($hget(rps,two.opt)) msg $hget(rps,chan) $hget(rps,ONE) chose $hget(rps,one.opt) - $hget(rps,TWO) chose $+($hget(rps,two.opt),.)
if ($rps.win($hget(rps,one.opt),$hget(rps,two.opt)) == 3) {
msg $hget(rps,chan) This game ends in a draw! We all know, here in $+($hget(rps,chan),$chr(44)) there are no losers.
if ($hget(rps,rounds)) msg $hget(rps,chan) Score: $hget(rps,one.wins) - $hget(rps,two.wins) $+ $iif($hget(rps,one.wins) != $hget(rps,two.wins),$iif($hget(rps,one.wins) > $hget(rps,two.wins),$chr(44) $hget(rps,ONE) $iif($hget(rps,one.wins) >= $hget(rps,rounds),wins!,leading.),$chr(44) $hget(rps,TWO) $iif($hget(rps,two.wins) >= $hget(rps,rounds),wins!,leading.)))
}
else {
if ($hget(rps,$rps.win($hget(rps,one.opt),$hget(rps,two.opt))) == $me) msg $hget(rps,chan) Sorry $+($hget(rps,$remove(ONETWO,$rps.win($hget(rps,one.opt),$hget(rps,two.opt)))),$chr(44)) $iif($rps.result($hget(rps,one.opt),$hget(rps,two.opt)),$+($v1,!))
else msg $hget(rps,chan) Congratulations $+($hget(rps,$rps.win($hget(rps,one.opt),$hget(rps,two.opt))),!!) $iif($rps.result($hget(rps,one.opt),$hget(rps,two.opt)),$+($v1,!))
if ($hget(rps,rounds)) {
hinc rps $+($rps.win($hget(rps,one.opt),$hget(rps,two.opt)),.wins)
msg $hget(rps,chan) Score: $hget(rps,one.wins) - $hget(rps,two.wins) $+ $iif($hget(rps,one.wins) != $hget(rps,two.wins),$iif($hget(rps,one.wins) > $hget(rps,two.wins),$chr(44) $hget(rps,ONE) $iif($hget(rps,one.wins) >= $hget(rps,rounds),wins!,leading.),$chr(44) $hget(rps,TWO) $iif($hget(rps,two.wins) >= $hget(rps,rounds),wins!,leading.)))
}
}
if ($calc($hget(rps,rounds) - $hget(rps,one.wins)) < 1) || ($calc($hget(rps,rounds) - $hget(rps,two.wins)) < 1) { echo -ag No more rounds. | rps.reset }
else rps.rematch
}
alias rps.reset {
hdel rps progress
hdel -w rps ONE*
hdel -w rps TWO*
hdel rps chan
hdel rps rounds
.timer.rps.* off
}

Comments

Sign in to comment.
Pangaea   -  Jul 15, 2011
why would you load this in a remote with other scripts? why not load it in a new remote. that should take care of the problem.
nappa, i think he was refaring to his list or currently running remote scripts.. when he loaded this one, any other ones that where below the stack went missing or had been somehow unloaded. I dont think he litterly meant pasting the code into an already loaded remote script.
I know exactly what he meant because this also happened to me using some scripts in the past, i cant remember which ones they where, but i seem to remember one being a rps related game.
 Respond  
UrZTruly   -  Jun 14, 2010
LOL @ blackvenomm666 .... Aint that the truth ! N E Wayz Nice Script NIGathan !!!
 Respond  
blackvenomm666   -  Mar 13, 2010
*napa why would you load this in a remote with other scripts?* meh noob mistake haha:)
 Respond  
napa182   -  Mar 12, 2010
why would you load this in a remote with other scripts? why not load it in a new remote. that should take care of the problem.

when you use a snippet that uses " on *:TEXT:*:#: { " you want it in it's own remote....
 Respond  
NIGathan   -  Mar 11, 2010
Sounds to me like you dont know how to install a script properly..
Either that, or you both are using a very horribly scripted theme engine or main script. Take wIRC or NNS, for example.
 Respond  
Pangaea   -  Jan 13, 2010
Etalyx funny you mention that, ive noticed that in one or two rps games.. not sure if one of them was this script, but It took me days to reload and re-confgure a whole multitute of scripts after installing a few rps games, since then ive learnt my lesson and stay well away from any rps games
 Respond  
Etalyx   -  Jul 03, 2009
Is there something in this script that would render any scripts below it in script editor as not working? For some reason if I have multiple scripts for example, and this is the first one, none of the ones below it function anymore. Thanks for any help :D
 Respond  
NIGathan   -  Apr 23, 2009
I didnt port this to mSL, I originally wrote it for mSL, ported that version to C++, but made major modifications and completely changed how it worked, then I liked how it turned out so much, I ported it back to mSL

Edit: And thanks :D
 Respond  
killwithme   -  Apr 23, 2009
great one!
i've seen this version of rps a while ago and now you ported it to MSL,

i'm going to port this to my php bot ;)
 Respond  
Aucun50   -  Apr 02, 2009
That's crazy :O

Nice Script btw
 Respond  
NIGathan   -  Apr 02, 2009
lol, np, glad you got it :D
 Respond  
Purplebeard   -  Apr 02, 2009
ty sorry for being such a pain xD finally got it to work
 Respond  
NIGathan   -  Apr 02, 2009
@ Purplebeard "if one person logs off the game never ends"
Please read the description, I gave instructions how ro reset it, if necessary..
"you can use the /rps.reset command to manually reset all values."

And Im not sure what to tell you about it stoping all PM's, a halt in a ^ prefixed event shouldnt haltdef, but only halt. And the only time it haltdef's is if the notice was from a user playing and contained their choice.
 Respond  
NIGathan   -  Apr 01, 2009
ROFL :D
 Respond  
Kirby   -  Apr 01, 2009
<@Neptune> this is teh decider
-> -DUMB_BOT- cockroach
-DUMB_BOT- You have chosen cockroach.
<@DUMB_BOT> Neptune chose dragon - Kirby chose cockroach.
<@DUMB_BOT> Congratulations Kirby!! Cockroach eats eggs of dragon!
<@DUMB_BOT> Score: 0 - 1, Kirby leading.
<@Neptune> !@#$%^
-DUMB_BOT- You have 60 seconds to choose one of the following: 'gun dynamite nuke lightning devil dragon alien water bowl air axe scissors fire sun rock tree man woman monkey snake moon paper sponge wolf cockroach'. Syntax: /notice DUMB_BOT [!choicehere]
-> -DUMB_BOT- cockroach
-DUMB_BOT- You have chosen cockroach.
<@DUMB_BOT> Neptune chose paper - Kirby chose cockroach.
<@DUMB_BOT> Congratulations Kirby!! Cockroach nests between papers!
<@DUMB_BOT> Score: 0 - 2, Kirby leading.
<@Neptune> :|
-DUMB_BOT- You have 60 seconds to choose one of the following: 'gun dynamite nuke lightning devil dragon alien water bowl air axe scissors fire sun rock tree man woman monkey snake moon paper sponge wolf cockroach'. Syntax: /notice DUMB_BOT [!choicehere]
-> -DUMB_BOT- !cockroach
<@Neptune> !@#$
<@Blitzjager> xD
<@Neptune> no
<@Neptune> dont
-DUMB_BOT- You have chosen cockroach.
<@DUMB_BOT> Neptune chose nuke - Kirby chose cockroach.
<@Blitzjager> He wont pick it three times
<@Blitzjager> nuke him
<@DUMB_BOT> Congratulations Kirby!! Cockroach survives nuke!
<@Blitzjager> LOL
<@DUMB_BOT> Score: 0 - 3, Kirby wins!
<@Neptune> ..
<@Neptune> !@#$%^Y&*()_+

Best game EVER NIG!
9.0 from me. :D
 Respond  
NIGathan   -  Apr 01, 2009
Type:
/unload -rs <location of script>
/load -rs <location of script>

But do not use /reload, that doesnt trigger initialization events.

Or go into the script editor, and view this script, and File->Unload, then File->Load, and find the same file.

And ya, I didnt add any of that just yet, but I plan to
 Respond  
Purplebeard   -  Apr 01, 2009
whatta mean load it again? i tried disconnecting then reconnecting the bot.. didn't work

all notices and yes please on the on off switch and a !forfeit function becuase if one person logs off the game never ends
 Respond  
NIGathan   -  Apr 01, 2009
Unload the script, and load it again, to recreate the hash table.

And you cant see all notices? Or just notices when someone makes a choice?

I purposefully made it hide the notices when someone makes a decision, so the bot owner cant cheat :P

I could add an on/off switch for that
 Respond  
Purplebeard   -  Apr 01, 2009
also a !stop (or !forfeit) feature would be good

so we can end the game even if all rounds are not up


and why can't i see notices to my bot? can you put an on/off switch on that?
 Respond  
Purplebeard   -  Apr 01, 2009
wow made it not like 4000 lines either

very nice

but i seem to be having a problem

-Purpbot- You have 60 seconds to choose one of the following: ''. Syntax: /notice Purpbot [!choicehere]
-> -Purpbot- !man
-Purpbot- 'man' is not a valid request, choose one of the following: ""


there are no options and it accepts no options
 Respond  
NIGathan   -  Apr 01, 2009
rofl, your just a sore loser :P

And haha, I would never attempt to play this game irl, it would take too long just for the countdown where you say ever choice before you decide..

"devil"
"woman"
"dragon"
"nuke"
"...We already said nuke"
"ffs, why do you think rock, paper, scissors didnt have more choices to begin with?!"
"People were lazy?"
...wow, I just had a conversation with myself... I should probably sleep.. Ya, sleeping could be a good idea..
 Respond  
Blitzjager   -  Apr 01, 2009
It's good but I'm still not completely convinced it isn't rigged.

Good luck remembering all the hand signs and what beats what in real life lol.
 Respond  
NIGathan   -  Apr 01, 2009
Ya, just have an on START and on EXIT event to /hload and /hsave respectively.
 Respond  
ProIcons   -  Apr 01, 2009
Well the hash tables seems Easy. but when i restart mirc i Thing they are lost.
 Respond  
NIGathan   -  Apr 01, 2009
lol, Ill check em out, just commented on your greet script, btw
 Respond  
ProIcons   -  Apr 01, 2009
ah i have post 2 snippets look at them (LOl)
 Respond  
ProIcons   -  Apr 01, 2009
I don't know but it was late. maybe lag fault. 9/10 last
 Respond  
NIGathan   -  Apr 01, 2009
I would rather you try it and rate it a 0 than not try it at all and give me a 10..
 Respond  
ProIcons   -  Apr 01, 2009
Well i have no time to play it but i give you a 5/10
 Respond  
NIGathan   -  Apr 01, 2009
They're both games, but look at the rating of that one D:

I couldnt post it there.. Too many people randomly rated horribly without explanation :/

If a post should be deleted, please delete the old one instead of this one.
 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.