SRL Archive - OSR Help

MapWalking help.


mounty1

2010-01-14 13:44:46

Hi,

im not very good at script writing but i'm giving it a go. I'm currently writing a edgeville cooking script but im having some trouble with the walking procedures. I only need the script to walk to the red carpet in the bank and the light brown path outside the house. I've tried using DTMs ive tried radial walking but i cant get any of them to work. Could anyone help me with suggestions on what method i should be using. i don't understand what im doing wrong. it makes sense in my head but for some reason the codes ive been using have failed. Any help is much appreciated.

Cheers
:(

NCDS

2010-01-14 14:10:59

First thing's first, it's radial walking ;)

Secondly, if you post your code we can always help you with problems.

Last thing, learn tpa's or just usage of arrays in general. Honestly, I can't even begin to explain how many people I tell that to. When you have the ability to use array's you have the ability to complete any RuneScape related task.

This is an example of tpa walking from my old FlaxSpinner:
(NOTE: GetColorPoints(); was just my own variation of Scar's FindColorsSpiralTolerance(); )

function Walk(Path: Integer): Boolean;
var x, y, i, a: Integer; cArr: array of TPoint; P: TPoint; Bool: Boolean;
begin
case Path of
//To Stairs.
1 : begin
Writeln('Walking to stairs...');
for i := 0 to 5 do
begin
cArr := GetColorPoints(x, y, FindLadderColor, 590, 97, 625,
147, 1, 1, tol);
if Length(cArr) < 1 then
Continue;
P := MiddleTPA(cArr);
Mouse(P.x, P.y, 1, 0, True);
Flag;
if WaitLoc('upstairs') or WaitLoc('downstairs') then
begin
Result := True;
Writeln('Walk(1); Complete.');
Wait(500 + Random(50));
Exit;
end;
end;
end;
//To Spinning wheel.
2 : begin
if not WaitLoc('downstairs') then Exit;
Writeln('Walking to spinning wheel...');
cArr := GetColorPoints(x, y, 13417647, 414, 58, 470, 113, 1, 1, 15);
if Length(cArr) < 1 then
begin
Writeln('Window Color Returned 0 Results.');
Exit;
end;
for i := 0 to High(cArr) do
begin
if (Distance(cArr[i].x, cArr[i].y, MSCx, MSCy) > 235) or
(Distance(cArr[i].x, cArr[i].y, MSCx, MSCy) < 130) then
Continue;
MMouse(cArr[i].x - 40, cArr[i].y, 2, 2);
Wait(80 + Random(30));
if IsUpText('alk here') or IsUpText('pinning wheel') then
begin
Bool := True;
Break;
end;
end;
GetMousePos(x, y);
Mouse(x, y, 1, 1, Bool);
WaitOption('alk here', 3000);
Flag;
Result := WaitFunc(@SpinScreen, 650, 5000);
if not Result then
Result := WaitFunc(@OpenScreen, 650, 5000);
if Result then
Writeln('Walk(2); Complete.');
end;
//To Bank. 4694448
3 : begin
if not WaitLoc('upstairs') then Exit;
Writeln('Walking to bank...');
cArr := GetColorPoints(MMCx, MMCy, FindLadderColor, MMx1,
MMy1, MMCx - 8, MMCy - 5, 1, 1, 3);
for i := 0 to High(cArr) do
begin
if Length(cArr) < 1 then
Continue;
if (Distance(cArr[i].x, cArr[i].y, MMCx, MMCy) > 52) then
Continue;
Mouse(cArr[i].x + 38, cArr[i].y + 4, 4, 1, True);
FFlag(2);
Break;
end;
//Wait(1200 + Random(80));
Result := WaitFunc(@AtBank, 150, 1500);
if Result then
Writeln('Walk(3); Complete.');
end;
end;
end;
So you have something for reference.. ;)

mounty1

2010-02-03 22:13:58

thanks for the help.
Had a break from that part of the script.
i'll look back into it.
hope it works and i dont make too many mistakes.

thanks