laytya / LazyScript

22 stars 12 forks source link

Add "if time to next autoShot / autoAttack" #12

Open SoggyDiaper opened 1 year ago

SoggyDiaper commented 1 year ago

Would it be possible to add a criteria that calculates the time to the next autoShot or autoAttack?

For example, something like: slam-ifTimeToAutoAttack>2s

That would use slam if it is able to get a slam off before the next auto attack. This way, slam can be used without interrupting an auto attack.

The same could be done for hunter's autoShot, so that aimed shot would only be used if an autoShot has been done recently.

This addon does something very similar, but only for hunters: https://github.com/Geigerkind/OneButtonHunter

Thanks :D

SoggyDiaper commented 1 year ago

Oh and another one that I think would be really useful is

-ifCurrentForm=

With that, you could do some really cool things combined with the existing "setForm="

Thanks again :D

laytya commented 1 year ago

show me what u want to make... not really understand

SoggyDiaper commented 1 year ago

show me what u want to make... not really understand

Auto attacks use a swing timer. It works like a cooldown between attacks. This addon ( https://github.com/Geigerkind/OneButtonHunter ) can calculate the time between ranged attacks for the hunter's Auto Shot ability, and can use abilities like aimed shot or multi-shot if they do not conflict with the auto shot.

If a hunter has a ranged weapon that has an attack speed of 3.2 seconds, the addon above will check when the last Auto Shot happened. I think LazyScript would be better if it had this feature. I believe the syntax could be something like "-ifLastAutoShot>2s" or "-ifLastAutoAttack>2s"

Also, LazyScript has a "current form", which is the form that is used when /lazyscript is used. I think LazyScript would be better if it had a condition where it checks what the current active form is.

laytya commented 1 year ago

any examples of using "current form"?

about catching autoattacks - its a lot of code, mb you know some lib for it?

SoggyDiaper commented 1 year ago

The "current form" is the one that is selected either with the GUI or with the action setForm=[form]. I think LazyScript would be better if it had another condition which checks what the current form is. For example, "ifCurrentForm=Form1-heroicStrike"

No idea about the autoattacks, sorry. Other than the code of the OneButtonHunter

laytya commented 1 year ago

for warriors there are criteria "-ifStance" i just wonder why we need such criteria for druids? example macro: Shield Bash: /run -- CastSpellByName("Shield Bash") /ls do battle-ifStance=berserk shieldBash

or Overpower: /run -- CastSpellByName("Overpower") /ls do battle-ifNotStance=battle overpower

SoggyDiaper commented 1 year ago

"Forms" are the name given to LazyScript scripts. I do not mean Druid forms.

https://github.com/search?q=repo%3Alaytya%2FLazyScript%20form&type=code

laytya commented 1 year ago

ah i see... same question - why we need it?

SoggyDiaper commented 1 year ago

"ifCurrentForm=" would be very useful for warriors in this example...

FormBattle has the code "setForm=FormBattle"

FormBerserk has the code "setForm=FormBerserk"

FormAttack has the code "battle-ifUsable=overpower-ifStance=berserk,defensive overpower berserk-ifCurrentForm=FormBerserk"

That way, by using FormBattle and FormBerserk, you can change the current active form to themselves respectively, and you can basically tell Lazyscript which is your preferred stance at any given time.

SoggyDiaper commented 1 year ago

ah i see... same question - why we need it?

And "-ifTimeToAutoAttack>Xs" and "-ifTimeToAutoShot>Xs" are useful for using abilities between swing/shoot timers, such as slam, multishot, and aimed shot