Twinki
2013-04-28 00:26:27
So I figured out how I can detect Combat on a RSPS, but now I have a question.
How would I make it to where, if the AveragePixelShift was below 1000 then it'd go attack something, but if it wasn't then it would just wait for a certain amount of time?
I've already created a function for it, i'm just stuck at this part.
Function:
Procedure i'm trying to add this too:
How would I make it to where, if the AveragePixelShift was below 1000 then it'd go attack something, but if it wasn't then it would just wait for a certain amount of time?
I've already created a function for it, i'm just stuck at this part.
Function:
Function DetermineCombat: Boolean;
Var
PBox: TBox;
begin
PBox := IntToBox(245, 110, 285, 175);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
end; Procedure i'm trying to add this too:
procedure KillAbbyDemon;
var
X, Y:Integer;
begin
if FindColorTolerance(X, Y, AbbyDemonColor, MSX1, MSY1, MSX2, MSY2, 5) then
begin
WriteLn('Found Abby Demon');
WriteLn('');
if (DetermineCombat) then //Where I'd like to add if the Pixels are less then 1000 then it continues on with the script
begin // Ignore everything below this, haven't changed yet
MMouse(x, y, 0, 0);
ClickMouse2(False);
wait(2000);
ChooseOption('Pickpocket Knight');
wait(250);
WriteLn('Picked Knight');
end;
inc(DemonsKilled);
end;
end;