SF Script and matchwait or wait or how do I wait for RT 03/07/2017 07:20 PM CST
I wrote a little script that's for shooting arrows. Goes like this:

put stance offensive
put get one arrow
put fire


I am trying to make it see the RT and then PUT STANCE DEFENSIVE

Can't remember how to use matchwait or wait.
Reply
Re: SF Script and matchwait or wait or how do I wait for RT 03/07/2017 07:27 PM CST
Here is a skinning script I use that has some good macro language examples in it (including match/matchwait)



#Skin
#assumes user7 is skinning knife
#assumes user8 is container for skinning knife
#assumes user9 is preferred stance

if_1 goto START
echo SYNTAX: .skin <critter1> <critter2> etc.
echo VARIABLES used
echo

echo user7 (skinning knife): %user7
echo user8 (knife container): %user8
echo user9 (preferred stance): %user9
echo weapon: %weapon
echo sheath: %sheath
exit

START:

match CHECKSKINNING Ranger Base
match SKINSOMETHING No spells found.
match SKINSOMETHING You can view your
put spell
matchwait

CHECKSKINNING:

match SKINSOMETHING skinning
match CASTSKINNING Mobility
put spell active
matchwait

CASTSKINNINGWAIT:
pause 1

CASTSKINNING:

match SKINSOMETHING You feel more nimble
match SKINSOMETHING You do not know that spell!
match CASTSKINNINGWAIT Spell Hindrance
match CASTSKINNINGWAIT ...wait
put incant skinning
matchwait

SKINSOMETHINGWAIT:
pause 1

SKINSOMETHING:

match KNEEL You are now in
match KNEEL Setting stance to
match SKINSOMETHINGWAIT ...wait
put stance %user9
matchwait

KNEELWAIT:
pause 1

KNEEL:

match STOWWEAPON You kneel down.
match STOWWEAPON You are already kneeling.
match KNEELWAIT ...wait
put kneel
matchwait

STOWWEAPON:

match GETKNIFE You put
match GETKNIFE You slip
match GETKNIFE You slide
match GETKNIFE You wear
match GETKNIFE You carefully
match GETKNIFE I could not find
put put %weapon in my %sheath
matchwait

GETKNIFE:

match LOOP You remove
match LOOP You slip
match LOOP You draw
match LOOP You sling
match LOOP You deftly remove
put get %user7 from my %user8
matchwait

LOOP:

match SEARCH You skinned
match SEARCH You botched the job.
match SEARCH You can only skin creatures
match SEARCH You cannot skin
match END You might want to wait until after
put skin %1
matchwait

SEARCH:

match SUCCESS search the
match FAILURE What were you referring to?
match FAILURE You might want to wait
match FAILURE Not a good time
match FAILURE Try looking in
put search %1
matchwait

FAILURE:
goto END

SUCCESS:
shift
if_1 goto LOOP
goto END

END:
put put %user7 in my %user8

match STAND You remove
match STAND You slip
match STAND You draw
match STAND You sling
match STAND You deftly remove
match STAND Get what?
put get %weapon from my %sheath
matchwait

STAND:
put stand



-- Robert

A powerful whirlpool is suddenly overtaken by a windy vortex!
Reply
Re: SF Script and matchwait or wait or how do I wait for RT 03/07/2017 09:46 PM CST
Just to keep it simple for the script you have started.


put get one arrow
put stance offensive
put fire

STANCE:
pause 1
match STANCE ...wait
match END You are now in a defensive stance
put STANCE DEF
matchwait

END:
exit


Hope that helps. I add a pause to slow down the potential screen scroll.

~Contemplar~
Reply
Re: SF Script and matchwait or wait or how do I wait for RT 03/08/2017 12:08 PM CST
SF scripts are supposed to wait for RT automatically before putting the next command, but they get it wrong by a second from time to time so you do need a method to trap it. Normally my method is just to watch the script running and react manually when it glitches.
Reply
Re: SF Script and matchwait or wait or how do I wait for RT 03/08/2017 06:00 PM CST
Thanks all. It helps. I'll use your ideas and keep tinkering with scripts.
Reply
Re: SF Script and matchwait or wait or how do I wait for RT 03/08/2017 06:49 PM CST
>> SF scripts are supposed to wait for RT automatically before putting the next command, but they get it wrong by a second from time to time so you do need a method to trap it.

I try and trap those by watching for ...wait and then sending it to a statement that pauses for 1 second and then retries the action.

e.g. match SKINSOMETHINGWAIT ...wait

-- Robert

A powerful whirlpool is suddenly overtaken by a windy vortex!
Reply