I'm currently developing an agility script and I'm looking for a way to check if Hp has dropped (i.e. an obstacle has been failed) from a point prior to attempting the obstacle to after the attempt.
I've been using a set up using HPPercent such that checks the hp at the start of the procedure and sets that as a variable, then attempts the obstacle and then checks for changes in Hp to indicate if the obstacle has been failed. I'm not sure what I'm doing wrong but it just doesn't seem to work and I keep getting compiling errors.
my unfinished (read: without standards) code so far:
What would be a better, more efficient, and actually workable way to do this?Code:procedure Swing; var SwingColor: integer; z: integer; //<----------Theoretically, what Hp is before an obstacle begin if FindObjTPA(x, y, SwingColor, 5, 2, 1, 20, 10, ['wing']) then begin HPPercent := z; writeln('Yay we found it'); MMouse(x, y, 1, 2); Mouse(x, y, 0, 0, True); Wait(4000+random(800)); if HPPercent < z then //<------------------if Hp drops then eat food begin Heal; end; end; end;


Reply With Quote









