Masuzu / SarasaBot

A GBF bot for automated raid farming with scriptable behaviour
https://gbtools.azurewebsites.net/SarasaBot/en/Home
27 stars 4 forks source link

[2.10.1] Bot can't do loops/ifs with hp % trigger. #298

Closed devvah closed 4 years ago

devvah commented 4 years ago

I have tried everything I could but bot either does react to enemy_1.hp_percentage once or just plainly ignores it forever.

For example

if enemy_1.hp_percentage > 40 then
 Wait(2000) [I have tried variant with Refresh() too)
 else
 Summon(6)
end

Bot will check if statement only once and instead of looping back to it since next once requires turn 2 and there's nothing after it will straight out skip it and perform attack to proceed turn.

It gets even funnier when loops are employed

while(enemy_1.hp_percentage > 40)
do
   Wait(2000)
end
Summon(6)

or

repeat
   Wait(2000)
until(enemy_1.hp_percentage > 40)

Will result in permanent waiting loops.

So I'm at wits end, I tried to make water kengo setup for grimnir since it's my only way to farm him but it seems there's no way to make bot wait to 40% hp before attacking.

If it's not possible to bot to constantly monitor hp could you make bot check boss hp after commands Wait and Refresh or simply additional command to force hp check?

ramblinguy commented 4 years ago

I remember in other threads that the bot specifically only checks at the beginning of each turn. However, there is a SkipAttack() function, not sure if that would do what you're looking for, but it's worth a shot. https://github.com/Masuzu/ZooeyBot/blob/master/Scripts/do_nothing.lua

Masuzu commented 4 years ago

Acknowledged. A solution for this exists and will be released this week-end https://discordapp.com/invite/JaNR87n

Masuzu commented 4 years ago

A quick update on this. At the moment you can actually do so by using the Refresh command to reload the page (that is also a reliable way to get updated status effects, and to check if enemies are in break/overdrive modes). Wrapping it in a loop to wait for the boss to get below a certain hp percentage would do the trick. It does not matter if the battle ends during the Refresh, that case is handled already. However I am aware this may not be the best option due to ping.