SRL Archive - Help

Choosing a random DTM


doxin

2012-12-29 02:25:27

So I have this
repeat

if (FindDTM(essencerock, x, y, 5, 5, 513, 336)) then
repeat
WriteLn('Found Essence Rock');
FindDTM(essencerock, x, y, 6, 10, 514, 336);
AL_AccurateMMouse(point(x, y), 5, 5);
Wait(500+random(500));
if FindColor(x, y, 15395359, 42, 9, 160, 29) then
AL_FastClick(mouse_left);
Wait(5000+random(1000));
CheckInv;
until (InvIsFull) or (not (FindDTM(essencerock, x, y, 5, 5, 513, 336)));

the problem is it keeps hovering over the same DTM every time it loops. how do i get it to choose a different point when it repeats?

riwu

2012-12-29 02:40:33

You will need knowledge of TPAs.
Use FindDTMs which will store all the points in the var p and then just loop through the TPA.

doxin

2012-12-29 02:44:15

oh thanks :D by chance i just started reading about TPAs after i posted this.

P1ng

2012-12-29 02:44:47

What is the DTM of(mainscreen/inventory)? Is this for a private server/actual RS?

How come you find the DTM then search for it again then move the mouse and check for a colour?

doxin

2012-12-30 02:24:24

From: P1ng
What is the DTM of(mainscreen/inventory)? Is this for a private server/actual RS?

How come you find the DTM then search for it again then move the mouse and check for a colour?


The DTM is of the essence rock, main screen. it's for a private server.

i search for the DTM after i find it because i was to include the FindDTM in the repeat loop. and it checks for the color after it moves that mouse because that color is for the uptext since uptext doesn't work for private servers

P1ng

2012-12-30 04:20:41

Unfortunately I don't have a lot of time, but take a look at this. It should work. Or at the very least help you on your path to TPAs.

procedure FindRock;
var
TPA: TPointArray;
H, i, x, y, EssenceRock: Integer;
begin
if FindDTMs(EssenceRock, TPA, 6, 10, 514, 336) then
begin
WriteLn('Found Essence Rock');
H := High(TPA);

for i := 0 to H do
begin
if InvIsFull then
Break;

AL_AccurateMMouse(point(TPA[i].x, TPA[i].y), 5, 5);
Wait(500+random(500));

if FindColor(x, y, 15395359, 42, 9, 160, 29) then
begin
AL_FastClick(mouse_left);
Wait(5000+random(1000));
CheckInv;
end;
end;
end;
end;