mIRC Simple Dice Game
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | Aug 30, 2009 |
| Last Updated | Aug 30, 2009 |
| Tags | dice game mirc script simple |
Introduction
How it works: You type !dice to activate it and once the person is voiced they can type !roll to roll the correct number and play until they get it right. There is also a !endgame command.
How to activate it: First, place this script in remote, and then change if ($me == YOURBOT) { to the name of your bot!
That's about it for this script. Hope you enjoy playing !dice. =]
~ Wariopower
~ This script was made by Wariopower at #WarizardWorks on irc.purplesurge.com ~
mIRC Snippet:
mIRC Simple Dice Game
Posted on Aug 30, 2009 8:21 pm
Posted on Aug 30, 2009 8:21 pm
| Code: |
on *:load: { set %BotNick $$?="Botnick?" } on *:text:!dice:#: { if ($me == %BotNick) { if (!%die.*) { set %die.object $r(1,6) set %playernick $nick .timer 1 1 mode $chan +mv $nick .timer 1 2 msg $chan Hey $nick $+ , to win the game you much roll a %die.object $+ . Type !roll to roll the die. halt } } } on *:text:!roll:#: { if ($nick == %playernick) { set %die.player $r(1,6) .timer 1 1 msg $chan %playernick rolled a %die.player and.... if (%die.player == %die.object) { .timer 1 2 msg $chan %playernick won! Congrats. | unset %playernick | unset %die.* | mode $chan -mv $nick | halt } else { .timer 1 2 msg $chan %playernick lost. Oh well, better luck next time! mode $chan -mv $nick unset %die.* unset %playernick halt } } } |
That's how I did mine >_>
mIRC Snippet:
mIRC Simple Dice Game
Posted on Aug 30, 2009 8:25 pm
Posted on Aug 30, 2009 8:25 pm
Cool, I like your setup. I think I'll explore with more variables next time as well! Glad to see that someone was interested in this script. =]
~ Wariopower
~ Wariopower
mIRC Snippet:
mIRC Simple Dice Game
Posted on Aug 30, 2009 8:27 pm
Posted on Aug 30, 2009 8:27 pm
on *:text:!dice:#:{ var %d = $r(1,6), %w = $r(1,6) | msg # To win you need to roll a %w $+ . | msg # You rolled a %d $+ . $iif(%d == %w,You won,You lost) }
That is how I did mine
That is how I did mine
mIRC Snippet:
mIRC Simple Dice Game
Posted on Aug 30, 2009 11:06 pm
Posted on Aug 30, 2009 11:06 pm
Warizardworks, nice work. But instead of using multiple text events, you can use goto loop for your script:
And you don't need global variable. The local one will work fine.
| Code: |
| on *:TEXT:!*:#: { if ($me == YOURBOT) { var %x = $1 | goto %x :!dice .timer 1 1 mode $chan +m .timer 1 2 mode $chan +v $nick .timer 1 4 msg $chan Hey $nick $+ . To win !dice, you must roll a 6. .timer 1 5 msg $chan Type !roll to begin. halt :!roll .timer 1 1 describe $chan rolls a dice for $nick $+ ... var %dice = $rand(1,6) .timer 1 3 msg $chan You have rolled a %dice if (%dice == 6) { .timer 1 4 msg $chan You won! Congrats $nick $+ ! .timer 1 5 mode $chan -m .timer 1 6 mode $chan -v $nick .timer 1 7 msg $chan Thanks for playing !dice by Wariopower. } elseif (%dice != 6) { .timer 1 4 msg $chan Sorry $nick $+ , you did not win. Please try again. halt } :!endgame .timer 1 1 mode $chan -m .timer 1 2 mode $chan -v $nick .timer 1 4 msg $chan Thanks for playing !dice by Wariopower. halt :%x msg $chan $1 is not recognized as a command. } } |
mIRC Snippet:
mIRC Simple Dice Game
Posted on Aug 31, 2009 11:47 am
Posted on Aug 31, 2009 11:47 am
Thanks for your kind words. And cool! I might rescript this game with all of your cool ideas. Thanks guys. =]
~ Wariopower
~ Wariopower




