PDA

View Full Version : Throwing darts



Seizer
06-03-2009, 11:40 AM
I need help getting this script to work properly. I am fairly new to writing scripts and not sure why its not cycling to throw another dart or when I hit the mark it does not cycle to the next number.

My goal is to have a script start at the triple 20, move down through all numbers on the dart board, then proceed to hit all the doubles, singles, and finally bulls.

Also I am unsure of how to code it so that it throws all three darts before gathering the darts.

Thank for the input.


counter set 20
loop:
ECHO Tossing at %c
put throw my dart at board triple %c
waitfor Aiming carefully
match hit3 and hit a triple %c
match nohit1 but miss by a mile!
matchre nohit2 /and hit (a double | a triple) %0/
match nohit3 and hit %0
matchwait
put gather dart

nohit1:
goto loop

nohit2:
goto loop

nohit3:
goto loop

hit3:
counter subtract 1
goto loop

AnticorRifling
06-03-2009, 12:07 PM
If it were me I'd make it loop so that if you got a hit or miss it'd go back to throw but when you got a "you're out of darts" message then it would go to the pickup/gather action. I never threw darts in game so I'd have to see it in action to be more help, sorry.

Donquix
06-03-2009, 12:40 PM
what arguments are you sending with this script that you're trying to match the rational expression with %0 in it? Also if i'm reading this script right, if you hit a triple 20 the next time you go it will aim at a triple 19?

How's that helpful? Unless dart rules are way different in gemstone than IRL :)

AnticorRifling
06-03-2009, 01:13 PM
Makes since if you're playing cricket.

Seizer
06-03-2009, 02:37 PM
what arguments are you sending with this script that you're trying to match the rational expression with %0 in it?

The %0 variable I thought would be any other number between 1 and 20, other than the number I was aiming for. So what variable do I use to represent any other number between 1 and 20?


Also if i'm reading this script right, if you hit a triple 20 the next time you go it will aim at a triple 19?

That is correct.
My goal is to have a script start at the triple 20, move down through all numbers on the dart board, then proceed to hit all the doubles, singles, and finally bulls.
The purpose of the script is to gain ranks in playing darts. You get ranks by hitting harder targets from what I read long ago. I realize I won't be able to gain all ranks since I need an audience, but when it comes to that point I will make do.

thefarmer
06-03-2009, 02:47 PM
anyword:
put throw my dart at board inner bullseye
wait 2
put throw my dart at board inner bullseye
wait 2
put throw my dart at board inner bullseye
wait 2
put gather blue dart
wait 2
goto anyword:

Donquix
06-03-2009, 03:10 PM
%0 sends all arguments you sent with the script.

For example, if you sent the script as ".darts 1 2 three four five" every time you put %0 the game sees "1 2 three four five" all together.

There is no stormfront script to match any, basically.

If you want to make an "else" match, basically, you need to either account for every possible outcome specifically or find a common wording. For instance...

if you wanted it to do something if you hit triple 20, and something else for anything else, and the message is "And your dart hits <mod> <location>" you could put something like...

match hit triple 20
match miss And your dart hits
put throw dart at dartboard triple 20
matchwait

if you hit triple 20 it would go to the hit label, matches are found in order. so even though the "miss" match is technically true as well, the triple 20 take priority since it was first.

Seizer
06-03-2009, 04:03 PM
Okay here it is in its rewritten state. Throws all the darts at the proper target but hangs after the third dart is thrown. I know I am missing something simple here, and thanks for the advice so far it has helped simplify the code.

counter set 20
loop:
ECHO Throwing at triple %c
put throw my dart at board triple %c
pause 4
put throw my dart at board triple %c
pause 4
put throw my dart at board triple %c
pause 4
match hit and hit a triple %c
match miss Aiming
matchwait

miss:
gather dart
goto loop

hit:
gather dart
counter subtract 1
goto loop

Menelous
06-04-2009, 01:30 AM
I've never played darts in game... can you only gather the darts when they've all been thrown? Also, I'll wait for a response to my first question before helping with corrections, but you're last script posted should loop forever which isn't what you want :)

Menelous
06-04-2009, 02:03 AM
Decided to give it a try... not as efficient as it could be seeing how I don't know the messaging. I assume you can throw dart at single # so here goes....

you'd start it with .dart triple double single
This assumes you can collect your dart after every throw. Written at work so not tested.

counter set 20
goto labelerror
loop:
Shift
counter set 20
labelerror:
Echo Tossing at %1% %c%
match hit %1% %c%
match miss A good positive
Put Throw my dart at board %1% %c%
Put yes
MATCHWAIT

hit:
Pause 4
counter subtract 1
Put gather dart
goto %c%

miss:
Pause 4
goto %c%
put gather dart

0:
if_1 GOTO Loop
Echo Tossing at bullseye
match hitbull bullseye
match missbull A good positive
Put throw my dart at board bullseye
put yes
Matchwait

Missbull:
pause 4
put gather dart
goto 0

hitbull:
Pause 4
Put gather dart
exit

Seizer
06-04-2009, 11:13 AM
I've never played darts in game... can you only gather the darts when they've all been thrown? Also, I'll wait for a response to my first question before helping with corrections, but you're last script posted should loop forever which isn't what you want :)

No you can gather them after one is thrown.

What is this reason for a variable with %1%? I've been trying to find a scripting how to list all commands, and the only thing I can come with is Simu's how to guide, which doesn't list anything like the %1%.

Will try it out an let you know.

pabstblueribbon
06-04-2009, 11:19 AM
%1 - 9 whatever are command line variables.

When a word is encapsulated with % like, %target% it recalls a saved variable that you previously saved with...

setvariable target 20

which would assign 20 to the %target% variable.

Seizer
06-04-2009, 11:35 AM
Tried out your script Menelous, and it hangs after the first dart throw.

I am assuming if I can get the one I wrote to not hang after the third dart throw it would be okay. So what is it that is causing my script to hang, the lack of a match?

pabstblueribbon
06-04-2009, 11:43 AM
Try this... its not complete.. you will have to make a similar block for every target, but it will work. Next target would of course be the next thing you throw at which would be singles: then bulls: .. im sure you can figure it out from the example.

EDIT: actually.... how may times do you have to hit the target before you've got them all? Is it three? I need more information on how the dart game is played I think. Heh..



start:
goto countertripples

math:
counter subtract 1
goto %target%

gatherdarts:
put how you get your darts
waitfor whatever text says you got your darts..
put put darts in my CONTAINER
goto %target%

countertripples:
counter set 20
goto tripples

counterdoubles:
counter set 20
goto doubles

countersingles:
counter set 20
goto singles

etc...

tripples:
setvariable target tripples
echo %c
match counterdoubles 0
put get my dart from CONTAINER
match gatherdarts Get what?
put throw my dart at board triple %c
waitfor waitfor Aiming carefully
match math and hit a triple %c
match tripples and hit a
match tripples miss by a mile
matchwait

doubles:
setvariable target doubles
echo %c <--- Echo's current target, if 0 next line will match.
match countersingles 0 <--- next throwing target counter reset. will move onto next target when your counter varaible hits 0
put get my dart from CONTAINER
match gatherdarts Get what?
put throw my dart at board double %c
waitfor waitfor Aiming carefully
match math and hit a double %c
match doubles and hit a
match doubles miss by a mile
matchwait

Seizer
06-04-2009, 12:09 PM
EDIT: actually.... how may times do you have to hit the target before you've got them all? Is it three? I need more information on how the dart game is played I think. Heh..

I only need to hit it once before I move on to the next number.

pabstblueribbon
06-04-2009, 12:10 PM
Updated it. I think thats what you want. That will start out with throwing at tripple 20 - 1 and when it hits zero will move to doubles and repeat. Then singles... how many times do you want to hit the bullseye?

Fuck it i'll just finish it if you give the the text for missing your target, getting your darts, removing them from the board.

Menelous
06-04-2009, 04:31 PM
Any chance you could post a small log of you playing? Seems quite a few of us have never played and could use some messaging. :)

Seizer
06-06-2009, 01:16 PM
Yeah I can paste a log, will try an get the misses and bulls.

Thank for the help.

Gibreficul
06-06-2009, 06:13 PM
Two questions....

FIrst: Where do you get a set of darts?

Second: Where is there a dartboard to practice? Namely on Teras or IFW?


Gibreficul, future Gemstone Darts CHAMPION!

PS, I'll write a Lich script to play darts. SF scripts are so 1992.

Seizer
06-06-2009, 11:54 PM
Two questions....
FIrst: Where do you get a set of darts?

I got mine in Mist Harbor used to be a dart wagon, of course its gone now.


Second: Where is there a dartboard to practice? Namely on Teras or IFW?

Teras, I think at the Whining Elf, unconfirmed having human characters not allowed in the other room.
Mist Harbor in the dart wagon that is now gone.

Seizer
06-07-2009, 12:10 AM
Hectic day, so here's the log.

You grab a dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and hit 15!
Roundtime: 4 sec.
R>throw my dart at board double bull
You grab a dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and hit 14!
Roundtime: 4 sec.
R>throw my dart at board double bull
You grab the dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and hit 10!
Roundtime: 4 sec.
R>gather dart
...wait 1 seconds.
R>gather dart
You gather up three carved bamboo darts.
>throw my dart at board double bull
You grab a dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and hit 15!
Roundtime: 4 sec.
R>throw my dart at board double bull
You grab a dart from your left hand.
Aha, you learned something that time.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and hit 16!
Roundtime: 4 sec.
R>throw my dart at board double bull
You grab the dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, and nail the **Double Bull**! 50 points!
Roundtime: 4 sec.
R>gather dart
You gather up three carved bamboo darts.
>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 5!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 3!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab the dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 18!
Roundtime: 4 sec.
R>gather dart
You gather up three carved bamboo darts.
>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit a triple 1!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 5!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab the dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit a triple 1!
Roundtime: 4 sec.
R>gather dart
You gather up three carved bamboo darts.
>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 13!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 5!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab the dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 20!
Roundtime: 4 sec.
R>gather dart
You gather up three carved bamboo darts.
>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 5!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab a dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit 1!
Roundtime: 4 sec.
R>throw my dart at board triple 20
You grab the dart from your left hand.
Aiming carefully at the triple 20, you throw a carved bamboo dart at a large cherrywood dart board, and hit a double 20!
Roundtime: 4 sec.
R>gather dart
You gather up three carved bamboo darts.
You grab a dart from your left hand.
Aiming carefully at the outer bullseye, you throw a carved bamboo dart at a large cherrywood dart board, but miss by a mile! The dart tumbles clumsily through the air before bouncing to the floor.
Roundtime: 4 sec.