From: Danizho
Can you explain me this?
Well, no offense to masterBB, he did it kind of silly. It could've been done easier/better. But basically it's just to check if the character is animating or not. And it checks every 200ms, which he should change to 600, as the game runs on ticks, which happen every 0.6 seconds (600ms). There is already an IsAnimating function in reflection to check for that, though.
^
http://goo.gl/pnqj if you want to read more about it. :) I think it's pretty interesting.
From: ownedlikenoob
Thanks, :D can you explain this to me though,
function F_InFight: Boolean;
var GTPA, RTPA: TPointArray;
begin
FindColorsTolerance(GTPA, 49499, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
FindColorsTolerance(RTPA, 590010, MSCX - 15, MSCY - 40, MSCX + 15, MSCY, 20);
Result := ((GetArrayLength(GTPA) + GetArrayLength(RTPA)) >= 20);
end;
It checks to find the color 49499 where one's HP bar would be, which is the green color, if I inferred that 'G' stands for 'green' and 'R' stands for 'red' correctly, and then checks for 590010, the red color. It stores those two in two different TPAs (GTPA and RTPA, respectively), and then gets the length of them (how many pixels are that color), adds them, and checks to see if those together are greater than 20 (otherwise, the HP bar wouldn't be there, because if it is there, there will always be either 20 pixels of 49499, 20 of 590010, or 20 of the sum of the colors.
Hope that helps.