SRL Archive - OSR Help

Clicking MM Dots?


xtrapsp

2012-04-28 07:42:24

Hey guys,

Once again I create another thread of me being Stoopid. However! [J]ustin was stumped too :P

So I'm trying to make it so that my mouse clicks on Yellow or White dots. Regardless of position Etc (It's a confined area).

I've looked at the following:

   while (Length(GetMMDotsOnMS('npc')) < 1) and (GetSystemTime < TimeCheck) do
begin
Wait(100);
FindNormalRandoms;
end;

    count := Length(GetMiniMapDotsIn('green', MMX1, MMY1, MMX2, MMY2)));
WriteLn(ToStr(count) + ' friends on the map!');

I'm still stumped :P

Any help?

I came up with the Idea of TPA's In the MM area. But I'm pretty sure theres a short hand method :)

Flight

2012-04-28 07:55:27

How about this?

function GetMiniMapDots(WhatDot: String): TPointArray;

That will give you a TPA of all the dots (by what you choose) on the MM. From there, you can click on one of those points (dots).

xtrapsp

2012-04-28 08:01:23

From: Flight
How about this?

function GetMiniMapDots(WhatDot: String): TPointArray;

That will give you a TPA of all the dots (by what you choose) on the MM. From there, you can click on one of those points (dots).


So it would be
begin
GetMiniMapDots('Npc'));
Mouse(x, y, 2, 1, True);
end;

Something along those lines?

Thanks by the way :)

Imagine

2012-04-28 08:15:48

From: xtrapsp
So it would be
begin
GetMiniMapDots('Npc'));
Mouse(x, y, 2, 1, True);
end;

Something along those lines?

Thanks by the way :)


I don't think so, since x and y would be put into a TPA, there'd be no defined x and y, and you'd have to use a loop to cycle through each MM dot. (I might be wrong though)

Total

2012-04-28 08:37:51

Derp. Nvm.

xtrapsp

2012-04-28 08:42:53

From: TotalKillz
Derp. Nvm.


What?

var
TPA : TPointArray;
begin
TPA := GetMiniMapDots('Npc'));
Mouse(TPA.X, TPA.Y, 2, 1, True);
end;

That wont work? :P

Total

2012-04-28 08:47:56

Oh I'm tired. Just remove the 2nd closing parentheses after GetMiniMapDots and see if it works. I just took it out cuz I couldn't get it to compile lols. I think you would have to loop through it still though, never done this before.


procedure MainLoop;
var
TPA : TPointArray;
begin
TPA := GetMiniMapDots('Npc');
Mouse(TPA[0].X, TPA[0].Y, 2, 2, true);
end;

I think this would be correct, but would only use it if you are sure that its the only dot.

bg5

2012-04-28 09:21:27

will click all dots:
var
TPA : TPointArray;
h : integer;
begin
TPA := GetMiniMapDots('Npc'));
h := high(TPA);
for a := 0 to h do
Mouse(TPA[a].X, TPA[a].Y, 0, 0, True);
end;

Sin

2012-04-28 09:23:12


function FindNearestNPC(var x,y: Integer; Click,DoWait: Boolean):Boolean;
var
NPC:TPoint;
begin
Result := False; //This should always be false by default
if FindColorSpiralTolerance(NPC.x,NPC.y,65536,558,6,690,153,4) then
begin
Result := True;
X := NPC.x; //Now, X & Y actually return something...
Y := NPC.y;
if (Click and Result) then //No need for (Boolean = True)
begin
Mouse(NPC.x,NPC.y,1,1,True);
if DoWait then
begin
FFlag(1);
Wait(750+random(250));
end;
end;
end;
end;

Home

2012-04-28 09:46:57

function FindNearestNPC(var X, Y :Integer) :Boolean;
var
TPA :TPointArray;
begin
TPA := GetMiniMapDots('NPC');
If Length(TPA) = 0 then Exit;
SortTPAFrom(TPA, Point(MMCX, MMCY));
X := TPA[0].X;
Y := TPA[0].Y;
Result := True;
end;


~Home