SRL Archive - OSR Help

Won't Find Door


Valithor

2012-03-20 16:05:12

Can anyone help me out with this? I'm trying to find the door to the Hardwood Grove on Karmaja Island (p2p side). I'm using basically two functions: a mouse function by YoHoJo (presented in his video tut), and a TPA color-finding function by Naum (from his tut on TPA's) .

In short when I go to find it SRL complies, but then the mouse doesn't move. I'm sure that my colors are fine because I was using the ACA utility to find them.

Here's my code. Where did I go wrong? :unsure:
program new;                        // Edits shown in comments
{$i srl/srl.simba}

function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean):Boolean; //by YoHoJo
begin
MMouse(x, y, 5, 5);
if WaitUptext(UpText, 1500*Random(500)) then //changed this to: (Uptext, 1500 + Random(500))
begin // works fine now
Result:=True;
GetMousePos(x, y);
if RClick then
begin
Mouse(X, Y, 5, 5, false);
Result:=WaitOption(Option, 2000);
Writeln('CheckAndClick (False - RClick)');
if Result then FFlag(0);
end else
begin
Mouse(x, y, 5, 5, true);
Writeln('CheckAndClick (True - LClick)');
Wait(100 * Random(50));
FFlag(0);
end;
end;
end;

function FindGroveDoor: Boolean;
var
Dx, Dy: integer;
TPA: Array of TPoint;
ATPA: T2DPointArray;
I: integer;

begin
FindColorsSpiralTolerance(Dx, Dy, TPA, 3894411, MSX1, MSY1, MSX2, MSY2, 17);
begin
ATPA:= SplitTPA(TPA, 20);
for I := 0 to High(ATPA) do
if MiddleTPAEX(ATPA[i], Dx, Dy) then
begin
case Random(2) of
0:
begin
GetMousePos(Dx, Dy); //took out GetMousePos as suggested by Home
CheckAndClick('door', 'pen', Dx, Dy, true); // I don't think it would hurt if left in
Writeln('Found Door');
Result:= true;
end;
1:
begin
GetMousePos(Dx, Dy); // Took this one out, too
CheckAndClick('door', 'pen', Dx, Dy, false);
Writeln('Found Door');
Result:= true;
end;
end;
end else
Result:= False;
Exit;
end;
end;

begin
SetUpSRL;
ActivateClient;
FindGroveDoor;
end.

This is the camera angle and position when I begin searching for the door. The image after that is what ACA shows when I search for that Color and Tolerance. What changes should be done?



Home

2012-03-20 16:06:24

Remove GetMousePos. :)

WaitUptext(UpText, 1500*Random(500)) Change it to WaitUptext(UpText, 1500 + Random(500))


~Home

tehq

2012-03-20 16:07:16

It finds far too many potential objects (second picture)

DeSnob

2012-03-20 16:08:02

You should try using ATPAs. You can filter the sizes of them to find the largest object to click. The largest ATPA being the door.

Here's a great thread that shows many of the current functions that can be used for TPA filtering:
http://villavu.com/forum/showthread.php?t=49067

Valithor

2012-03-20 16:20:06

From: Home
Remove GetMousePos.

Done. Will post results here in a minute after results.

From: tehq
It finds far too many potential objects (second picture)

From: DeSnob
You should try using ATPAs. You can filter the sizes of them to find the largest object to click. The largest ATPA being the door.

I thought the ATPA in my script was filtering sizes? Or perhaps I misunderstood what Naum was trying to say with that?

Added link to the first post to direct to TPA tut I was reading…

Valithor

2012-03-20 16:52:28

Sorry for the double post, but after making the corrections that Home suggested I'm finding the door now. Many Many Thanks to everyone who replied and offered excellent help on the issue.

Will definitely look more into the WizzyPlugin for further help with ATPAs.

On another note, wtf did they do to my trees? :blink: I was just logged in yesterday and they weren't like this! Now I have to update my autocolor files… well played Jagex… well played…


P1nky

2012-03-20 16:55:56

your graphic setting seems like it's quite detailed?

Valithor

2012-03-20 17:50:54

P1nky, no those are the mininum graphics settings. :wowzers: They must have updated the trees with the most recent update. Grrg… No worries… I'll have my autocolor back to normal in a few.