Dice game

By APinis on Feb 11, 2007

This is simple dice game in wich you can compete with other people. Just copy and paste it in your remotes (Alt+R) and type !roll
Let the best man win!

Have fun!

on *:TEXT:!roll*:#:{
  if (%dice == on) {
  /notice $nick 6 Game is already in progress.
  halt
}
  /set %dicedplayer1 $nick
  /set %dice on
  /msg $chan 6 %dicedplayer1 has began the game and you have 30 seconds to write !join
  /timer72 1 30 /msg $chan 6SOrry, %dicedplayer1 nobody joined your game!
  /timer73 1 30 /unset %dice*
}
on *:TEXT:!join:#:{
  if ($nick == %dicedplayer1) {
    /notice $nick 6 You can`t play with yourself.
    halt
}
  if (%dice == $null) {
    /notice $nick 6 Game hasn`t been started yet! Type !dice to start the game.
    halt
}
  /timer72 off
  /timer73 off
  goto next 
  :next
  /set %dicedplayer2 $nick
  /set %diceplayer1num $rand(1,6)
  /set %diceplayer2num $rand(1,6)
  /msg $chan 6 GamE has been started...
  /msg $chan 6 $+ %dicedplayer1 $+ 's rolls ---> %diceplayer1num 
  /msg $chan 6 $+ %dicedplayer2 $+ 's rolls ---> %diceplayer2num 
}  
  if (%diceplayer1num > %diceplayer2num) {
    /msg $chan 4 $+ %dicedplayer1 Has won!!!
    /unset %dice*
    halt
}
  if (%diceplayer1num == %diceplayer2num) {
    /msg $chan 6 It`s a tie. ROll again!
    goto next
}

Comments

Sign in to comment.
Riki   -  Jan 10, 2012

Yes sir. The question went unanswered and the script still some-what works. Lol. :p

 Respond  
blackvenomm666   -  Jan 10, 2012

hahahahaha omfg only 5 years later to reply to that comment

 Respond  
Riki   -  Jan 10, 2012

You can type "/set %dice off" to end a game.

 Respond  
Conipto   -  Mar 09, 2007

How do I continue or end a game?

 Respond  
Lindrian   -  Feb 13, 2007

would be appriciated if the author himself tried it....

 Respond  
A*1*T*E*A*M   -  Feb 12, 2007

okey...I didnt test it yet. I can test later :D

 Respond  
Lindrian   -  Feb 12, 2007

Although, since the trigget (text event) is set as !* it will trigger on all events made with ! in the channel, either change the main trigger or set it 1 specefic channel. and you could always add an help event,

on *:TEXT:!help:#: {
.notice $nick
}

Just to make it clear for the users ;p. So they wont ask you guys hehe.

have fun & i hope the script I made above works now.

 Respond  
A*1*T*E*A*M   -  Feb 12, 2007

Okey Lindrian I will test it :D

 Respond  
Lindrian   -  Feb 12, 2007

Okay, I did some \"fixes\" dunno if it\'ll work, I made it quickly, u can test it yourself :p..

;-------------------------------------
;here it is:
on :TEXT:!:#:{
;i\'ve set em all into 1 text event, looks better.
if ($2 == roll) && ($3 == on) {
if (%dice == on) {
.notice $nick 6 Game is already in progress.
goto end
;added an \'goto end\' loop instead of halt.
}
if ($2 == roll) && ($3 == off) {
;the 2 statements in the if statement is due to the way i\'ve set the text ;event up.
if (%dice == off) {
.notice $nick The game is already disabled.
goto end
}
else {
set %dice off
.notice $nick the game is now disabled.
goto end
}
else {
set %dicedplayer1 $nick
set %dice on
msg $chan 6 %dicedplayer1 has began the game and you have 30 seconds to write !join
.timer72 1 30 msg $chan 6SOrry, %dicedplayer1 nobody joined your game!
.timer73 1 30 unset %dice | goto end
;i\'ve also put . infront of timers & notices, to make them \'silent\'.
}
}
elseif ($2 == join) {
if ($nick == %dicedplayer1) {
.notice $nick 6 You cant play with yourself. goto end } } elseif (%dice == $null) { .notice $nick 6 Game hasnt been started yet! Type !dice to start the game.
goto end
}
else {
;added an else statement here and above, to make the event get executed.
.timer72 off
.timer73 off
goto next
:next
set %dicedplayer2 $nick
set %diceplayer1num $rand(1,6)
set %diceplayer2num $rand(1,6)
msg $chan 6 Game has been started...
msg $chan 6 $+ %dicedplayer1 $+ \'s rolls ---> %diceplayer1num
msg $chan 6 $+ %dicedplayer2 $+ \'s rolls ---> %diceplayer2num
}
if (%diceplayer1num > %diceplayer2num) {
msg $chan 4 $+ %dicedplayer1 won!
unset %dice

goto end
}
if (%diceplayer1num < %diceplayer2num) {
msg $chan 4 $+ %dicedplayer2 won!
unset %dice*
goto end
;also added this line, so the player number 2 can win aswell.
}
if (%diceplayer1num == %diceplayer2num) {
msg $chan 6 It`s a tie. ROll again!
goto next
}
:end
;and here\'s the ending loop.
}
}

;----------------------------

Enjoy! And feel free to fix any of the bugs u might find! We\'re both here to learn after all!

 Respond  
Lindrian   -  Feb 12, 2007

I think the author needs to fix a few minor things, maybe a few more if, else, elseif statements where they\'re needed.

 Respond  
A*1*T*E*A*M   -  Feb 12, 2007

That wont work on ma script :S

 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.