SRL Archive - Help and Support

FindDtmRotated Description


Fizzi

2007-08-20 12:27:48

I'm pretty sure that this is a SCAR function, but there is no describtion of it in the SCAR manual. Could someone give me the describtion of the parameters and how exactly it works?

nielsie95

2007-08-20 12:57:34

Funtion FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; StartAngle, EndAngle, AngleStep: Extended; var Angle: Extended);

DTM - Your DTM.
x, y - Return the place if found.
x1, y1, x2, y2 - Place to search.
StartAngle, EndAngle - How far to rotate in Radians. You can use the function Radians to enter degrees.
AngleStep - Step to rotate each check.
Angle - Returned angle if found.

Example:
FindDTMRotated(Dtm, x, y, MSX1, MSY1, MSX2, MSY2, Radians(-50), Radians(50), 0.05, Angle);

Radians(-50) = 50 degrees left
Radians(50) = 50 degrees right
Higher 0.05 to speed things up, or lower it to slow things down. 0.005 is more accurate but slower.

Fizzi

2007-08-20 14:29:57

Thank you very much nielsie :).

I just have one question regarding the function. In your example, will it start searching for it at -50 degrees or at 0 degrees and then go out?

I also have a question regarding runescape… What is the maximum angle from north that the mini-map can be tilted after using MakeCompass('N');?

R0b0t1

2007-08-20 15:48:35

Thanks nielsie, I learned from that.


However, how would I make radians into degrees? I can handle degrees better.

Or, try to explain radians.

nielsie95

2007-08-20 17:27:43

Fizzi: I think it'll start searching at -50 degrees. And the RS can be shifted off very much. I don't know the real numbers, but Wizzup? told me it's 40 degrees sometimes.

r0b0t1:

Radians > Degrees = function Degrees
Degrees > Radians = function Radians

Radians are calculated with Pi, I believe.. 2 * Pi = 180 degrees.

Fizzi

2007-08-20 20:06:34

From: nielsie95
Fizzi: I think it'll start searching at -50 degrees. And the RS can be shifted off very much. I don't know the real numbers, but Wizzup? told me it's 40 degrees sometimes.

r0b0t1:

Radians > Degrees = function Degrees
Degrees > Radians = function Radians

Radians are calculated with Pi, I believe.. 2 * Pi = 180 degrees.


Pi = 180 degrees. 2Pi = 360 degrees. But robot, you can just do Radians(30) to return 30 degrees in radians.

R0b0t1

2007-08-20 23:07:13

Meh, thanks. That helps a whole lot.


Never knew about radians(deg) though.

Bobarkinator

2007-08-21 08:18:51

What could you do with the angle it returned?

Fizzi

2007-08-21 09:18:54

From: bobarkinator
What could you do with the angle it returned?


Nielsie didn't say what it returns as…. but I'm pretty sure it returns as a boolean like all other finding functions.

Markus

2007-08-21 09:21:35

It's a boolean, true if found.
It also sets the var Angle to the angle used to find the DTM.

Bobarkinator

2007-08-21 20:28:49

From: markus
It's a boolean, true if found.
It also sets the var Angle to the angle used to find the DTM.


That's what I mean, what can you do with that angle returned?

nielsie95

2007-08-22 05:59:07

Not much, I believe. I don't use it..

ZephyrsFury

2007-08-22 06:16:09

From: bobarkinator
That's what I mean, what can you do with that angle returned?


if (FindDtmRotated(CrossRoadsDTM, Sx, Sy, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, 0.1, Angle)) then
Writeln('We found the angle: ' + FloatToStr(Angle));

Lol… :D

Bobarkinator

2007-08-22 08:06:45

Lol, I was thinking it could give you the radial at which you want to radial walk.

Fizzi

2007-08-22 09:15:12

I'm pretty sure that angle is broken anyway… It seems to always return as 0.

ZephyrsFury

2007-08-23 05:12:20

I think it works for me although I haven't actually tested to see what Angle was returned. A more practical use for the angle would we to check whether the angle returned is within a certain range. eg:


if (FindDtmRotated(CrossRoadsDTM, Sx, Sy, MMX1, MMY1, MMX2, MMY2, -Pi/2, Pi/2, 0.1, Angle)) then
if (Angle < 2) and (Angle > -2) then
begin
Mouse(Sx, Sy, 1, 1, true);
etc...
end;

But then again you could just make the start and end angles -2 and 2….