Camaro'
2011-01-27 15:18:39
What it does:
Uses the mini map to find yellow dots,and based on that, it then loops through all the NPC's on the main screen to find the specified uptext.
How to use:
Things to know:
Currently it only left clicks when up text is found.
There is probably a shorter method, but, eh.
Code:
:p
Uses the mini map to find yellow dots,and based on that, it then loops through all the NPC's on the main screen to find the specified uptext.
How to use:
MouseNPC('Uptext');
Things to know:
Currently it only left clicks when up text is found.
There is probably a shorter method, but, eh.
Code:
function GetNpcsATPA: T2DPointArray;
var
TPA: TPointArray;
ATPA : T2DPointArray;
begin
//if not (LoggedIn) then Exit;
FindColorsTolerance(TPA, 195836, MMX1, MMY1, MMX2, MMY2, 20);
if (Length(TPA) < 0) then
Exit;
ATPA := TPAToATPA(TPA, 7);
Result := ATPA;
end;
function MouseNPC(UpText: String): Boolean;
var
ATPA : T2DPointArray;
I, C, X, Y, dX, dXX, dY, dYY, nX, nY, k, cX, cY: Integer;
begin
for k := 0 to 3 do
begin
ATPA := GetNPCSATPA;
DebugATPA(ATPA, '');
if (Length(ATPA) < 1) then
Exit;
SortATPAFrom(ATPA, Point(MSCX, MSCY));
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], X, Y);
if (Distance(X, Y, MMCX, MMCY) > 20) then
Continue;
//W('X: ', X);
//W('Y: ', Y);
C := Distance(X, Y, MMCX, MMCY);
if (X >= MMCX) then
begin
dX := X - MMCX;
dXX := (dx * 36) / 4;
cX := MSCX + dXX + 5;
end;
if (X <= MMCX) then
begin
dX := MMCX - X;
dXX := (dX * 36) / 4;
cX := MSCX - dXX + 5;
end;
if (Y >= MMCY) then
begin
dY := Y - MMCY;
dYY := (dY * 36) / 4;
cY := MSCY + dYY;
end;
if (Y <= MMCY) then
begin
dY := MMCY - Y;
dYY := (dY * 36) / 4;
cY := MSCY - dYY;
end;
MMouse(CX, CY, 5, 5);
if (WaitUpText(UpText, 125)) then
begin
GetMousePos(nX, nY);
Mouse(nX, nY, 0, 0, True);
Result := True;
FFlag(0);
Wait(400 + Random(400));
Exit;
end;
Wait(300 + Random(600));
Continue;
end;
end;
end;
:p