SRL Archive - First Scripts

BuckWild Tinderbox Buyer


BuckWild

2011-12-08 16:06:16

So this is my first script. Makes about 100k gp/hour. Any and all comments are welcome.
START WITH GP IN MONEY POUCH

Bugs: All of these I've tried to work around and have had little to no luck so any help on these would be awesome!
1. Sometimes doesn't finish path and thinks it's at Ignatius or the bank.
2. If Ignatius is off the map it will wait until he is instead of find him with an easier way. Not a huge deal as he moves quite frequently.
3. I get a out of bounds error, again not a huge deal but the debug spam is somewhat annoying.
4. Bank pin handling, I can figure this out just haven't had a chance to.
5. Post em :)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TinderBuyerbyBuckWildVBeta
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Boxes Bought:1372
Estimated Profit:150920
Time Running:1 Hours, 31 Minutes and 58 Seconds
Loads Done:49

Features:
SPS walking to and from the bank.
Decent anti-ban
Should check energy, if it's below 35 it should rest until 100%
Decent Fail safes
SRL stats
Decent Proggy

Setup:
1. Username/pass
2. SRL username/pass
3. Start somewhere between camelot bank and the firemaking cape seller.

Current Version: Beta


program BuckWildTinderBuyer;
{$DEFINE SMART}
{$i srl/srl.scar}
{$i sps/sps.simba}
{$i srl/srl/misc\stats.simba}


const
{---SMART Setup Constants---}
WORLD = 45;// Set a world, if you'd like.
MEMBERS = False;// Change accordingly.
SIGNED = True; // True if running a single account, false otherwise.
{---------------------------}
{--------Script Info--------}
Author = 'BuckWild';
Name = 'TinderBuyer';
Version = 'Beta';
{---------------------------}
SRLStats_User = ' '; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ' '; // Your SRL Stats Password (If you dont have one then just leave it as it is)
{---------------------------}

Var
Loads, Profit, Boxes: Integer;
GoBank, GoIg: TPointArray;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ' '; // Username
Players[0].Pass := ' '; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use this player
Players[0].Pin := '0000'; // Leave blank if the player doesn't have a bank pin
end;

procedure AntiBan;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
case Random(6) of
0: BoredHuman;
1: BoredHuman;
2: ExamineInv;
3: RandomMovement;
4: RandomAngle(True);
5: RandomMovement;
end;
end;

procedure ProgressReport;

begin
Cleardebug;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn(Name + 'by' + Author + 'V' + Version);
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn('Boxes Bought:' + IntToStr(Boxes));
WriteLn('Estimated Profit:' + IntToStr(Profit));
WriteLn('Time Running:' + TimeRunning);
WriteLn('Loads Done:' + IntToStr(Loads));
SRLRandomsReport;
Stats_Commit;
end;

procedure WalkToIgnatius;
var x, y: integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
WriteLn('Walking To Ignatius!');
GoIg := [Point(2735, 2675), Point(2735, 2710), Point(2740, 2770),
Point(2745, 2815), Point(2720, 2865), Point(2715, 2915)]
if (SPS_WalkPath(GoIg)) then
WriteLn('At Ignatius');
if FindColorTolerance(x, y, 846335, MMCX, MMCY, MMx2, MMy2, 10) then
Mouse(x, y, 1, 1, true);
wait(randomrange(250, 500));
end;

procedure WalkToBank;
var x, y: integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
WriteLn('Walking To Bank!');
GoBank := [Point(2715, 2915), Point(2720, 2865), Point(2745, 2815),
Point(2740, 2770), Point(2735, 2710), Point(2735, 2675)]
if (SPS_WalkPath(GoBank)) then
WriteLn('At Bank');
end;



procedure FindIg;
var x, y, a, b: Integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
repeat
repeat
Wait(RandomRange(750, 1000));
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '));
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
Wait(RandomRange(500, 750));
end;

procedure BuyBoxes;
var Box, a, b, x, y: Integer;
begin
Box := DTMFromString('mlwAAAHicY2dgYOABYnYgFmKAABYg5gdiKSDmA2JmqDgvEEsAsSRU3FQPpIsJK5ZkwA0Y8WAoAACE0wFN');
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
repeat
repeat
if FindObjEx(x, y, ['inde', 'rbox'], [5856093, 470325], 15, 50, 31, 56, 61, 96) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('50'));
Wait(RandomRange(750, 1250));
until(FindDTM(Box, a, b, MIX1, MIY1, MIX2, MIY2));
Mouse(488, 21, 2, 2, true);
Writeln('Bought The Boxes!');
Boxes := Boxes + 28;
Profit := Boxes * 110;
Loads := Loads + 1;
stats_IncVariable('Loads Done', 1);
FreeDTM(Box);
end;

Procedure BankEm;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
if (not (LoggedIn)) then
exit;
begin
repeat
OpenBank('clt', true, true);
Wait(RandomRange(250, 350));
until(BankScreen);
Wait(RandomRange(750, 1250));
begin
Deposit(1, 28, true);
Wait(RandomRange(500, 750));
CloseBank;
WriteLn('Banked!')
end;
end;
end;

procedure RunRunRun;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
if not RunEnergy(35) then
begin
if RestUntil(100) then
end;
SetRun(true);
end;
begin
Smart_Server := WORLD;
Smart_Members := MEMBERS;
Smart_Signed := SIGNED;
Smart_SuperDetail := False;
SetupSRL;
SetupSRLStats(299, SRLStats_User, SRLStats_Password);
DeclarePlayers;
LoginPlayer;
SPS_Areas := ['6_6', '6_7'];
SPS_Setup(RUNESCAPE_SURFACE, SPS_Areas);
repeat
ProgressReport;
RunRunRun;
WalkToIgnatius;
FindIg;
BuyBoxes;
AntiBan;
WalkToBank;
BankEm;
AntiBan;
until AllPlayersInactive;
end.

[XoL]

2011-12-08 17:59:13

Grats on first script looks good :)

Mark

2011-12-08 18:20:42

hey man grats on your first script will give you some ideas now

Here we go…..
This Actually goes for a few of your procedures you should check if your logged in before anything else..
also you got if FindNormalRandoms Then you could just do FindNormalRandoms;
procedure AntiBan;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
case Random(6) of
0: BoredHuman;
1: BoredHuman;
2: ExamineInv;
3: RandomMovement;
4: RandomAngle(True);
5: RandomMovement;
end;
end;
This is what you would do
procedure AntiBan;
begin
if Not LoggedIn Then Exit;
FindNormalRandoms;
case Random(6) of
0: BoredHuman;
1: BoredHuman;
2: ExamineInv;
3: RandomMovement;
4: RandomAngle(True);
5: RandomMovement;
end;
end;
Not much just makes sense

And remember not to use infinite loops
      until(ChooseOption('de ')); 
do something like

repeat
wait(900+RandomRange(100,150));
Inc(i);
until(ChooseOption('de '))or (i >=15000)
if (i >=15000)then
begin
writeln('failed to choose option do failesafe');
exit;
end else
//continue rest of script
this will wait 15 seconds if not found continue into a failsafe
just a few suggestions

BuckWild

2011-12-08 19:15:32

Thanks a ton for the feedback! I'll fix the log in aswell as antirandoms when I get home! As for the infinite loop, this is exactly what I was looking for. I think adding a rotation in the compass on top of this will allow it to find the seller even when he's wandered off the main screen. Thanks! One more thing, sometimes it will trade when he is lighting a fire, returning true however the trade screen won't be open. For this I was thinking of using a bitmap for the trade screen, not including the boxes since the quantity will change with each run. Thoughts on this?

Thanks
Buck

From: CRU1Z1N
hey man grats on your first script will give you some ideas now

Here we go…..
This Actually goes for a few of your procedures you should check if your logged in before anything else..
also you got if FindNormalRandoms Then you could just do FindNormalRandoms;
procedure AntiBan;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
case Random(6) of
0: BoredHuman;
1: BoredHuman;
2: ExamineInv;
3: RandomMovement;
4: RandomAngle(True);
5: RandomMovement;
end;
end;
This is what you would do
procedure AntiBan;
begin
if Not LoggedIn Then Exit;
FindNormalRandoms;
case Random(6) of
0: BoredHuman;
1: BoredHuman;
2: ExamineInv;
3: RandomMovement;
4: RandomAngle(True);
5: RandomMovement;
end;
end;
Not much just makes sense

And remember not to use infinite loops
      until(ChooseOption('de ')); 
do something like

repeat
wait(900+RandomRange(100,150));
Inc(i);
until(ChooseOption('de '))or (i >=15000)
if (i >=15000)then
begin
writeln('failed to choose option do failesafe');
exit;
end else
//continue rest of script
this will wait 15 seconds if not found continue into a failsafe
just a few suggestions

Mark

2011-12-08 19:50:00

just look for a color of the trade screen or take me a picture and ill show you

BuckWild

2011-12-08 21:29:55

That's why I implemented this however it still seems to do it. I may change it to find the orange text of the shop name and see if that helps but as is it finds the brown area of the trade screen. I'm going to first try it with the trade screen coordinates instead of the whole main screen, then the orange, and if all else fails the bitmap.

edit: I tried to implement your infinite loop solution with a few modifications but I can't seem to get it to work. After successfully trading it continues to look for the npc instead of the boxes while in the trade screen.


procedure FindIg;
var x, y, a, b: Integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
repeat
repeat
Wait(RandomRange(750, 1000));
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '));
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
Wait(RandomRange(500, 750));
end;

From: CRU1Z1N
just look for a color of the trade screen or take me a picture and ill show you

Mark

2011-12-08 22:03:43

procedure FindIg;
var x, y, a, b: Integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
repeat
repeat
Wait(RandomRange(750, 1000));
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '));
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
Wait(RandomRange(500, 750));
end
Remember what i told you before
procedure FindIg;
var x, y, a, b: Integer;
begin
if Not LoggedIn Then
FindNormalRandoms;
Exit;
repeat
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '))
if(ChooseOption('de '))then
begin
repeat
Wait(0);
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
end
still needs failsafes adding going to bed now :D

BuckWild

2011-12-09 10:07:52

Ooh I see what you did there thanks!

From: CRU1Z1N
procedure FindIg;
var x, y, a, b: Integer;
begin
if FindNormalRandoms Then
if Not LoggedIn Then
Exit;
repeat
repeat
Wait(RandomRange(750, 1000));
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '));
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
Wait(RandomRange(500, 750));
end
Remember what i told you before
procedure FindIg;
var x, y, a, b: Integer;
begin
if Not LoggedIn Then
FindNormalRandoms;
Exit;
repeat
if FindObjEx(x, y, ['gnat', 'tius'], [4416410, 11185842, 2331133], 20, 50, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 1, 1, false);
until(ChooseOption('de '))
if(ChooseOption('de '))then
begin
repeat
Wait(0);
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20));
end
still needs failsafes adding going to bed now :D

Mark

2011-12-09 10:28:42

Yh sorry I was half asleep forgot to explain what I actually did do your understand where you was going wrong?

BuckWild

2011-12-09 11:02:18

From: CRU1Z1N
Yh sorry I was half asleep forgot to explain what I actually did do your understand where you was going wrong?


Yes however how would this fix it since it won't repeat the whole procedure until it finds it? Sometimes the trade doesn't open the screen even though it trades because the npc is busy

Mark

2011-12-09 11:25:46

From: BuckWild
Yes however how would this fix it since it won't repeat the whole procedure until it finds it? Sometimes the trade doesn't open the screen even though it trades because the npc is busy


Like I said you need to add you own failsafes

if(ChooseOption('de '))then
begin
repeat
Wait(1000);
Inc(timer);
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20))or (timer>=5000)
If timer>5000 then
Begin.
//Wateva this procedure is called
End;
end;

This need more adding only so much can do without writing it all my self.

But what it does is if it doesn't find the trade screen within 5 seconds it will try again

BuckWild

2011-12-09 11:51:45

Thank you for withholding the info :) all about the learning.

So, just to clarify, where it says whateva this procedure is called Id put in something that would find and trade the npc again?

Mark

2011-12-09 13:10:51

All you really need is this
FindIg;
And it will work but you will won't to failsafe that so it doesn't loop forever

BuckWild

2011-12-09 13:35:18

From: CRU1Z1N
All you really need is this
FindIg;
And it will work but you will won't to failsafe that so it doesn't loop forever


Right, thanks a lot man.
I'll implement all of this in couple hours or late tonight and post the results

Mink

2011-12-10 13:29:34

great first script, only a few bugs. from testing i've found:
1) has difficulty finding the banker
2) when vulcan isnt on the screen the script wont function
3) occasionally freezes up at the end path to vulcan

tim23

2012-12-14 04:00:58

Does this script still work? Been looking everywhere for a tinderbox bot..

tealc

2012-12-14 05:47:32

nice script

From: CRU1Z1N

if(ChooseOption('de '))then
begin
repeat
Wait(1000);
Inc(timer);
until(FindColoredAreaTolerance(a, b, 3226693, MSX1, MSY1, MSX2, MSY2, 81, 20))or (timer>=5000)
If timer>5000 then
Begin.
//Wateva this procedure is called
End;
end;


A few more tips that might be hard to figure out yourself.
1)When you open the trade interface the icons for friendslist, inventory, worn equiptment, etc disapear so just you can use that to confirm you opened the trade screen
2) If you convert your procedures that could fail into functions that return boolean. The boolean is whether or not the procedure was successful. Then call it with something like this:



While(FindIg)
begin
wait(x)
end

Dynamite

2012-12-14 05:51:52

This is over a year old guys, check the date before posting :)

-Boom