So many un-necessary things in both those functions...
Simba Code:
function InCombat :boolean; //TimeLastClick and DTM must be script specific vars
var
x,y : integer;
begin
while TimeFromMark(TimeLastClick) < 60000) do //make roughly time to kill npc
begin
if not (GetCurrentTab = tab_Combat) then
GameTab(tab_Combat);
Result := not(FindDTM(No_Target, x, y, MIx1, MIy1, MIx2, MIy2));
if Result then
Break;
end;
end;
Simba Code:
function Fighting: Boolean;
begin
if not LoggedIn then
Exit;
Result := ((GetColor(600,236)) = 2183217);
if Result then
begin
if Debug then
WriteLn('Fighting');
end else
if Debug then
WriteLn('Not Fighting');
end;
In another thread somewhere I helped someone and actually wrote a function that checked for the 'no target' DTM, but I'm not sure where that is at present