SRL Archive - Help and Support

Looking for help for a function


WT-Fakawi

2011-02-19 04:06:57

As some of you might know, I am working on a revival of my old Ratz script, codename Bob Ross ("Happy Little Runescape." Currently training ten skills :) ) I am very very rusty and again I seek help for a function.

I need a Leash function. It calculates the distance between two points, an anchorpoint (red) and a our current pospoint, for Minimap purposes. If the distance exceeds a certain threshhold Leash will click gently towards the Anchorpoint. Even when the anchorpoint is off the Minimap. So it should remember where the Anchorpoint was the last time we checked it. See illustration.

See what I mean? It is like an elastic invisible connection between the two points. The more the distance between the two points, the larger the click towards it.

I have a very crude solution right now, but I would love to see this elegantly solved in trigonometry, not unlike RadialWalk.

Wanted

2011-02-19 04:44:42

{$i SRL/SRL.scar}

function NextPoint(Current, Destination: TPoint; MaxDist: Integer): TPoint;
var
AngleOfPoint: Extended;
begin
AngleOfPoint := Degrees(ArcTan2(Current.Y - Destination.Y, Current.X - Destination.X)) + 90.0;
Result := Point(Round(MaxDist * Sin(AngleOfPoint * Pi / 180)) + Current.X, Round(-MaxDist * Cos(AngleOfPoint * Pi / 180)) + Current.Y);
end;

var
P: TPoint;

begin
P := NextPoint(Point(MMCX, MMCY), Point(MMCX + 250, MMCY + 250), 75);
Mouse(P.X, P.Y, 0, 0, True);
Flag;
end.

This will find the angle between your currentpos and your destination, then it will give you a point at the same angle with a max distance from your current pos.

WT-Fakawi

2011-02-19 17:15:05

Hmmm, are you sure that the code is correct? I can't seem to get it to work. Probably me, but true. Wonderful code btw, beyond my capacities :)

Gu3st...

2011-02-19 17:23:53

From: WT-Fakawi
Hmmm, are you sure that the code is correct? I can't seem to get it to work. Probably me, but true. Wonderful code btw, beyond my capacities :)
ArcTan2() gets the angle of two points (ArcTan2(y2-y1, x2-x1)), so in theory that function should work just fine

WT-Fakawi

2011-02-19 17:28:01

Turns out Mouse((x + MMCx)/2, (y + MMCy)/2, 0, 0, True); works fine too :D

Wanted

2011-02-19 18:26:26

From: WT-Fakawi
Turns out Mouse((x + MMCx)/2, (y + MMCy)/2, 0, 0, True); works fine too :D


That's the average point.

You will probably need to know the angle between the two points, and in order to make a preset distance (other than exactly half way) you'll need the angle to determine a point at a distance and angle.

I haven't tested that code, but I think I understand now more of what you want and can provide a more detailed base and description soon.

Boreas

2011-02-20 00:55:34

I assume I screwed up the +/- and/or sin/cos on the trig, but is this what you mean idea-wise?
var Leash: tpoint;

//set anchor point to current position by resetting leash
procedure AnchorsAway;
begin
Leash,x := 0; //angle
Leash.y := 0; //distance
end;

//return Anchor position (whether it is on MM or not)
function Anchor: tpoint;
begin
result.x := MMCX + Sin(Radians(Leash.x))*Leash.y;
result.y := MMCY - Cos(Radians(Leash.x))*Leash.y;
end;

//must be uesd everytime you move.
//first decide on a point on MM to click
//including randomness if needed
//then input that point into LeashMove and Mouse
//with no randomeness
procedure LeashMove(Coord: tpoint);
var TheAnchor: tpoint;
begin
TheAnchor := Anchor;
Leash.y := Distance(Coord.x, Coord.y, TheAnchor.x, TheAnchor.y);
Leash.x := Degress(ArcTan2(Coord.x- TheAnchor.x, Coord.y- TheAnchor.y));
end;

{
if Leash.y is too much, then head back

to get back, return Anchor and check if on MM
if so, click it, either call AnchorsAway or LeashMove to reset
if not, use below with Distance being < MM Radius, and use LeashMove
result.x := MMCX + Sin(Radians(Leash.x))*DISTANCE;
result.y := MMCY - Cos(Radians(Leash.x))*DISTANCE;
rinse and repeat until Anchor is in minimap
}

Main

2011-02-20 02:53:49

program Leash;
{.include SRL\SRL.scar}

Function AngleToNorth(X, Y, Z: Integer; Custom: Boolean): Integer;
var
N: Tpoint;
C, H: Integer;
Begin
X:=X - MMCX;
Y:=Y - MMCY;
H:=Round(Hypot(X, Y));
X:=76 * X / H;
Y:=76 * Y / H;
If Custom then C:=Z
else
C:=round(RS_GetCompassAngleDegrees);
N:=Inttopoint(Round(-1000 * Sin(Radians(C))),Round(-1000 * Cos(Radians(C))));
H:=Round(Hypot(N.x, N.y));
N:=Inttopoint(76 * N.x / H, 76 * N.y / H);
Result:=Round(Degrees(ArcCos((N.x * X + N.y * Y)/(Hypot(X, Y) * Hypot(N.x, N.y)))));
If Result > 0 then
Begin
If C < 180 then
Begin
If ((X < 0) and (Y < N.y)) or ((X > 0) and (Y < -1 * N.y)) then Result:=360 - Result;
End else
If ((X < 0) and (Y > -1 * N.y)) or ((X > 0) and (Y > N.y)) then Result:=360 - Result;
End;
End;

Procedure WalkAngle(Z, H: Integer; Back, Custom: Boolean);
var
P: Tpoint;
R, C: Integer;

Begin
If back then Z:=Z+180;
C:=round(RS_GetCompassAngleDegrees);
P.x:=Round(-100 * Sin(Radians(C + Z)));
P.y:=Round(-100 * Cos(Radians(C + Z)));
If Not Custom then H:=Round(Hypot(P.x, P.y));
R:=randomrange(20,70);
P.x:=MMCX + R * P.x / H;
P.y:=MMCY + R * P.y / H;
Mouse(P.x, P.y, 0, 0, true);
End;

Procedure PullTheLeash(X, Y: Integer);
var
Dist, Walked, Angle: Integer;

Begin
Dist:=Round(Hypot(X - MMCX, Y - MMCY));
Writeln('Distance is '+ IntToStr(Dist));
Angle:=AngleToNorth(x, y, 0, false);
Writeln('Angle is '+ IntToStr(Angle));
repeat
If Dist > 75 then Walked:=RandomRange( 1, 75)
else Walk:=RandomRange(1,Dist);
WalkAngle( Angle, Walked, False, False);
Dist:= Dist - Walked;
Wait(5000);
While FlagPresent Do Wait(Random(100));
until Dist < 10;
End;

begin
Setupsrl;
PullTheLeash(MMCX,MIY2);
end.
EDIT: Works now

The function AngleToNorth will tell you the angle between any object to the north compass or another object on the mini map.
The procedure WalkAngle will walk to any angle with respect to the north compass.

Ogre

2011-02-20 03:04:24

if (Distance(RedPoint.x, RedPoint.y, myPoint.x, myPoint.y) <= thresh) then
ClickPoint := RedPoint
else begin
while (not(OnMinimap(ClickPoint))) do
begin
ClickPoint := Point(Round((RedPoint.x - myPoint.x)/(1.2 + i/20.0)) + myPoint.x, Round((RedPoint.y - myPoint.y)/(1.2 + i/20.0)) + myPoint.y); //the 1.2 constant is kind of meh, you may want to change it, and add randomness in here generally
i := i + 1;
end;
end;

You could repeat this until distance between redpoint and mypoint is smaller than some small number

note: this probably doesn't compile, I don't have SCAR/Simba on this computer, I don't think some of the function names are even right..

WT-Fakawi

2011-02-20 03:06:06

I do love you guys, you know that, don't you?….
Anyway with your help I will for sure be able to get it right.

Edit:



This is the in-game situation with DDTM Anchor Point and our current (green) MMCx, MMCy pos.

Ogre

2011-02-20 03:30:46

Did you try mine? :unsure:

Main

2011-02-20 03:34:51

Mine works now too hehe , Mine does not care if your compass is changed while walking:)

WT-Fakawi

2011-02-20 03:36:04

Boreas: you forgot to Round off the ints. :) Got it now.

//set anchor point to current position by resetting leash
procedure AnchorsAway;
begin
Leash.x := 0; //angle
Leash.y := 0; //distance
end;

//return Anchor position (whether it is on MM or not)
function Anchor: tpoint;
begin
result.x := MMCX + Round(Sin(Radians(Leash.x))* Leash.y);
result.y := MMCY - Round(Cos(Radians(Leash.x))*Leash.y);
end;

//must be used everytime you move.
//first decide on a point on MM to click
//including randomness if needed
//then input that point into LeashMove and Mouse
//with no randomeness
procedure LeashMove(Coord: tpoint);
var TheAnchor: tpoint;
begin
TheAnchor := Anchor;
Leash.y := Distance(Coord.x, Coord.y, TheAnchor.x, TheAnchor.y);
Leash.x := Round(Degrees(ArcTan2(Coord.x - TheAnchor.x, Coord.y - TheAnchor.y)));
end;

From: Main Ftw
Mine works now too hehe , Mine does not care if your compass is changed while walking:)


Well, that exactly the idea. Even if it is off the Minimap?

Main

2011-02-20 03:39:08

YEP, the test was using miy2 (bottom of the inventory).
Ogre's is short and works if your not changing compass. E: Could add progressiveness for while its on map (click like half way or something).

WT-Fakawi

2011-02-20 03:43:20

From: Main Ftw
YEP, the test was using miy2 (bottom of the inventory).
Ogre's is short and works if your not changing compass. E: Could add progressiveness for while its on map (click like half way or something).


But it is a lot of code. Can it not be done more elegant?

Main

2011-02-20 03:44:17

the angle to north and walk angle can be put it in include *Wink* and then it will just be pull t3h leash.
E: I can shorten the pull the leash abit.

Ogre

2011-02-20 03:45:00

I also just realized you would have to make the new point you're going for change after you click once, but that just means subtracting ClickPoint from RedPoint after you click, basically.

Then the angle change could be added to mine if you get the compass angle before and after the walking, then using rotatepoint to get what the new point would be.

procedure LeashPoint(LPoint: TPoint; thresh: Integer);
var
sAngle, r: Extended;
dist: Integer;
tempPoint: TPoint;
begin
while (Distance(LPoint.x, LPoint.y, MMCX, MMCY) < thresh) do
begin
sAngle := rs_GetCompassAngle;
while (not(OnMinimap(ClickPoint))) do
begin
dist := Round(Distance(LPoint.x, LPoint.y, MMCX, MMCY)/(1.2 + i/20.0)); //randomize this
ClickPoint := Point(MMCX + cos(rs_GetCompassAngle) * dist, MMCY + sin(rs_GetCompassANgle) * dist);
i := i + 1;
end;
WaitWhileWalkingAndMoveCameraAngle;
tempPoint := RotatePoint(LPoint, rs_GetCompassAngle - sAngle, MMCX, MMCY);
r := dist/(Distance(LPoint.x, LPoint.y, MMCX, MMCY + 0.0));
LPoint := Point(MMCX + r * (tempPoint.x - MMCX), MMCY + r * (tempPoint.y - MMCY));
end;
Mouse(LPoint.x, LPoint.y, 1, 1, True);
end;

Main's looks shorter so, and I'm not 100% this works so whateva

Main

2011-02-20 03:48:56

Procedure PullTheLeash(X, Y: Integer);
var
Dist, Walked, Angle: Integer;

Begin
Dist:=Round(Hypot(X - MMCX, Y - MMCY));
Writeln('Distance is '+ IntToStr(Dist));
Angle:=AngleToNorth(x, y, 0, false);
Writeln('Angle is '+ IntToStr(Angle));
repeat
If Dist > 75 then Walked:=RandomRange( 1, 75)
else Walk:=RandomRange(1,Dist);
WalkAngle( Angle, Walked, False, False);
Dist:= Dist - Walked;
Wait(5000);
While FlagPresent Do Wait(Random(100));
until Dist < 10;
End;
Shortened

Am not that good in scar, but ogre if you know how to use rotate point I think it might be shorter (I have no idea how rotate point works).

WT-Fakawi

2011-02-20 03:57:43

In my perception MM compass angle has nothing to do with this or is at least unrelated to the problem. As you see from the Minimap picture above, the Rocks are my anchor. Now sometimes my Player becomes hyperactive and fweee… the Rocks just disappear out of the MM. So, now I need to click way back to the point I last registered the RockDTM, to get me back safely.

Today I finished a WillowBot Looter, that loots the Willow-dropping-bots left of the rats (there are two on the MM screen + drops) and neatly burns them. Just a couple of lines, fits wonderfully into my framework :)


EDIT: I am standing there. I have copa'd my procs into yours, but it doesn't work. Correct me pls.
program Leash;
{.include SRL\SRL.scar}
var
RockColor, RockDTM:Integer;

Procedure AssembleRockDTM;

var
DTMSubPoints: array[0..2] of TDTMPointDef;
DTMMainPoint: TDTMPointDef;
TempTDTM: TDTM;

begin
DTMMainPoint.x:=621;
DTMMainPoint.y:=88;
DTMMainPoint.areasize:=1;
DTMMainPoint.areashape:=0;
DTMMainPoint.color:=0;
DTMMainPoint.tolerance:=255;

DTMSubPoints[0].x:=637;
DTMSubPoints[0].y:=77;
DTMSubPoints[0].areasize:=1;
DTMSubPoints[0].areashape:=0;
DTMSubPoints[0].color:=RockColor;
DTMSubPoints[0].tolerance:=0;

DTMSubPoints[1].x:=645;
DTMSubPoints[1].y:=82;
DTMSubPoints[1].areasize:=1;
DTMSubPoints[1].areashape:=0;
DTMSubPoints[1].color:=RockColor;
DTMSubPoints[1].tolerance:=0;

DTMSubPoints[2].x:=636;
DTMSubPoints[2].y:=96;
DTMSubPoints[2].areasize:=1;
DTMSubPoints[2].areashape:=0;
DTMSubPoints[2].color:=RockColor;
DTMSubPoints[2].tolerance:=0;

TempTDTM.MainPoint := DTMMainPoint;
TempTDTM.SubPoints := DTMSubPoints;
RockDTM := AddDTM(TempTDTM);
end;


Function GetMyColorTPA(BaseColor, MinSize, MaxSize, x1, y1, x2, y2, tol:integer): Integer;
var
TPA: TPointArray;
begin
if FindColorsTolerance(TPA, BaseColor, x1, y1, x2, y2, tol) then
begin
If (High(TPA) > MinSize) and (High(TPA) < MaxSize) then
begin
Result := GetColor(TPA[0].x, TPA[0].y);
Writeln('TheColor = ' + IntToStr(Result));
end
end
else
begin
WriteLn('Color not found, Terminating Script');
TerminateScript;
end;
end;

Function GetAnchorPoint( TAnchorPoint:TPoint):TPoint;
var
WhichAngle: Extended;
begin

if FindDtmRotated(RockDTM, TAnchorPoint.x, TAnchorPoint.y, MMX1, MMY1, MMX2, MMY2, rs_GetCompassAngleRadians-pi/4, rs_GetCompassAngleRadians+pi/4, 0.05,
WhichAngle) then
begin
Result := TAnchorPoint;
Exit;
end
else
end;

Function AngleToNorth(X, Y, Z: Integer; Custom: Boolean): Integer;
var
N: Tpoint;
C, H: Integer;
Begin
X:=X - MMCX;
Y:=Y - MMCY;
H:=Round(Hypot(X, Y));
X:=76 * X / H;
Y:=76 * Y / H;
If Custom then C:=Z
else
C:=round(RS_GetCompassAngleDegrees);
N:=Inttopoint(Round(-1000 * Sin(Radians(C))),Round(-1000 * Cos(Radians(C))));
H:=Round(Hypot(N.x, N.y));
N:=Inttopoint(76 * N.x / H, 76 * N.y / H);
Result:=Round(Degrees(ArcCos((N.x * X + N.y * Y)/(Hypot(X, Y) * Hypot(N.x, N.y)))));
If Result > 0 then
Begin
If C < 180 then
Begin
If ((X < 0) and (Y < N.y)) or ((X > 0) and (Y < -1 * N.y)) then Result:=360 - Result;
End else
If ((X < 0) and (Y > -1 * N.y)) or ((X > 0) and (Y > N.y)) then Result:=360 - Result;
End;
End;

Procedure WalkAngle(Z, H: Integer; Back, Custom: Boolean);
var
P: Tpoint;
R, C: Integer;

Begin
If back then Z:=Z+180;
C:=round(RS_GetCompassAngleDegrees);
P.x:=Round(-100 * Sin(Radians(C + Z)));
P.y:=Round(-100 * Cos(Radians(C + Z)));
If Not Custom then H:=Round(Hypot(P.x, P.y));
R:=randomrange(20,70);
P.x:=MMCX + R * P.x / H;
P.y:=MMCY + R * P.y / H;
Mouse(P.x, P.y, 0, 0, true);
End;

Procedure PullTheLeash(X, Y: Integer);
var
Dist, Walked, Angle: Integer;

Begin
Dist:=Round(Hypot(X - MMCX, Y - MMCY));
Writeln('Distance is '+ IntToStr(Dist));
Angle:=AngleToNorth(x, y, 0, false);
Writeln('Angle is '+ IntToStr(Angle));
repeat
While Dist > 75 Do
Begin
Walked:=RandomRange( 1, 75);
WalkAngle( Angle, Walked, False, False);
Dist:= Dist - Walked;
Wait(5000);
While FlagPresent Do Wait(Random(100));
End;
While Dist < 75 Do
Begin
Walked:=Random(Dist);
Dist:= Dist - Walked;
WalkAngle( Angle, Dist - Walked, False, False);
Wait(5000);
While FlagPresent Do Wait(Random(100));
End;
until Dist < 10;
End;


var ThePoint:Tpoint;
begin
Setupsrl;
RockColor := GetMyColorTPA(5790555, 50, 100, 610, 70, 660, 128, 10);
AssembleRockDTM;
repeat
GetAnchorPoint(ThePoint);
PullTheLeash(ThePoint.x,ThePoint.y);
FFlag(0);
until false;
end.

Main

2011-02-20 04:00:31

From: WT-Fakawi
In my perception MM compass angle has nothing to do with this or is at least unrelated to the problem. As you see from the Minimap picture above, the Rocks are my anchor. Now sometimes my Player becomes hyperactive and fweee… the Rocks just disappear out of the MM. So, now I need to click way back to the point I last registered the RockDTM, to get me back safely.

Today I finished a WillowBot Looter, that loots the Willow-dropping-bots left of the rats (there are two on the MM screen + drops) and neatly burns them. Just a couple of lines, fits wonderfully into my framework :)


Are you just looking for a script that gets you to a point?

EDIT: So just keep on walking back to the rock no matter where you are?
EDIT2: A script that constantly keeps a player at a single location?

WT-Fakawi

2011-02-20 04:06:50

From: Main Ftw
So just keep on walking back to the rock no matter where you are?
Yes indeed.

Gu3st...

2011-02-20 04:10:59

Why so complicated, Main Ftw?

Angle := ArcTan2(y2-y1, x2-x1);
for I := 1 to MapDist do
begin
FAngle := Angle - rs_GetCompassAngleDegrees;
WalkPoint := RotatePoint(Point(MMCX + 60, MMCY), Radians(FAngle), MMCX, MMCY);
Mouse(WalkPoint.X-2, WalkPoint.Y-2, 4, 4, True);
RunEnergy(30);
FFlag(10);
Wait(150);
end;

Main

2011-02-20 04:11:14

pull the leash already takes care of the flag so just
begin
Setupsrl;
RockColor := GetMyColorTPA(5790555, 50, 100, 610, 70, 660, 128, 10);
AssembleRockDTM;
GetAnchorPoint(ThePoint);
PullTheLeash(ThePoint.x,ThePoint.y);
end.
.

You had your global vars at bottom, I moved it up and i'll try to see if i can get it to work.




So do you want like
if not find rock dtm then walktotherock?


edit: with your script, it only finds color when your near the rock and walks away 0_0.

WT-Fakawi

2011-02-20 04:13:19

From: Main Ftw
So do you want like
if not find rock dtm then walktotherock?
Yes and the distance from the rock defines how hard to pull the leash. Unless it is offscreen forcing you to pull back with approx. 50 % of Minimap

EDIT: Picture Time. This Player left tut island yesterday and played only two sessions… never left the rats-spot :)
<============== Progress Report ===============>
Worked for 1 Hours, 34 Minutes and 52 Seconds

<============== Progress Report ===============>
Worked for 3 Hours, 48 Minutes and 14 Seconds

Ogre

2011-02-20 04:17:50

WT-Fakawi, if you get that DDTM point, then move away, it's going to be no good unless you track how you move.

WT-Fakawi

2011-02-20 04:19:58

From: Ogre
WT-Fakawi, if you get that DDTM point, then move away, it's going to be no good unless you track how you move.


GetAnchorPoint takes care of that. This is only for init, to get the color once. All I need is the color, and I establish the relation runtime. I never go through a loading screen either :)

Main

2011-02-20 04:20:24

@faw this is abit easier

//assuming player is at the rock already
begin
repeat
If Findcolor(x, y, flagcolor, mmx1, mmy2, mmx2, mmy) then
Angle:=AngleToNorth(x, y);
-Insert procedure-
If not findrockdtm then
Begin
While not findrockdtm do walkangle(angle,0,true,false);
{*******************************************************************************
Procedure WalkAngle(Z, H: Integer; Back, Custom: Boolean);
By: Main Ftw
Description: Walk to a position with angle z away from the north. With a bonus
feature of walk to the opposite direction or a custom distance.
*******************************************************************************}
{*****************************************************************
Function AngleToNorth(X, Y, Z: Integer; Custom: Boolean): Integer;
By: Main Ftw
Descript: Give the angle between a point and the north compass. The
north compass can be replaced by any other compass degrees.
*****************************************************************}
end;
until false
end.

This will just record the flag every time it appears and walks back to the original position if it can't find the rock dtm.

EDIT, I just realized the for pulltheleash, you don't need to take the coordinate of your destination and minus mmcx and mmcy. it is still required for distance but you just need to move it two lines down.
Eg:
Procedure PullTheLeash(X, Y: Integer);
var
Dist, Walked, Angle: Integer;

Begin
Angle:=AngleToNorth(x, y, 0, false);
Writeln('Angle is '+ IntToStr(Angle));
Dist:=Round(Hypot(X - MMCX, Y - MMCY));
Writeln('Distance is '+ IntToStr(Dist));
repeat
If Dist > 75 then Walked:=RandomRange( 1, 75)
else Walk:=RandomRange(1,Dist);
WalkAngle( Angle, Walked, False, False);
Dist:= Dist - Walked;
Wait(5000);
While FlagPresent Do Wait(Random(100));
until Dist < 10;
End;



EDIT 2 Why not use the summoning symbol?
begin
Setupsrl;
Repeat //Main loop. Flag color is loaded within srl btw.
If FindColorSpiralTolerance(X, Y, Flagcolor, MMX1, MMY1, MMX2, MMY2, 15) then
Angle:=AngleToNorth(X, Y, 0, false);
Procduresss;
If Not FindSymbolIn(x, y, 'Obelisk', MMX1, MMY1, MMX2, MMY2) Then
WalkAngle(Angle, 0, true, false);
until false
end.
The symbol for oblesk is not in symbol.scar atm..



@zyt3x, dunno, they are just around ;) Also I couldnt find a way to drastically shorten em.

Gu3st...

2011-02-20 04:40:37

From: Main Ftw
@zyt3x, dunno, they are just around ;) Also I couldnt find a way to drastically shorten em.
Those 10 lines I wrote will do all your 3 functions combined

Main

2011-02-20 04:50:12

From: Zyt3x
Those 10 lines I wrote will do all your 3 functions combined

I couldn't find the description for rotate point, icefire mentioned the procedure to me before but I couldn't find it in srl (as I type rotatepoint in scar) or the scar manual.
So if I do rotatepoint(Point(MMCx, mmcy), 90, mmcx,mmcy) it gives me mmx1, mmcy?




We can just use this.

Wizzup?

2011-02-20 06:17:38

From: Main Ftw
I couldn't find the description for rotate point, icefire mentioned the procedure to me before but I couldn't find it in srl (as I type rotatepoint in scar) or the scar manual.
So if I do rotatepoint(Point(MMCx, mmcy), 90, mmcx,mmcy) it gives me mmx1, mmcy?




We can just use this.


http://docs.wizzup.org/simba/scriptref/tpa.html?highlight=rotatepoint#rotatepoint

Sir R. M8gic1an

2011-02-20 06:31:36


[----- Area 1 -----][------Area 2 -----]
[-------------][----- RATZ ------][-------]
[----- Area 3----------][-------- Area 4]

By having more points of reference you could calculate the Rats point position based on surrounding points; This would make your results accurate even when the MM point is not in view and if you've been keeping track of it and you can't find it, you can probably predict which area you're in. Find the point in that area and reverse engineer the starting point ;)

~RM

Main

2011-02-20 07:15:25

Ty wizz

Boreas

2011-02-20 10:29:38

For this to work with the anchor being off the MM, you need a leash (angle and distance to anchor) global var right?

WT-Fakawi

2011-02-20 14:49:46

From: Boreas
For this to work with the anchor being off the MM, you need a leash (angle and distance to anchor) global var right?

Yes I have called it: Trateotu (The Restaurant At The End Of The Universe)

WT-Fakawi

2011-02-21 06:47:48

Well, despite all your efforts of writing me a proper trigo-function, I solved it the simple way with the average distance. Works like a charm.