SRL Archive - OSR Help

New to scripting & need help with walking


Panama

2012-11-03 16:49:06

Hey!
I just today started to think of making a clay miner that will bank and mine and repeat ^^

I have this so far:
program New;
{$DEFINE SMART}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].BoxRewards := ['oins', 'oins', 'oins'];

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure MineRock;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'lay',7845078,35 ) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('ine');
end;
repeat
Wait(3000+random(250));
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
MineRock;
end.
But I am very new to walking and need some help with walking and banking, If ANYONE could help me it would be awesome!

Thanks

Ian

2012-11-03 16:56:20

If SPS works in theat location you could use that, it'd be easiest. Otherwise you could use RadialWalk or ODTMs. I've never used ODTMs myself but I've heard good things.

SPS Tutorial by Mat : http://villavu.com/forum/showthread.php?t=71461


RaidialWalk Tutorial by NKN : http://villavu.com/forum/showthread.php?t=78648

ODTMs : http://villavu.com/forum/showthread.php?t=72067

Hope these help, feel free to PM the tut makers for help, of me if using SPS o RadialWalk :)

Panama

2012-11-03 17:44:51

Awesome! Thanks; I would still need some help cause I have no idea how to make it to trigger the walking if you know what I mean

Panama

2012-11-03 17:46:26

Oh yeah and I will be using the SPS

Roflme

2012-11-03 21:11:49

To "trigger" the walking, just add the function after your mining procedure :p

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
MineRock;
Bank;
until(false);
end.

You can do that because your procedure repeats the mining until a full invo. If it didn't you'd add another repeat in the above for MineRock; until(InvFull).

I would highly suggest having a better function for finding the clay. Try using TPAs?

Function FindObj(Hue, Sat: Extended; Color, Tol, w, h: Integer; ObjText: string): Boolean;
var
CTS, I, N: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;

begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
For N := 0 to 1 do
if not FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol) then
Exit;
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, w, h);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 0, 0);
Wait(50+random(10));
If IsUpText(ObjText) then
begin
Result := True
Writeln('Found Object');
Break;
end;
end;
end;

That's something I always use :p

Now where are you going to be mining? If in walking distance to a bank, just use a path creator (I can't find the one I use, it's different but I believe they all work the same) and make a path. If it's far from a bank, make sure to have teleporting between the walking (Teleport, walk to bank, teleport, walk to mine, etc.) those will require functions as well.

If you'd rather keep it simple simba's minimap obj detection is pretty accurate so you could always use symbols like mines, water sources, shops, banks, etc. and have your mouse adjust itself based on their positions. But if you'd rather just use SPS then ignore this portion :p

Where are you planning on mining the clay exactly?

Ian

2012-11-03 21:25:35

He's mining in west varrock and banking in varrock west bank.

Panama

2012-11-04 05:43:32

Alrightt.. Thanks guys

Kobbra

2012-11-07 20:03:01

repeat
Wait(3000+random(250));
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;


Shouldn't that be 'lay' instead of 'ew'?

Ian

2012-11-07 20:07:55

From: Kobbra
Shouldn't that be 'lay' instead of 'ew'?


Yeah, it should. :)

although it isn't a very good detection method compared to invcounting because it thinks you are done mining if the camera rotates or if the rock was chosen via right click. (left click should detect fine usually)