Help with variables and/or counters - script <SF> 02/05/2014 09:13 AM CST
Ok, now that I'm getting used to Stormfront a bit more, as a longtime wizard user --
I'm trying to incorporate a bit of the new options for my scripts.

I have one in particular <for my MM>, where, in the wizard I had 2 different scripts for TM. They are identical, except that one uses PD and the other uses DO to train TM.

What I would like to do is either use variables or counters <or both?> to switch from one spell to the other spell, using a match inbetween for if the critter is dead <which I already have the necessary string>.

Trying to figure it out from Damians "training" script on epedia is like trying to understand brain surgery - its a bit beyond me :-). So is the explanation on variables. I just want a short and sweet that I can figure out how to incorporate. :-). Baby steps, ya know?


<<If I can't cast thunderclap, you can't summon the dark lord of the abyss to devour the flesh of the innocent>>
Reply
Re: Help with variables and/or counters - script <SF> 02/05/2014 11:10 AM CST


to start your script .target <variable#1> i.e. .scripting babysteps

babysteps will be put into your %1 variable slot

now you can do one of two things. You can write your script to use %1 or you can create a new variable. each has pros and cons.

if you don't want to create a new variable.. write your script to cast by using "Put prep %1 30" or whatever, replace the spell with %1.

If you want to write it to a new variable, the at the top of your script:

setvariable <variablename> %1

or using our example

setvariable babysteps %1

then in the script, you'll not use %1 but %babysteps

so it'd look like "Put prep %babysteps 30"

as an extra fun bit you get up to 9 variables that way. so you can do something like

.spell <spellName1> <spellName2> <mana1> <mana2> <collectOption> <juggleItem>

and write a script out to use spellName1 @ mana1 to lock, then switch to spellName2 @ mana2 to lock, then collect collectOption, then juggle juggleItem.. then start all over.

I don't recommend looping scripts without some sort of exit (mind lock) because you never know what could happens and getting popped for afk scripting is never a good time.


hope that helps!
Reply
Re: Help with variables and/or counters - script <SF> 02/05/2014 11:10 AM CST
Sure, here's the basic outline. You'll want to flesh it out more, or just modify the one you have, but it shows how to use goto to do what you want.


setvariable spell PD
setvariable manaLevel 30

TARGET:
put target %spell %manaLevel
waitfor Your formation of a targeting pattern

match DEADCRITTER <critter death message>
match TARGET Roundtime
put cast
matchwait

DEADCRITER:
<skin and loot and do other stuff>
goto CHANGE-FROM-%spell

CHANGE-FROM-PD
setvariable spell DO
goto TARGET

CHANGE-FROM-DO:
setvariable spell PD
goto TARGET
Reply