SRL Archive - RS3 Outdated / Broken Scripts

Desperly Need A Function/Procedure


the nerd

2007-01-27 06:17:20

I realy need a compass function/procedure that can set the compass to N,W,E,S, and make all of the lines on the minimap stright. I have tried to make this myself before, but without sucsess.


Thanks
THE NERD

the scar noob

2007-01-27 07:01:01

How you mean?
MakeCompas('N');
MakeCompas(E');
MakeCompas('S');
MakeCompas('W');
Do you mean this?

Lorax

2007-01-27 07:31:28

I'm sorry but it's just not possible using SCAR, Jagex has prevented this by detecting if an angle is 0 then it will randomly move it a bit to the right or the left..
If you need perfectly straight lines then we're back to ScarScape scripting where walking could be done like Mouse, Mouse, Mouse, Mouse… booring, and a real script wouldn't need straight lines…
What do you need it for?

the nerd

2007-01-27 11:27:23

From: the scar noob
How you mean?
MakeCompas('N');
MakeCompas(E');
MakeCompas('S');
MakeCompas('W');
Do you mean this?


No,
I need a procedure that can line up the vertical and horzontal line on the minimap. Aswell as change the compass direction. There used to be one be it is not capatable with the current SRL and i can't change it to make it capatable

the nerd

2007-01-27 11:31:53

From: Lorax
I'm sorry but it's just not possible using SCAR, Jagex has prevented this by detecting if an angle is 0 then it will randomly move it a bit to the right or the left..
If you need perfectly straight lines then we're back to ScarScape scripting where walking could be done like Mouse, Mouse, Mouse, Mouse… booring, and a real script wouldn't need straight lines…
What do you need it for?


I no but im not producing and script, but a set of world walk procedures. I have reduced the need for it to have stright line on the minimap, but there is still 2 out of 10 chances it will get it wrong. The lines don't need to be perfect, just almost. And procedures can compensate the screen sway. But perfect north and things like that arn't acurrect enough for my procedure to move charater reliably around the world map.

Ejjman

2007-01-27 11:47:13

Use radialwalk, it works excellent, and is easy to learn. ;)

tarajunky

2007-01-27 13:16:10

It's not that hard to make one of these, actually. Just copy the MakeCompass procedure out of SRL, rename it to something else like MakeCompass1, and replace the FindColor command that determines when the compass point is in the correct place with a different way to detect straight lines on the minimap. I did this before with DTMs of straight lines. Maybe I'll whip one up later.

tarajunky

2007-01-27 13:44:11

Here you go, took 20 minutes including testing.


program New;
{.include SRL/SRL.scar}
function MakeCompass1(Side: string): Boolean;
var
Fx, Fy, dx, dy, StartPos, EndPos, Vline: Integer;
ComMark: Integer;
Left_Right: Boolean;
begin
StartPos := FindCompassAngle;
MarkTime(ComMark);
case LowerCase(Side) of
'n': if StartPos > 180 then EndPos := 360 else EndPos := 0;
'e': if StartPos < 270 then EndPos := 90 else EndPos := 450;
's': EndPos := 180;
'w': if StartPos < 90 then EndPos := -90 else EndPos := 270;
end;
if StartPos > EndPos then Left_Right := True
else if StartPos < EndPos then Left_Right := False
else exit;
VLine := DTMFromString('78DA636C656260286340011FDF3D673002D28' +
'C40FC1F0818416AB270AB0101B09A2622D414E056C3045353835F' +
'0D005A9217D4');
repeat
if Left_Right then KeyDown(VK_RIGHT)
else KeyDown(VK_Left);
Wait((10) + Random(10));
if Left_Right then KeyUp(VK_Right)
else KeyUp(VK_Left);
if (FindDTM(VLine,dx, dy, MMX1, MMY1, MMX2, MMY2)) then
begin
Result := True;
Writeln('Found VLine');
break;
end;
until (TimeFromMark(ComMark) > 7000);
FreeDTM(VLine);
end;

begin
SetupSRL;
ActivateClient;
MakeCompass1('n');
end.

By the way, if you don't need it 100% accurate, then you can move the KeyUp and KeyDown statements outside the loop. If you do this, it will consistently over-shoot by a small amount, but it will be close.

the nerd

2007-01-28 08:24:27

Wow, thanks tarajunky. I've been trying to make one of these for ages man. That a real help for my world walk stuff which has been on hold untill i could find one of these