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











