Petals Around the Rose Game v1.0

By SileNTReApR on Apr 21, 2005

This game is an IRC version of the game/puzzle, Petals around the Rose.
The flash version may be located here: http://crux.baker.edu/cdavis09/roses.html

I suggest you guys try the flash version and figure out the game FIRST, before you use the script for other people. Remember, don't divulge it's secrets to anyone ;)

Functions:

1) Visuals Are Included
2) Bans user from the game if he/she gets it right 4 times in a row.
3) Automatically works out the answer, and tells the players if it's correct or not.

More will be added as I am bothered/motivated to.
As far as I have tested this, I have found no bugs but if you find any please point them out. Pointers/Suggestions are always welcome.

; Petals Around the Rose - IRC Version by SileNTReApR  (#CkMoney @ irc.irchighway.net)
; Flash version can be found here: http://crux.baker.edu/cdavis09/roses.html
; More help can also be found at that site.
;
; Version Number: v1.0
; Tested and perfected on mIRC v6.16 + SySReset 2.53 Addon.
; No idea if it will work on older versions, but *IT SHOULD*
;
; 1) To install, first open the scripts editor and click the "Remotes" tab. Or just press: Alt + R.
; 2) Go to: File > New then paste the script.
; 3) You're done. Tell the people to type !rosestart to start playing it, you won't be able to trigger it yourself, and you won't actually be able to see anything, but they will see it perfectly well. 

; Function that performs the actually rolling of the dices.
alias rosedice {
  ; Randomnizes the dices
  var %rosedice1 = $rand(1,6)
  var %rosedice2 = $rand(1,6)
  var %rosedice3 = $rand(1,6)
  var %rosedice4 = $rand(1,6)
  var %rosedice5 = $rand(1,6)
  set %rosedices %rosedice1 %rosedice2 %rosedice3 %rosedice4 %rosedice5
  ; Performs the calculation of the answer 
  set %roseresult $($calc($matchtok(%rosedices,3,0,32) * 2 + $matchtok(%rosedices,5,0,32) * 4),2)
  /sayrosedice
}

; Function that shows the visuals of the dices.
alias sayrosedice {  
  ; Static variables that makes up the various dices
  var %rdicetop1 = 1,0|0,0_____1,0| 
  var %rdicetop2 = 1,0|0,0____1,0o|
  var %rdicetop4 = 1,0|o0,0___1,0o|
  var %rdicemid1 = 1,0|0,0__1,0o0,0__1,0|
  var %rdicebot2 = 1,0|o0,0____1,0|
  ; Static variables that shows the numbers  
  var %rosenum1 = 0,0__1,0[1]0,0__
  var %rosenum2 = 0,0__1,0[2]0,0__
  var %rosenum3 = 0,0__1,0[3]0,0__
  var %rosenum4 = 0,0__1,0[4]0,0__
  var %rosenum5 = 0,0__1,0[5]0,0__
  var %rosenum6 = 0,0__1,0[6]0,0__
  .msg # $($replace($gettok(%rosedices,1-6,32),1,%rosenum1,2,%rosenum2,3,%rosenum3,4,%rosenum4,5,%rosenum5,6,%rosenum6),2)
  .msg # $($replace($gettok(%rosedices,1-6,32),1,%rdicetop1,2,%rdicetop2,3,%rdicetop2,4,%rdicetop4,5,%rdicetop4,6,%rdicetop4),2)  
  .msg # $($replace($gettok(%rosedices,1-6,32),1,%rdicemid1,2,%rdicetop1,3,%rdicemid1,4,%rdicetop1,5,%rdicemid1,6,%rdicetop4),2)
  .msg # $($replace($gettok(%rosedices,1-6,32),1,%rdicetop1,2,%rdicebot2,3,%rdicebot2,4,%rdicetop4,5,%rdicetop4,6,%rdicetop4),2)
}
on *:text:!rosestart:#:{
  if (%rosestart == 1) { .msg # 04A game has already been started! Work it out, or type !roseskip to skip, or !rosedisplay to show the dices again. | halt }
  elseif ($($+(%,roses.,$nick),2) >= 4) { .notice $nick 09Sorry, you already know how to play this game. No point in you playing anymore. }
  else { set %rosestart 1 | .msg # ~~09A Petals Around the Rose game has been started!~~ | .msg # 10Commands:04!roseskip 10to skip. 04!rosedisplay 10to show the dices again. 04!rosehelp 10for help. To answer type: 04!answer ANSWER 10e.g. 04!answer 4 | rosedice 
  }
}
on *:text:!roseskip:#:{
  if (%rosestart == 1) { .msg # 10This turn has been skipped. The answer was04 %roseresult $+ 10. | set %rosestart 0 
  }
}
on *:text:!answer*:#:{
  if (%rosestart == 1) && ($2 == %roseresult) && ($($+(%,roses.,$nick),2) < 4) { .msg # 12Congratulations,04 $nick 12got the answer! It was04 %roseresult $+ 12. Type !rosestart for a new game. | set %rosestart 0 | inc $+(%,roses.,$nick) 1 }
  elseif (%rosestart == 1) && ($2 != %roseresult) { .msg # 12Sorry, the answer was incorrect. The real answer was:04 %roseresult $+ 12. Type !rosestart for a new game. | set %rosestart 0 | unset $+(%,roses.,$nick) } {
    if ($($+(%,roses.,$nick),2) >= 4) { .msg # 11It seems04 $nick 11has got it right 4 times in a row. No point in him/her playing anymore.  
    }
  }
}
on *:TEXT:!rosehelp*:#: {
  .msg $chan All I can tell you is "The name of the game is Petals Around the Rose. The name is very important. For each roll of the dice, there is one answer, and I will tell you that answer."
}
on *:text:!rosedisplay:#:{
  if (%rosestart == 1) { /sayrosedice }
  elseif (%rosestart == 0) { .msg # 14Sorry, a game isn't currently active. So start one type: 04!rosestart14.
  }
}

Comments

Sign in to comment.
b0sse   -  Aug 30, 2009
SileNTReApR   -  Apr 27, 2005

I have edited the code with some instructions too.

 Respond  
SileNTReApR   -  Apr 27, 2005

Um. 1) Open your scripts editor and click the Remotes tab, or just press alt + r. 2) Go to: File > New > Then paste the script, and it will work. Tell the people to type !rosestart to play it. You won\'t see anything on your side but they will see it.

 Respond  
phrozen3   -  Apr 26, 2005

I dont know much about irc script/code, could you make some simple instructions on how to install this.

 Respond  
SileNTReApR   -  Apr 21, 2005

:(

 Respond  
SileNTReApR   -  Apr 21, 2005

Comments, thanks ^^

 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.