NexPB
01-31-2012, 05:17 PM
Why won't this work?
Edit: AtBank does work.
function InArea(Pt1, Pt2: TPoint): Boolean;
var
p: TPoint;
Box: TBox;
begin
p := SPS_GetMyPos;
writeln('Pos := ' + ToStr(p));
Box := PointToBox(Pt1, Pt2);
writeln('Box := ' + ToStr(Box));
if (PointInBox(p, Box)) then
begin
writeln('Player found in area.');
Result := true;
end else
Result := false;
end;
function AtTeleportArea: boolean;
begin
result := (InArea(Point(275, 985), Point(305, 965)));
end;
function AtBank: boolean;
begin
result := (InArea(Point(230, 945), Point(260, 960)));
end;
Debug:
Pos := (295, 970)
Box := (230, 945, 260, 960)
Pos := (295, 970)
Box := (230, 945, 260, 960)
Pos := (295, 970)
Box := (275, 985, 305, 965)
Edit: AtBank does work.
function InArea(Pt1, Pt2: TPoint): Boolean;
var
p: TPoint;
Box: TBox;
begin
p := SPS_GetMyPos;
writeln('Pos := ' + ToStr(p));
Box := PointToBox(Pt1, Pt2);
writeln('Box := ' + ToStr(Box));
if (PointInBox(p, Box)) then
begin
writeln('Player found in area.');
Result := true;
end else
Result := false;
end;
function AtTeleportArea: boolean;
begin
result := (InArea(Point(275, 985), Point(305, 965)));
end;
function AtBank: boolean;
begin
result := (InArea(Point(230, 945), Point(260, 960)));
end;
Debug:
Pos := (295, 970)
Box := (230, 945, 260, 960)
Pos := (295, 970)
Box := (230, 945, 260, 960)
Pos := (295, 970)
Box := (275, 985, 305, 965)