SRL Archive - First Scripts

Blaze's Oak Planks


Blazeron

2012-03-03 22:25:55

Hi, I've been working on this Script that makes oak planks i need some suggestions like how to create a fail safe for walking as it occasionally misses its last point.

Another issue im having is the pausing in between banking attempts I would love some help on this

To get it to run have the coins in ur money pouch (or any spot in the inventory other then the first spot)

Have the oak logs sitting in the top Right corner in your bank and begin in the bank




Program Blazes_Oak_planks;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

Var
myPath:TPointArray;
myPathOne:TPointArray;
myPathTwo:TPointArray;
myPathBackup:TPointArray;
myPathBack:TPointArray;
X,Y:Integer;

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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms
end;
end;
end;
procedure Walking;
begin
SetAngle(0);
SPS_Setup(RUNESCAPE_SURFACE,['11_7','11_6','10_6','10_7','12_7','12_6']);//SPS Areas

SetRun(True);

myPath := [Point(4851, 2969), Point(4850, 2943), Point(4876, 2936), Point(4915, 2938), Point(4966, 2934), Point(4979, 2884), Point(4984, 2829), Point(5014, 2782), Point(5034, 2737), Point(5047, 2706), Point(5045, 2685)];
myPathBackup := [Point(4851, 2973), Point(4850, 2941), Point(4887, 2937), Point(4915, 2937), Point(4941, 2936), Point(4967, 2928), Point(4979, 2904), Point(4978, 2875), Point(4987, 2849), Point(4994, 2823), Point(5009, 2806), Point(5014, 2793), Point(5021, 2761), Point(5035, 2740), Point(5047, 2721), Point(5051, 2695), Point(5047, 2686)]

//myPathBack := [Point(5052, 2689), Point(5039, 2734), Point(5019, 2780), Point(4991, 2816), Point(4977, 2862), Point(4974, 2916), Point(4942, 2935), Point(4881, 2939), Point(4847, 2971)];
SPS_WalkPath(myPath);
SPS_WalkPAth(myPathBackup);
//SPS_WalkPath(myPathBack);

end;
Procedure Musician;
begin
if FindObj(x, y, 'alk-to',8344390 , 35) then
Mouse(x,y,5,5, False);
ChooseOption('isten-to');
Antiban;
end;
procedure WalkBack;
begin
SPS_Setup(RUNESCAPE_SURFACE,['11_7','11_6','10_6','10_7','12_7','12_6']);//SPS Areas


myPathOne := [Point(5043, 2685), Point(5041, 2703), Point(5031, 2730), Point(5015, 2791), Point(4997, 2826)];
SPS_WalkPath(myPathOne);
myPathBack := [Point(5049, 2693), Point(5043, 2715), Point(5028, 2743), Point(5011, 2790), Point(4993, 2831)];
SPS_WalkPath(myPathBack);
Wait(2000 + Random(100));
Musician;
Wait(10000 + Random(2000));
myPathTwo := [Point(4985, 2851), Point(4982, 2897), Point(4954, 2937), Point(4902, 2936), Point(4858, 2936), Point(4850, 2970)];
SPS_WalkPath(myPathTwo);

end;

Procedure WithdrawLogs;
begin
if not LoggedIn then Exit;

Mouse(448, 106, 5, 5, False);
ChooseOption('ithdraw-All');
end;
Procedure Bank;
begin
repeat
if not LoggedIn then Exit;
wait(454+random(158))
OpenBankFast(Bank_VE);//in the () thats the bank const of Varrock East
Wait(100 + Random(100));
if PinScreen then
InPin(''); // in the () theres the pin.
Until(BankScreen);


end;

Procedure Sawmill;
begin
wait(300 + Random(100));
if FindObj(x, y, 'alk-to',4278091 , 25) then

if not LoggedIn then Exit;
Mouse(x,y,5,5, False);
ChooseOption('uy-plank');
Wait(2000 + Random(250));
Mouse(331,115,5,5, False);

ChooseOption('ll');
end;
Procedure DepositPlanks;
begin
if not LoggedIn then Exit;
Mouse(578,230,5,5, False);
Wait(100 + Random(100));
ChooseOption('eposit-All');
end;

Procedure MainLoop;
begin
repeat
if not LoggedIn then Exit;
wait(250+random(158));
Bank;
DepositPlanks;
wait(125+random(133));
WithdrawLogs;
Antiban;
Walking;
Sawmill;
wait(125+random(133));
WalkBack;
Antiban;
until(false)
end;
begin
MouseSpeed := 10;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
MainLoop;
end.


Sorry for the poor readability

VillaVuFTW

2012-03-04 00:21:06

Honestly for a first script, I like what you have done..

Try considering ACA or more advanced ATPA for the color finding.. Rather than FindObj.. Makes it much easier….

Standards can be worked on.. but I'm not complaining :) Glad to see you are contributing and took the time to learn!

EDIT: The thing I like about you.. Feb 2012: Join Date… And 6Post

Blazeron

2012-03-04 09:19:38

Thanks for the input, Ya i been all over the forums the last few days just not posting much :)

Gucci

2012-03-04 12:58:28

For your antiban always hovering woodcutting is suspicious use:

 HoverSkill('random', false);

VillaVuFTW

2012-03-04 14:36:34

For antiban, I wouldn't use HoverSkill, as you are only doing the SawMill plank making… Maybe for AntiBan, move the camera a bit like some little guy would do being bored while walking? :)

Or view your friends list :3

Or Maybe something like this

Procedure AntiBan;
begin
Case Random(55);
1..24 Wait(25+RandomRange(23, 28));
25..53 GameTab(tab_Friends); // Think thats right?
end;

Gucci

2012-03-04 14:46:55

or
BoredHuman;

VillaVuFTW

2012-03-04 14:57:23

^^ That too… But does that randomly use different things?? If not.. my anti-ban is better ;3

Gucci

2012-03-04 14:58:48

just spins camera and examines something random

Blazeron

2012-03-04 15:43:39

I've been trying to implement DTMs instead of hardcoding for the oakplanks and depositing but i cannot seem to get simba to recognize my commands the tutorial gave me

program BloodRune;
{$i SRL\SRL.scar}//We need this in all scripts.
var
x, y, Blood: Integer;// We Declare our DTM, x and y as Integers.
begin//Begins program.
ClearDebug;//Clears debug, keeps it clean.
SetupSRL; //Enables SRL.
Blood := DTMFromString('mggAAAHicY2NgYJjOxMAwCYj7gXgOEM9jgo hxMTIwMAMxJxItBMQ1UoIM5UWFDMlxcQxdLc0MDdXVDGFBQQz8 QLOwYUYcGAIAoIoLVw==');
//With the above, we Defined our DTM with the code the DTM Editor gave us.
if FindDTM(Blood, x, y, MIX1, MIY1, MIX2, MIY2) then
//FindDTM(Name(DTM), x, y, xs, ys, xe, ys):Boolean;
begin
Mouse(x, y, 4, 4, False);//FindDTM gives (x, y) as the coordinates of the DTM we made it look for.
ChooseOption('xamine');//Choose Examine in the pop-up.
Writeln('We have examined a blood rune!');
end;
FreeDTM(Blood);//Free the DTM named Blood.
end.//Ends program.


and my bot says the {$i SRL\SRL.scar}//We need this in all scripts. isnt recognized? (im trying to test DTMs in smaller programs like this before i go full scale and implement into my planking script)

VillaVuFTW

2012-03-04 15:47:24

Change it to $I SRL\SRL.simba or

$DEFINE SRL5 <- Believe this is beta..

SwagDaddy

2012-03-04 15:55:59

Nice, you going to want to declare your DTM's as global variables (at the top of the script, usually before declare players) then try something like this:

procedure DTMS;
begin
OakPlank := (DTM HERE)
end;

Another for freeing:

procedure FrDTM;
begin
FreeDTM(OakPlank);
end;

And then at the end in the mainloop make ure you declare it like :

begin
MouseSpeed := 10;
Smart_Server := 0;
Smart_Members := True;
Smart_Signed := True;
SetupSRL;
DTMS;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(4000 + Random(1000));
Repeat
MainLoop;
Until(False)
FrDTM;
end.

Also the declaring at the top you would need:

{$define SMART}
{$include srl/srl/misc/smart.simba}
{$I SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
{$I SPS/SPS.simba}

All of those as the declare smart, srl, and sps for walking

VillaVuFTW

2012-03-04 15:58:49

Swag… You do NOT want to declare as global, rather declare as local, as Global Variables tend to cut up your CPU. Where as the locals dont.

Global Variables are constantly ran, and why would you run a variable that is not being used.

Declare Locally

SwagDaddy

2012-03-04 16:19:45

Well if you need to declare in multiple procedures then might as well declare it as a global integer

Gucci

2012-03-04 17:20:20

From: VillaVuFTW
Swag… You do NOT want to declare as global, rather declare as local, as Global Variables tend to cut up your CPU. Where as the locals dont.

Global Variables are constantly ran, and why would you run a variable that is not being used.

Declare Locally


No…. I use them the way swag said in my maple chopper and it works well, and looking at other scripts using DTM's they also declare globally like teh's super heater for example

Blazeron

2012-03-04 17:47:28

Thanks for all the help everyone I will try some of these methods later

Blazeron

2012-03-04 19:32:09

Are DTMs only for inventory or can i use them to get logs out of the bank?

SwagDaddy

2012-03-04 19:33:49

Yeah you can MSX1, MSY1, MSX2, MSY2 are for main screen.

iPartyAlone

2012-03-04 20:58:03

gl with fixing it, I was planning on trying out to make one of these myself :p

Blazeron

2012-03-04 22:31:18

@swagdaddy thanks i will attempt to switch over to DTMs tommorow and get rid of as much hardcoded coords as i can

SwagDaddy

2012-03-05 00:52:55

No problem gl with the script