BazzBarrett
2008-09-25 14:04:22
Hi again =) ive been inspired to make a simpler more effective TPA Finder so here we are =) the script is compleatly my own but i would still like to say special thx to ProphesyOfWolf cuz he has thaugh me everytihng about TPA's and HSL's =) + giving me tips i wouldent be here making this if it wasent for him ;)
anyways this is much simpler than the old 1 so even noobs can use it =)
you may use the function as u please but just remember to credit me =) and hopfuly with the permision of the ammasing and kind Devs this may be even included in the next revision =D
X and Y = were to store to coodanates of the found object
Color = The color of your object (eg leafs for a tree the color of the ore for mining)
Tolerance = The Tolerance to search the color with
UpTextToCheck = The UpText to check with (eg Oak, Iron, Door, Bank)
anyways this is much simpler than the old 1 so even noobs can use it =)
you may use the function as u please but just remember to credit me =) and hopfuly with the permision of the ammasing and kind Devs this may be even included in the next revision =D
X and Y = were to store to coodanates of the found object
Color = The color of your object (eg leafs for a tree the color of the ore for mining)
Tolerance = The Tolerance to search the color with
UpTextToCheck = The UpText to check with (eg Oak, Iron, Door, Bank)
Function TPAFromColor(Var X, Y : Integer; Color, Tolerance :Integer; UpTextToCheck : String):Boolean;
//By Bazzbarrett
var
CTS, II : Integer;
TPA : TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For II := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[II], X, Y)
MMouse(X, Y, 2, 2);
Wait(50+Random(10));
If(IsUpText(UpTextToCheck))then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;