SRL Archive - RS3 Outdated / Broken Scripts

[R]Lumbridge West Swamp Miner + Banker


bbri06

2010-05-29 16:44:32

You will need reflection to run this script.
Start your character(s) in the mine near a rock you want to mine.

This script is designed to mine any combination of coal, mithril, and adamantite at the west Lumbridge swamp mine. It will then bank in Draynor.

I'd appreciate any feedback you can give.

Progress Report -

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
Bbri06s Lumbridge Swamp Miner
Time running: 3 Hours, 18 Minutes and 3 Seconds

- Current Character Report -
Banked 153 mithril ores.
Banked 431 coal ores.
Banked 0 adamantite ores.

- Combined Report -
Banked 153 mithril ores.
Banked 431 coal ores.
Banked 0 adamantite ores.
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
Bbri06s Lumbridge Swamp Miner
Time running: 4 Hours, 2 Minutes and 3 Seconds

- Current Character Report -
Banked 159 mithril ores.
Banked 506 coal ores.
Banked 0 adamantite ores.

- Combined Report -
Banked 159 mithril ores.
Banked 506 coal ores.
Banked 0 adamantite ores.
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

gamer716

2010-05-29 17:38:50

first :)
will test and post proggy!

i luffs yeww

2010-05-29 17:49:09

No need for Players[].Integers[0]. :) You can simply do..


function HowManyRocks: Integer;
var
i: Integer;
begin
Result := 0;
for i := 0 to 2 do
IncEx(Result, BoolToInt(Players[CurrentPlayer].Booleans[i]));
end;

^^ Less room for error setting up the script.


if (R >= 43) and (R <= 103) and (G >= 43) and (G <= 104) and (B >= 56) and (B <= 134) then

Can be slightly shortened (I think it's better for readability, as well) to


if(InRange(R, 43, 103) and InRange(G, 43, 104) and InRange(B, 56, 134))then

And the same goes for the other AC functions. :)

I think there's one for extended, as well, but I'm not sure. :(

IMPROMPTU FloatInRange! :D

Add


{*******************************************************************************
function FloatInRange(e, Min, Max: Extended): Boolean;
by: i luffs yeww
Description: Returns true if e is within Min and Max.
*******************************************************************************}
function FloatInRange(e, Min, Max: Extended): Boolean;
begin
Result := (e > Min) and (e < Max);
end;

to the beginning of script and instead of the ugly Z < 4.13 and Z > 2.61 gibberish, just do


if(FloatInRange(z, 1.3, 6.01))then

etc.

Also, in all of your AC functions you have an if then at then end, but you commented out the Writeln. :p So it won't do anything. Just sayin'.


StartP := 0; //StartP = 0
z := 0; //z = 0
for i := 0 to High(Path) do
begin
ThePoint := TileToMM(PointToTile(Path[i].x, Path[i].y));
if(RS_OnMiniMap(ThePoint.x, ThePoint.y))then//also, below line could simply be if(i >= StartP)then :p
if(i > StartP)or(i = StartP)then //if first point is found, then both i and StartP will be 0
begin //#
StartP := i; //StartP = i, so i will always be greater than or equal to i, so this will always happen //#
z := z + 1; //This will always happen as well, so lines marked with # could be removed, I think.
end; //#
end;

I think my logic is right for the above.


if(z = 0)then
begin
Writeln('No path points found... hmm..');
Result := 0;
Exit;
end

^ Won't ever happen, I don't think.


for i := StartP to High(Path) do

i and StartP will both be 15 at that point. (Or 14, I guess..)

NoPath won't ever get past


z := WalkPath(Path);

according to what I posted above.


if(Length(TPA) > 4)then
Result := True;

==


Result := (Length(TPA) > 4);

x]


if(BadCount > 2)then
Result := False
else
Result := True;

==


Result := (BadCount < 3);

:)


if(GetAnimation = 624)then
Result := True
else
Result := False;

==


Result := (GetAnimation = 624);


if(BankScreen)then
Break;
if(PinScreen)then
Break;

==


if(BankScreen or PinScreen)then
Break;


if(Players[CurrentPlayer].Booleans[3])then
Deposit(1, 28, true)
else
Deposit(2, 28, true);

==


Deposit(1 + Players[CurrentPlayer].Booleans[3], 28, True);

And this last one is just personal preference. :) I don't see any reason to show blank things like "Banked 0 coal ores."


procedure ProgressReport;
begin
Writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/');
Writeln('Bbri06s Lumbridge Swamp Miner ');
Writeln('Time running: ' + TimeRunning);
Writeln('');
Writeln('- Current Character Report -');
if(Players[CurrentPlayer].Booleans[0])then
Writeln('Banked ' + IntToStr(MOres[CurrentPlayer]) + ' mithril ores.');
if(Players[CurrentPlayer].Booleans[1])then
Writeln('Banked ' + IntToStr(COres[CurrentPlayer]) + ' coal ores.');
if(Players[CurrentPlayer].Booleans[2])then
Writeln('Banked ' + IntToStr(AOres[CurrentPlayer]) + ' adamantite ores.');
Writeln('');
Writeln('- Combined Report -');
if(SumIntegerArray(MOres) > 0)then
Writeln('Banked ' + IntToStr(SumIntegerArray(MOres)) + 'mithril ores.');
if(SumIntegerArray(COres) > 0)then
Writeln('Banked ' + IntToStr(SumIntegerArray(COres)) + ' coal ores.');
if(SumIntegerArray(AOres) > 0)then
Writeln('Banked ' + IntToStr(SumIntegerArray(AOres)) + ' adamantite ores.');
Writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/');
end;

I ALSO SUGGEST THAT FloatInRange(e, Min, Max: Extended): Boolean; is to be added to SRL/MML! :)

bbri06

2010-05-29 19:20:57

From: i luffs yeww
No need for Players[].Integers[0]. :) You can simply do..


function HowManyRocks: Integer;
var
i: Integer;
begin
Result := 0;
for i := 0 to 2 do
IncEx(Result, BoolToInt(Players[CurrentPlayer].Booleans[i]));
end;

^^ Less room for error setting up the script.


There is no BoolToInt function as far as I know, and I don't really think it's to much of a hassle to put in a number.



if (R >= 43) and (R <= 103) and (G >= 43) and (G <= 104) and (B >= 56) and (B <= 134) then

Can be slightly shortened (I think it's better for readability, as well) to


I just use ACA for all my AC functions and whatever it spits out I use.


Also, in all of your AC functions you have an if then at then end, but you commented out the Writeln. :p So it won't do anything. Just sayin'.


Fixed that.



StartP := 0; //StartP = 0
z := 0; //z = 0
for i := 0 to High(Path) do
begin
ThePoint := TileToMM(PointToTile(Path[i].x, Path[i].y));
if(RS_OnMiniMap(ThePoint.x, ThePoint.y))then//also, below line could simply be if(i >= StartP)then :p Bbri06: fixed it
if(i > StartP)or(i = StartP)then //if first point is found, then both i and StartP will be 0
begin //#
StartP := i; //StartP = i, so i will always be greater than or equal to i, so this will always happen //# Bbri06: StartP = i doesn't set StartP equal to i, it checks to see if it is. StartP := to i would set them equal, I believe.
z := z + 1; //This will always happen as well, so lines marked with # could be removed, I think.
end; //#
end;




if(z = 0)then
begin
Writeln('No path points found... hmm..');
Result := 0;
Exit;
end

^ Won't ever happen, I don't think.


Highly unlikely to happen, but if there are no tiles that I am searching for on the minimap, then it will.



for i := StartP to High(Path) do

i and StartP will both be 15 at that point. (Or 14, I guess..)


Not always. If tile wasn't on the map then StartP won't change.


NoPath won't ever get past


z := WalkPath(Path);

according to what I posted above.


But it does because z can be 0 and I've seen it happen while testing :)



if(Length(TPA) > 4)then
Result := True;
…
…
…



Fixed all the result stuff, thanks.



Deposit(1 + Players[CurrentPlayer].Booleans[3], 28, True);


You cannot add 1 to a boolean :confused:

~~

Thanks for the feedback :)

i luffs yeww

2010-05-29 19:28:49


var
wat: Boolean;

begin
wat := True;
Writeln(1 + Integer(wat));
end.

That's what I meant to do. :p But Wizzup? frowns upon type changes, I think. So it's up to you. It'd just make it a little shorter, and look sexier in my opinion. :p

And for the BoolToInt I used before, replace BoolToInt with Integer. :p But yeah, it doesn't really matter for having that extra Integer setting in DeclarePlayers.

bbri06

2010-05-29 23:40:58

Uploaded a small update with a couple more fail safes.

kevinconklin

2010-05-31 07:55:04

any chance u could make it superheat your ores so u can stay there longer and get more profit and xp? just a thought, but i will try this soon

gamer716

2010-05-31 10:06:28

Bbri06s Lumbridge Swamp Miner
Time running: 1 Hours, 36 Minutes and 33 Seconds

- Current Character Report -
Banked 55 mithril ores.
Banked 112 coal ores.
Banked 0 adamantite ores.


Don't know why it stopped working, found player in the mine

Najorin

2010-05-31 14:24:36

Reserved for proggy to come… as soon as I can get about 60 mining, will test.

Or rather, for reflection to be released… which, thank god, is gonna be pretty soon! <a week? 2 weeks? :D

bbri06

2010-05-31 14:53:30

From: kevinconklin
any chance u could make it superheat your ores so u can stay there longer and get more profit and xp? just a thought, but i will try this soon


It's a possibility.

From: gamer716
Don't know why it stopped working, found player in the mine


I can't really say either. A few lines of debug above where it stopped working would help me figure it out.

JokeAss

2010-07-07 13:56:08

This gives me a compile error for some reason…

[Error] C:\Program Files (x86)\Simba\Includes\SRL/SRL/Reflection\./Core/Core.simba(108:3): Unknown identifier 'MarkTime' at line 107

kufo

2010-07-10 12:49:33

From: JokeAss
This gives me a compile error for some reason…

[Error] C:\Program Files (x86)\Simba\Includes\SRL/SRL/Reflection\./Core/Core.simba(108:3): Unknown identifier 'MarkTime' at line 107



Yep this script don't work for me either. And i have run other scripts that require simba/refelction and works just fine. Soo it might be the script. Dont quote me on htat though.

bbri06

2010-07-10 17:03:23

Yeah… I haven't really updated this in a long time. You can consider it dead.

Nosidak

2010-08-08 08:53:23

Could you please update this

i luffs yeww

2010-08-08 09:16:29

MSI supports Lumbridge west mine I believe.

Nosidak

2010-08-08 17:38:23

thanks