SRL Archive - OSR Help

Script doesnt begin walking after inv full


Panama

2012-11-04 16:20:46

Hey!
My script doesnt start walking to the bank from west clay mines after the invs full and I would like to have some help with that ;>
program ClayCrusher;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.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 WalkToBank;
Var
OutBank:TPointArray;
begin //SetupSRL here made a second client be summoned when It got to this part, so I took it out :)
SPS_Setup(RUNESCAPE_SURFACE, ['11_7','10_8','10_7','10_6','12_6','12_8']); //This I changed
OutBank := [Point(4566, 2906), Point(4557, 2932), Point(4532, 2942),
Point(4521, 2960), Point(4519, 2987), Point(4520, 3001), Point(4522, 3013),
Point(4521, 3025), Point(4525, 3039), Point(4527, 3048), Point(4524, 3061),
Point(4530, 3072), Point(4536, 3082), Point(4538, 3089), Point(4537, 3098),
Point(4545, 3114), Point(4551, 3120), Point(4565, 3141), Point(4559, 3169),
Point(4184, 3277), Point(4075, 3010), Point(4094, 2738), Point(5092, 2756), Point(5088, 3203), Point(4843, 3311)];
SPS_WalkPath(OutBank);
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,10) then
begin
Mouse(x, y, 5, 5, false); //I added some randomization
ChooseOption('ine');
end;
Wait(1500+random(250));
until(InvFull);
WalkToBank;
end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
MineRock;
WalkToBank;
end.

Panama

2012-11-04 17:05:59

Bu bedibump

Roflme

2012-11-04 17:21:38

Well first you can take out WalkToBank in the MineRock, since in your main loop at the bottom you already have WalkToBank following MineRock so you're just repeating it.

You may have to add more areas. After you make your path click on a few points surrounding your path. This will add additional areas (DON'T INCLUDE THESE POINTS IN YOUR PATH!). Sometimes that fixes my problem.

I'm going to test it out, I'll play around with it and see what happens.


Oh, by the way, try doing something like this:

procedure MineRock;
var
x, y, t, PlusOne: integer;
begin
PlusOne := InvCount + 1
repeat
if FindObj(x, y, 'lay',7845078,10) then
MarkTime(t);
Mouse(x, y, 5, 5, true);
repeat
Wait(100+random(10));
until(InvCount=PlusOne) or (TimeFromMark(t) > 2000);
until(InvFull);
end;
The wait you have can throw your timing off. You can either double click or if you mine it fast it'll be delayed. This will allow so after it gets another item the InvCount will equal PlusOne so it'll just repeat the loop RIGHT AFTER mining a clay. If it waits too long (2 seconds, or increase it) then it'll restart the loop (this is in case it misses an ore or something).

And AFAIK, the other scripts I compete with when I use this at Rimmington can't keep up. Don't know why.


Edit: I'm curious why there were SO MANY points before :p

This worked for me

procedure WalkToBank;
Var
myPath:TPointArray;
begin
Writeln('walking bank');
SPS_Setup(RUNESCAPE_SURFACE, ['10_6', '10_7', '10_8', '11_6', '11_7', '11_8']);
myPath := [Point(4579, 3138), Point(4545, 3099), Point(4518, 3039),
Point(4524, 2995), Point(4525, 2951), Point(4561, 2938), Point(4581, 2901)];
SPS_WalkPath(myPath);
end;

Got me to the VWB (I hope that was your destination, if you want to go bank elsewhere then you'll have to make a new path, sorry.)

Try making that on your own again, though. Don't just copy and paste :(

Panama

2012-11-04 17:39:23

You may have to add more areas. After you make your path click on a few points surrounding your path. This will add additional areas (DON'T INCLUDE THESE POINTS IN YOUR PATH!). Sometimes that fixes my problem
.

I didnt really understand that, How I cna make those "points" thats not on the original path

Ian

2012-11-04 17:43:38

I tried making an SPS path for on the way back and it didn't work, although going to the bank worked,so I'm not sure what the problem is..

Panama

2012-11-04 18:07:14

Alright thanks ;> Could any of you suggest me a other way of "walking"? and easy way please C;

Roflme

2012-11-04 19:59:31

After you copy and paste the points of the path, go back and click on a bunch of points SURROUNDING your current path, and then ONLY COPY THE AREA. Your path will be the original one you used before, but the area will be the area those points are in PLUS some surrounding areas.


An alternative is to use the minimap images (Bank symbols, Trees, Ladders, Water sources, Stores, etc.) and move the mouse based on their positions. Although this isn't ALWAYS reliable since the map symbols can change (I think trees and ladders are constant though).

You can also use radialwalk to walk along a road. I don't use this though so I can't help you with that.

Mat

2012-11-05 13:07:40

From: Roflme

procedure MineRock;
var
x, y, t, PlusOne: integer;
begin
PlusOne := InvCount + 1
repeat
if FindObj(x, y, 'lay',7845078,10) then
MarkTime(t);
Mouse(x, y, 5, 5, true);
repeat
Wait(100+random(10));
until(InvCount=PlusOne) or (TimeFromMark(t) > 2000);
until(InvFull);
end;

That won't work well because PlusOne int is only ran once. You'd need it to be called in the first repeat loop.
Also I'd suggest adding a Timer on its so say after 1:40Min it'll loop out the first repeat so you don't have infinite loops.
Mat

Ian

2012-11-05 13:25:23

I can show you how to use radialwalk, but in my experience it is frustratingly inaccurate :(. If you have a low tolerance it will not walk anywhere if the colours change when you hop worlds/teleport, and if you have a higher tolerance then it will just click anywhere in the radian, so you need to make them small. So want to try Radialwalk? If you do I'll help where I can :)

EtherFreak

2012-11-05 18:29:59

Perhapse this could be of some use.

//from SRL RunAway
//reused by etherfreak
//runs in a specified direction and a specified distance. direction is 0-360 degrees, with 0 being N
//rads is the radius from the character. try to keep this between 20-70.
//also, no randoms incorperated, so use your own randoms!
procedure RunDir(dir: variant; Rads: Integer);
var
Deg: extended;
begin
if (not LoggedIn) then exit;
Deg := variantToDirection(dir);
Deg := Deg + Random(2);
SetRun(True);
MFNF(Trunc(Rads * Sin(Radians(FixD(Rs_GetCompassAngleDegrees + Deg))) + MMCX + Random(5)),
Trunc(-Rads * Cos(Radians(FixD(Rs_GetCompassAngleDegrees + Deg))) + MMCY + Random(5)), 1, 1);
FFlag(0);
Wait(500 + Random(1500));
end;

It works better the radial walk for short walking distances. using this incorporated with symbol finding may be what you need.