SRL Archive - First Scripts

Keldaminer - path issues


darkfire23

2013-06-18 04:59:39

Hey guys,

Working on my first script using the barebone of some old out of date keldaminers. Ive worked on the mining portion and have it perfected, but i'd still love to bank.

Procedure AllMyPaths;
begin
// Bankpath := [Point(287, 127), Point(289, 177), Point(246, 197), Point(227, 236), Point(191, 253), Point(159, 292)];
// MiningPath := [Point(159, 287), Point(189, 259), Point(190, 215), Point(218, 202), Point(258, 195), Point(291, 176), Point(294, 140)];
end:

Procedure ToBanking;
Begin
SetRun(True);
MakeCompass('n');
SPS_WalkPath(Bankpath);
While isMoving Do
wait(100+random(50));
IfRandoms;
End;

It keeps giving me a mismatch @ my Bankpath? im confused so any help would be greatly appreciated!

okokokok

2013-06-18 05:43:32

Try this:

program Keldaminer;
var BankPath, MiningPath: TPointArray;

Procedure AllMyPaths;
begin
Bankpath := [Point(287, 127), Point(289, 177), Point(246, 197), Point(227, 236), Point(191, 253), Point(159, 292)];
MiningPath := [Point(159, 287), Point(189, 259), Point(190, 215), Point(218, 202), Point(258, 195), Point(291, 176), Point(294, 140)];
end:

Procedure ToBanking;
Begin
SetRun(True);
MakeCompass('n');
SPS_WalkPath(Bankpath);
While isMoving Do
wait(100+random(50));
IfRandoms; // Maybe FindNormalRandoms; ????
End;

begin
etc....
end.

EDIT: Do the same for mininpath
EDIT2: Don't know if this is for EÖC or OSR, also don't know if IfRandoms is actually something? Or is that a procedure in your script?

darkfire23

2013-06-18 17:11:27

From: okokokok
Try this:

program Keldaminer;
var BankPath, MiningPath: TPointArray;

Procedure AllMyPaths;
begin
Bankpath := [Point(287, 127), Point(289, 177), Point(246, 197), Point(227, 236), Point(191, 253), Point(159, 292)];
MiningPath := [Point(159, 287), Point(189, 259), Point(190, 215), Point(218, 202), Point(258, 195), Point(291, 176), Point(294, 140)];
end:

Procedure ToBanking;
Begin
SetRun(True);
MakeCompass('n');
SPS_WalkPath(Bankpath);
While isMoving Do
wait(100+random(50));
IfRandoms; // Maybe FindNormalRandoms; ????
End;

begin
etc....
end.

EDIT: Do the same for mininpath
EDIT2: Don't know if this is for EÖC or OSR, also don't know if IfRandoms is actually something? Or is that a procedure in your script?


Oops… Forgot my vars.. :P haha ill test it out when i get home and keep updating my progress. And you're right! IfRandoms is now FindNormalRandoms, but I may create a new function to check for randoms.

okokokok

2013-06-18 18:29:31

Haha good. Let me know if it works!

darkfire23

2013-06-19 20:31:24

From: okokokok
Haha good. Let me know if it works!


finally got a chance to work on it and keep getting this error. Do i have to freedtms before i call my to bank method?

Procedure ToBanking;
Begin
writeln('To Bank');
SetRun(True);
MakeCompass('n');
SPS_Setup(RUNESCAPE_OTHER, ['keldagrim']);
Writeln(toStr(SPS_WalkPath(Bankpath)));
// SPS_WalkPath(Bankpath);
While isMoving Do
wait(100+random(50));
FindNormalRandoms;
End;

To Bank
Error: Exception: The bitmap[3] does not exist at line 664
The following DTMs were not freed: [2]

okokokok

2013-06-20 02:43:43

From: darkfire23
finally got a chance to work on it and keep getting this error. Do i have to freedtms before i call my to bank method?

Procedure ToBanking;
Begin
writeln('To Bank');
SetRun(True);
MakeCompass('n');
SPS_Setup(RUNESCAPE_OTHER, ['keldagrim']);
Writeln(toStr(SPS_WalkPath(Bankpath)));
// SPS_WalkPath(Bankpath);
While isMoving Do
wait(100+random(50));
FindNormalRandoms;
End;

To Bank
Error: Exception: The bitmap[3] does not exist at line 664
The following DTMs were not freed: [2]


I get some of those errors as well, but they don't break my script. The bitmaps are probably from the FindNormalRandoms, I think the same goes for the DTMs. Because if you don't free a DTM, the script will break and you'll get a lot of spam in only a minute. With spam I mean 100+ DTMs not freed messages. So as long as it doesn't break the script I don't see a problem.

darkfire23

2013-06-20 06:48:39

Got walking to work! Used blindwalk instead and it seems to do the job randomly enough lol Ran into some problems with locating the bank however and not sure what the best way to approach it is. Here's me first thought:

Procedure LocateBank;
begin
Wait(2000);
repeat
If(FindObjCustom(x,y, ['Ope', 'pen','Ban','ank','Boot','ooth'], [3960714,3762563,7374742], 105)) then
ClickMouse2(1);
BankOpen := BankScreen;
else
MMouse(x,y,2,2);
until(FindObjCustom(x, y, ['Ope', 'pen','Ban','ank','Boot','ooth'], [3960714,3762563,7374742], 105));
end;
end;

But it doesn't like my CustomObj.
Coordinate of booth is : Point(160,285)
Any thoughts?

okokokok

2013-06-20 07:04:13

You could try Auto Color Aid for the bank color.
Also you could make DTMs of the bank booth etc. Should do the job