PDA

View Full Version : [Thieving]IsStunned: Boolean;



Flight
02-04-2012, 05:25 AM
For anyone wishing to make a Thieving script, this should detect if your player is stunned (with the little yellow birds above your head).


Function IsStunned: Boolean;
var
HBox: TBox;
CTS: Integer;
TPA: TPointArray;
begin
Result := False;

HBox := IntToBox(235, 125, 285, 165);

CTS := GetColorToleranceSpeed;

ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 3.03);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4907761, 235, 125, 285, 165, 4);
ColorToleranceSpeed(CTS);

Result := ((Length(TPA) > 0) and (AveragePixelShift(HBox, 250, 500) > 300))

end;

RISK
02-04-2012, 05:39 AM
You should also add a text recognition as a fail safe since you can see other players birds when they are stunned.