SRL Archive - RS3 Outdated / Broken Scripts

Jim's Simple Lumby Flax Spinner


jimthesoundman

2010-02-02 14:27:33

Here is a quick'n'dirty script that spins flax in Lumbridge.

No DTM's or BMP's, and only one minor color check to see if your inventory is full.

Since it is not very complicated, and there aren't many failsafes, I highly recommend you don't leave this unattended.

However it works fine and I have spun over 20K flax with it while testing over the past couple days.

Any constructive comments, questions, or suggestions are welcomed.

JIM

Frement

2010-02-02 14:30:26

Ok, i did a quick sweep through the script, and i noticed you are clicking the option blindly, shouldnt you use like ChooseOption('');?

Else it looked good.

Dynamite

2010-02-02 15:13:38

The Man's Report:

You have:

runs:=100;     //How many runs to the wheel?
and
Players[0].Integers[1] := 0;     //Amount of Loads you want Banked, Change to zero if
//you want to stop once gained a certain amount of 'levels'.
You only need 1 ;)

Also you have:

PinNumber:=1234;  //Replace these numbers with your pin number
and
Players[0].Pin := '';            //Leave blank if you dont have one.
Again you only need one.
For both of the above, I suggest keeping the Players[Blah] one, for ease of use.

procedure Banking;
begin
ClickNorth(true);
repeat
if not OpenBankNPC then
if not OpenBank('lb',false,false) then
if not FindBank('lb') then
if not OpenBankGlass('lb', false, false) then
OpenBankFast('lb');
if PinScreen then InPin(IntToStr(PinNumber));
until BankScreen;
FindNormalRandoms;
//if InvCount>0 then //this is temporarily broken, using substitute below
//begin
//DepositAll;
//wait(1000+random(1000));
//end;
mouse(397,307,10,10,true); //Substitute for InvCount and DepositAll
wait(1000+random(1000));
//end;
mouse(53,107,10,10,false); //Rightclick on flax
getmousepos(xx,yy);
wait(500+random(500));
mouse(xx,yy+103+random(2),30,0,true); //Left click on withdraw all
wait(500+random(500));
CloseBank;
end;
Here is my version of yours:
procedure Banking;
begin
ClickNorth(true);
repeat
OpenBankFast('lb');
if PinScreen then InPin(IntToStr(PinNumber));
until BankScreen;
FindNormalRandoms;
if FindDTM(StringDTM, x, y, MIX1, MIY1, MIX2, MIY2) then // make a string DTM
if IsUpText('tring') then
begin
Mouse(x, y, 0, 0, False);
WaitOption('it-All', 250));
end;
if FindDTM(FlaxDTM, x, y, MBX1, MBY1, MBX2, MBY2) then
begin
Mouse(x, y, 0, 0, False);
WaitOption('aw-All', 250));
end;
CloseBank;
end;
Make the DTM's and it should be good.
I didn't make the failsafes for you though.

For
Procedure RunToStairs;
Use RadialWalk.

Again, for
procedure ClickOnWheel;
Use a DTM.

Your version of Spin
procedure Spin;
begin
mouse(265,125,28,34,false); //rightclick bowstring
getmousepos(xx,yy);
mouse(xx,yy+60,5,2,true); //click on "make all"
wait(4000+random(20000));
makecompass('S');
repeat
wait (1000+random(100));
until not findcolortolerance(x,y,11710030,560,210,725,460,10); //until no flax left in inventory
end;

My version of Spin
procedure Spin;
begin
if FindDTM(MSStringDTM, x, y, MSX1, MSY1, MSX2, MSY2) then //New String DTM for MainScreen?
begin
Mouse(x,y,0,0,False);
WaitOption('ke-All', 250));
end;
makecompass('S');
repeat
wait (1000+random(100));
until not FindDTM(FlaxDTM, x, y, MIX1, MIY1, MIX2, MIY2); //Using DTM instead of color.
end;

Again for
procedure GoBackUpstairs;
Use RadialWalk.
Also a DTM or BMP or TPA for stairs.

Use RadialWalk for:
procedure RunToBank;

Apart from that nice script :)

Scripting Notes:
Learn DTMs (If you haven't already)
Also, if you have the patience learn TPAs (Probably most important and useful thing in scripting :) )
Get used to RadialWalk :)

If you have any questions or dont understand something, just shoot me a PM.

T~M

jimthesoundman

2010-02-02 19:15:38

But my point is… why go to the bother of DTM's and TPA's when they aren't needed? People tend to make scripts too complex for no reason.

There are two points in this script when you are in a guaranteed spot:
1) When you are at the bank window.
2) When you are at the wheel.

When you ascend and decend the stairs you are not always in the same spot, but you are pretty close every time to the same spot, so why go to all the trouble of finding out where you are, when you pretty much know where you are at all three spots? It's a waste of code.

So, since at all three of those spots you can "see" your next destination, isn't it simpler just to click on that next destination instead of walking towards it and THEN trying to find where it is? It just doesn't make sense to do it the hard way when this is the easy way. Less code and less chance for mistakes it seems to me.

The only drawback in my way of doing things is that when you do setcompass, we all know that it doesn't come out the exact direction you want. Jagex makes the "south" compass vary between 175 and 185 degrees to throw off our scripts, so if there was a way to set the compass exactly south I would be guaranteed this script would never fail.

So if anyone can tell me why making a simple thing more complex makes it better, I'm glad to listen. I think we all should be working towards making simpler and more effective scripts, as that way there are fewer ways they can break in the future when Jagex does updates and such.

i luffs yeww

2010-02-02 19:32:00

Well it's not always because it's the best for THIS script, but why not learn them? ;) Even if you made a script that will click one time and that's it, if you can implement some extremely well working TPA's and such, then eventually you can turn that one blind click into a check to see where you are. And you can use that to help the script fix itself, or take a screen shot of it to show errors. :) Hope that made sense.

jimthesoundman

2010-02-02 19:48:05

Well, I agree that when one has a complicated problem in a script it takes complicated techniques to overcome them. But there is no sense in killing a fly with a sledgehammer.
Simple scripts break less often, but you are correct, there is a sacrifice and that sacrifice is error correction. So it's a tradeoff, I guess.

i luffs yeww

2010-02-02 20:03:10

x] Haha I agree with you, I'm just saying that it's always good to learn some of these things. :p Efficiency is my biggest problem in botting, since I can usually be just as efficient or (usually) more efficient than a script, even if I hardly pay attention. So I don't really auto.. But when I do, I make sure it's as efficient as it can be, which sometimes means I take the risk of the script failing, which is where I often use TPAs and what not to see if I can fix it. If fixing it takes 20 minutes for the script, and 30 seconds for a real person, then it's fine by me as long as the script is generally just as efficient (sometimes more, since humans get side tracked quite often). :>

But, again, I agree with you that if it works, why change it? ^^