SRL Archive - OSR Help

Need help with DTM and Finding Table Function.


Sjoe

2013-01-25 12:24:39

Hey guys, I'm trying to edit my zamorak wine runner, so it would finally do some actual running :)

Issue with DTM :

When I do my first Walk to the temple, it finds the DTM,
but afterwards does not.

This is the code I use, and I let the script search for it 5 times.

if FindDTMRotated(ChaosMM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
HumanMMouse(x, y, 0, 0);
FastClick(True);
if Debug then Writeln('We are in The Chaos Temple');
end;



Also, If we were not standing next to the table (cause of lag or smthing) but further away.



Any methods so we are surely standing next to the table? (Grabs the wine faster then)

I have this from DannyRS atm (Thank you!)
but it only works if you're next to the table already.



function FindTableReturnBounds:Tbox;
var
tmpCTS:integer;
CustomObjTPA:TPointArray;
CustomObjATPA:T2DPointArray;
TB:Tbox;

begin
tmpCTS := GetToleranceSpeed;

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.03, 1.79);
FindColorsTolerance(CustomObjTPA, 7442892, MSCX-20, MSCY-50, MSCX+70, MSCY+40, 9);
SplitTPAWrap(CustomObjTPA, 13, CustomObjATPA);

SortATPASize(CustomObjATPA,True);

SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

//return largest ATPA on screen
TB := GetTPABounds(CustomObjATPA[0]);

Result:=TB;
end;


If someone wants to help through Skype? Skypename: Sjoekeloe

Wardancer

2013-01-25 14:48:48

It's hard to tell without the script. A possible issue would be that it starts searching while it isn't in the area yet so it does the five attempts before even having the table on screen. I realize it kind of defeat the purpose of being a member script if you post it here, but feel free to PM it to me and I'll take a quick look when I have time.

Will wait for a reply before putting more thought into this.

Sjoe

2013-01-26 04:19:30

From: Wardancer
It's hard to tell without the script. A possible issue would be that it starts searching while it isn't in the area yet so it does the five attempts before even having the table on screen. I realize it kind of defeat the purpose of being a member script if you post it here, but feel free to PM it to me and I'll take a quick look when I have time.

Will wait for a reply before putting more thought into this.


Alright thanks for your effort!
I'll PM you when I'm on the computeR.

Olly

2013-01-26 10:07:00

From: Sjoekeloe


But it only works if you're next to the table already.


FindColorsTolerance(CustomObjTPA, 7442892, MSCX-20, MSCY-50, MSCX+70, MSCY+40, 9);


That's because your only searching around the middle of the screen…

Sjoe

2013-01-26 10:27:59

From: Ollybest
That's because your only searching around the middle of the screen…


I know that ,
if I let it search for a wider reach, I get too many ATPA's. ( Cause I can't set it up properly)

So I just need a method for standing next to the table,
did some trials, only errors :(
Anybody have some ideas?

FIXED, thank you @Gucci!
And Wardancer :)