Recursive
2012-05-14 21:26:47
Okay so I am trying to add something to a script that will check if the character is in a certain area, then it will do the actions in that area. So far this is what I did:

The 2 points that I chose above {Point(197, 448), Point(423, 258)}, will they form a rectangle like this and the script will check inside this rectangle?

Also, this is what the code I am using to check this looks like (I am using Mat's InArea function):
This is the function:
And this is how I am using it to check the area:
What am I doing wrong? Cause everytime I run it, it just sits there and does nothing.
Also, if you know a better way of doing what I am attempting, please feel free to share :D

The 2 points that I chose above {Point(197, 448), Point(423, 258)}, will they form a rectangle like this and the script will check inside this rectangle?

Also, this is what the code I am using to check this looks like (I am using Mat's InArea function):
This is the function:
function InArea(Pt1, Pt2: TPoint): Boolean;
var
Loc: TPoint;
Box: TBox;
begin
Loc := SPS_GetMyPos;
Box := PointToBox(Pt1, Pt2);
if (PointInBox(Loc, Box)) then
Result := true else
if NOT (PointInBox(Loc, Box)) then
Result := false;
end;And this is how I am using it to check the area:
If InArea(Point(197, 448), Point(423, 258)) then
begin
if Not(FindBitMapToleranceIn(Ess, px, py, MiX1, MiY1, MiX2, MiY2, 45)) then
begin
Runbank;
end else
RunAltar;
FindObstacle;
CraftingRunes;
CosmicCount;
Runbank;
Inc(Runs);
IncEx(CosmicCount, RuneCount);What am I doing wrong? Cause everytime I run it, it just sits there and does nothing.
Also, if you know a better way of doing what I am attempting, please feel free to share :D