SRL Archive - SRL Archives

Radialwalk -> RadialWalkDegress


Naike

2008-05-20 16:13:21

Don't you think minimap is really annoying when it wont go north?
When MakeCompass(N) only make it go 330 not 360 and it messes up everything?

Well heres your solution ;)

RadialWalkDegrees!!

Minusing the StartRadial&EndRadial with the angle to get it just perfect!

Note, needs GetMinimapDegrees to work.
I also know that they could be one function but i need GetMinimapDegrees for my next Procedure/Function.

{*************************************************************************************************
Function GetMinimapDegrees(GetAngleFrom : Boolean): Integer;
By: N1ke!
Description: Gets the minimap angle in degrees. True = Clockwise , False = Not Clockwise
*************************************************************************************************}
Function GetMMDegrees(Clockwise : boolean): Integer;
Var Angle : extended;
Begin
If(Not(LoggedIn))Then Exit;
Angle := (rs_GetCompassAngleDegrees);
If ClockWise = True then Angle := 360 - Angle;
Result := Round(Angle);
End;

{*************************************************************************************************
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
By: N1ke!
Description:
*************************************************************************************************}
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
Var
M1n, M4x, D3grees: Integer;
begin
If(Not(LoggedIn))Then Exit;
D3grees := GetMMDegrees(True);
M1n := StartRadial - D3grees;
M4x := EndRadial - D3grees;
If M1n < 0 then
begin
M1n := M1n + 360;
M4x := M4x + 360;
StartRadial := StartRadial + 360;
EndRadial := EndRadial + 360;
end;
Result := RadialWalk(Color, M1n, M4x, Radius, 0, 0);
End;


Test walker with the functions.. Should go from Lumby to Varrock middle without major Failsafes!! best of all, IN ANY MINIMAP ANGLE!!! ( Made this when i started with this two Functions but known bugs is the switch from RoadColor to VarrockRoadColor goes wrong and it exits, Logout.)

Enjoy..

program new;
{.include SRL/SRL.scar}

{*************************************************************************************************
Function GetMinimapDegrees(GetAngleFrom : Boolean): Integer;
By: N1ke!
Description: Gets the minimap angle in degrees. True = Clockwise , False = Not Clockwise
*************************************************************************************************}
Function GetMMDegrees(Clockwise : boolean): Integer;
Var Angle : extended;
Begin
If(Not(LoggedIn))Then Exit;
Angle := (rs_GetCompassAngleDegrees);
If ClockWise = True then Angle := 360 - Angle;
Result := Round(Angle);
End;

{*************************************************************************************************
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
By: N1ke!
Description:
*************************************************************************************************}
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
Var
M1n, M4x, D3grees: Integer;
begin
If(Not(LoggedIn))Then Exit;
D3grees := GetMMDegrees(True);
M1n := StartRadial - D3grees;
M4x := EndRadial - D3grees;
If M1n < 0 then
begin
M1n := M1n + 360;
M4x := M4x + 360;
StartRadial := StartRadial + 360;
EndRadial := EndRadial + 360;
end;
Result := RadialWalk(Color, M1n, M4x, Radius, 0, 0);
End;

Function LumbrigeToVarrock(Run: Boolean):Boolean;
var Temp, x, y : integer; Col0r : String;
begin
If(Not(LoggedIn))Then Exit;
If Run then
begin
Temp := GetMMLevels('run', Col0r);
If Temp > RandomRange(25, 55) then SetRun(true);
end;
If not RadialWalkDegrees(FindRoadColor, 85, 95, 45)then Exit;
If not RadialWalkDegrees(FindRoadColor, 70, 95, 45)then Exit;
Temp := FindWaterColor;
If FindColor(x, y, Temp, MMX1, MMY1, MMX2, MMY2)then Wait(2) else Exit;
If not RadialWalkDegrees(FindRoadColor, 45, 90, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 70, 120, 43)then Exit;
If not RadialWalkDegrees(FindRoadColor, 330, 390, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 290, 360, 60)then Exit;
Temp := FindWaterColor;
If FindColor(x, y, Temp, MMX1, MMY1, MMX2, MMY2)then Wait(2) else Exit;
If not RadialWalkDegrees(FindRoadColor, 310, 390, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 290, 360, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 310, 390, 40)then Exit;
If not RadialWalkDegrees(FindRoadColor, 310, 390, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 360, 420, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 360, 420, 60)then Exit;
If not RadialWalkDegrees(FindRoadColor, 380, 450, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 320, 360, 50)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 255, 330, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 255, 330, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 255, 330, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 320, 400, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 270, 360, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 280, 360, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 330, 450, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 330, 390, 60)then Exit;
If not RadialWalkDegrees(FindVarrockRoadColor, 330, 390, 60)then Exit;
If FindSymbol(x, y, 'Water')then
begin
Mouse(X, y, 0, 0, True);
FFlag(10);
Writeln('Your in varrock middle.');
Result := True;
end else
begin
Writeln('Didnt find water on last part.');
Writeln('Still near varrock middle.');
Result := True;
end;
end;

begin
SetupSRL;
Wait(2000);
If Not LumbrigeToVarrock(True)then Logout else DoEmote(RandomRange(1, 37));
End.

Enjoy!!, Note : Hole thing will be released to Junior members 25/5/08 !

Zezi

2008-05-20 17:41:22

i've not checked the other suggestions / development

but i'm SURE i've seen this idea elsewhere, i'll get back to you on this looks good though.

Timer

2008-05-20 17:43:18

Looks nice, could of been simpler though?

I get your idea, subtract the degrese from perfect North :p

i have tried it before, failed cause I knew sh*t about scar :)

Naike

2008-05-21 01:51:42

Couldnt be much shorter ;) maybe 1, 2 lines

Gu3st...

2008-05-21 09:32:01

well.. 1 line shorter atleast: you dont need 'If(Not(LoggedIn))Then Exit;' in GetMinimapDegrees.

Why? cus u already did in RadialWalkDegrees.

Edit: Other than that: Good! :D

i used it in my script (+ credit you ofc ;)), its okay?

Naike

2008-05-21 09:55:25

Zytex! ofc its ok ;) why you think i put it here for ? xD

MylesMadness

2008-05-22 16:33:34

To put in srl :p

Naike

2008-05-23 10:38:57

Uptaded with names and goes a little faster now.. Also added walking script.

Drakan

2008-05-23 13:02:04

I was seriously just working on a RRWEx that you would make as north and then it could walk no matter of any compass angle. It didnt require so much :P Just get the minimap degrees then add/subtract according to the mmangledegree