Scripting Help
frugs
Member Posts: 2
Attempting to write a simple AI script for my bard which will allow him play his bard song just before the end of round, whilst attacking his nearest enemy for the rest of it. Unfortunately, my code doesn't seem to behave as expected.
Can someone take a look and tell me what I'm doing wrong?
Can someone take a look and tell me what I'm doing wrong?
// Bard song every round
IF
HotKey(A)
Global("attack_n_sing_toggle", "LOCALS", 1)
THEN
RESPONSE #100
SetGlobal("attack_n_sing_toggle", "LOCALS", 0)
END
IF
HotKey(A)
Global("attack_n_sing_toggle", "LOCALS", 0)
THEN
RESPONSE #100
SetGlobal("attack_n_sing_toggle", "LOCALS", 1)
AttackOneRound(NearestEnemyOf(Myself))
Continue()
END
IF
Global("attack_n_sing_toggle", "LOCALS", 1)
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself), 85)
BattleSong()
END
0
Comments
I've updated it so that there's an extra flag for determining whether the first round of attacking has completed, but I'm finding that the script seems to desync from the round timer if my character has to move around between attacks.