mIRC Home    About    Download    Register    News    Help

Print Thread
#133197 17/10/05 11:05 PM
Joined: Oct 2005
Posts: 6
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Oct 2005
Posts: 6
Hello all! I am new here and I am sure my question can be answered by you guys!
I have my own bot which I made a game with it. My question is I need the code that will be able to add the score one has. This may seem alot to do. I have read through many scripts however I really can't find anything that would help me. Please help me! I really need the code or script in just a matter of days! I really do appreciate it! Thanks!

Moved to Scripts & Popups

Last edited by Mentality; 18/10/05 08:41 AM.
#133198 18/10/05 01:07 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This should've been posted in the Scripts & Pop-ups forum. The easiest way for us to do what you're asking for, is to modify the code that you already have, which means that you'll have to post your current code. Please remember to use the Code Tags around your code. They make reading the code a lot easier.

#133199 18/10/05 01:03 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Hm... You wrote a game and don't know how to save the scores? Scores are the easy part of writing a game...

Anyhow, as mentioned, post your code so we can modify it as needed.


Invision Support
#Invision on irc.irchighway.net
#133200 19/10/05 12:53 AM
Joined: Oct 2005
Posts: 6
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Oct 2005
Posts: 6
Thanks for the respond! Well here is the code...

on *:TEXT:!coin:#:{
/msg $chan The "Coin Toss" game has now started! Say !heads or !tails to guess which will come next! To end this game type in !end .
/describe $chan Makes the first toss is a Tails! What will come next?
}
on *:TEXT:!heads:#:{
/set %heads $rand(1,2)
if (%heads == 1) msg $chan _3 Oops! Sorry bud! It was tails!
if (%heads == 2) msg $chan _3 Correct! You recieve a cookie!
}
on *:TEXT:!tails:#:{
/set %tails $rand(1,2)
if (%tails == 1) msg $chan _3 Oops you made a wrong choice! It was Heads!
if (%tails == 2) msg $chan _3 Correct! You recieve a cookie!
}
on *:TEXT:!end:#:{
/msg $chan The "Coin Toss" Game has called it quits by, $nick $+ , remember to try playing again! Cya!
}

^ anyway there is the code! Please respond ASAP! Thanks!

#133201 19/10/05 03:44 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:text:!coin:#:{
.msg $chan The "Coin Toss" game has now started!  Say !heads or !tails to guess which will come next!  To end the game type !end
set %toss $r(0,1)
describe $chan Makes the first toss and comes up $iif(%toss,Heads,Tails) $+ !  What will come next?
set %old.toss %toss
.enable #coin
}
#coin off
on *:text:!heads:#:{
set %toss $r(0,1)
if (%toss == %old.toss) && %toss {
msg $chan _3 Oops! Sorry bud! It was tails!
dec $+(%,points,.,$nick)
set %old.toss %toss
}
else {
msg $chan _3 Correct! You recieve a cookie
inc $+(%,points,.,$nick)
set %old.toss %toss
}
}
on *:text:!tails:#:{
set %toss $r(0,1)
if (%toss == %old.toss) && !%toss {
msg $chan _3 Oops you made a wrong choice! It was Heads!!
dec $+(%,points,.,$nick)
}
else {
msg $chan _3 Correct! You recieve a cookie
inc $+(%,points,.,$nick)
}
}
on *:text:!end:#:{
/msg $chan The "Coin Toss" Game has called it quits by, $nick $+ , remember to try playing again! Cya!
}
.disable #coin
unset %points*
on *:text:!points:#:{
.msg $nick You have $($+(%,points,.,$nick),2) points
}
#coin end


Adds a point if you guess correctly. Removes a point if you are wrong. Points get reset to zero wnen someone ends the game. You can view your points by typing !points while the game is in progress.

Modified your code a bit so that the initial toss is random, and it now checks to see if each toss matched the toss before or not.


Link Copied to Clipboard