SRL Archive - First Scripts

My second first script


Theolithical

2009-04-03 19:54:34

This is my second script in the "first scripts" section, and it is titled "Whatirony," as it is an iron powerminer. I'd appreciate any help that you guys can give, and I'll keep updating this with some additions to hopefully get it in the "Srl Junior Member" mining section.

*Edit- V.6 released, I removed some of the functions to make it more simple. After I can get it to run 100% of the time, I'll add things to make it work more smoothly and efficiently(which is doesn't.)

Atm it will start up, but it won't really do anything. Halp? I'm prolly gonna replace the rock dtms with findcolor.


~~~
Thanks a lot for the help All that is man and 99_

ZaSz

2009-04-03 20:04:28

Actually to make it a pun. It should be "My First second script" as it will be be the 1st (and only time) you make your 2nd script.

What you said makes it so you you made your 1st script twice. But you didn't so, that wouldnt be a pun :p

All that is man

2009-04-03 20:17:24

Your script is a bit buggey but I fixed most of it for you:

program WhatIrony;
{.Include srl/srl.scar}
//Wroted by Theolithical, kudos to anyone that helps me edit this as this is
// is my first attempt at anything meaningful :3
{ Start script standing on the west side of the Rimmington mine, there are 2
iron rocks that the script will mine, place your character above one rock, and
to the left of another.Below is the positioning of the rocks and the player,
where X= Iron spots and O= the player.

ex- O X
X }

Var
Ironore, Ironunder, Ironright, x, y, I, R, runs : Integer;

const

Runs=(8);//Fill in this line, how many iron rocks to mine

Procedure LoadDTMS;
Begin
Ironore := DTMFromString('78DA63B464666058C3C8800C1C35E4C0344C9' +
'4D10AA86629AA1A0B25495435F64498630A54B31D554D4EB80DAA' +
'1A6BA09A9504CCD106AAD98CAAA628C60153CD5A54355E365AA86' +
'A0C806A96A1AAB133524655E30454B311558D9BB602A6DF17A1D9' +
'A5AB84A20600567F0F9E');

Ironunder := DTMFromString('78DA63AC656460580AC44820DD95074CC3441' +
'96B80AC75A86A7AE20551D59461AAE98C154055530D64CD415513' +
'6AC985AAA605C89A81AA26DB8317554D23903505554DB11F9A9A1' +
'E206B01AA9A481B34BBBA81AC55A86AF2BD51CD01003FB30F70');

Ironright := DTMFromString('78DA635CCCC8C0D000C44820D6520B4CC3441' +
'9170059DDA86A12AD7550D5CCC4541369C385AA6616905547C09C' +
'A9405615AA9ACE580154357381AC0A026E5E026495A1AA71D3E74' +
'055B311C8AA45552325C08DA20600F34C0E6E');
End;
Procedure Awesomesauce;//Mine one rock
Begin
makeCompass('N');
If FindDTM(Ironunder,x,y,MIX1,MIY1,MIX2,MIY2)then
Begin
Mouse(x,y,5,5,True);
Wait(300+random(300));
I:= I+1;
Runs:= Runs-1;
End;
end;

Procedure Kittens;//Mine the other rock
begin
makeCompass('N');
If FindDTM(Ironright,x,y,MIX1,MIY1,MIX2,MIY2) then
Begin
Mouse(x,y,4,4,True);
Wait(300+random(300));
I:= I+1;
Runs:= Runs-1;
End;
end;

Procedure Droptheiron;//Drops the iron
begin
repeat
If FindDTM(Ironore,x,y,MIX1,MIY1,MIX2,MIY2) then
Begin
Mouse(x,y,5,5,false);
ChooseOption('Drop');
I:= I-1;
End;
Until(I = 0);
end;

Procedure antiban;
begin
Hoverskill('Mining',True);
end;

Procedure antiban2;
begin
Boredhuman;
end;

Procedure antiban3;
begin
wait(3000+random(1000));
end;


Begin//mainloop
SetUpSRL;
ActivateClient;
LoadDTMS;
R:= (random(5));
Repeat
if not Loggedin then Exit;
Case R of
0: Awesomesauce;
1: Awesomesauce;
2: antiban;
3: antiban2;
4: Awesomesauce;
5: Antiban3;
end;
Awesomesauce;
Kittens;
Droptheiron;
Until(Runs=0);
end.

ian.

2009-04-03 20:48:11

program WhatIrony;
{.Include srl/srl.scar}
//Wroted by Theolithical, kudos to anyone that helps me edit this as this is
// is my first attempt at anything meaningful :3
{ Start script standing on the west side of the Rimmington mine, there are 2
iron rocks that the script will mine, place your character above one rock, and
to the left of another.Below is the positioning of the rocks and the player,
where X= Iron spots and O= the player.

ex- O X
X }

var
Ironore, Ironunder, Ironright, x, y, I, Runs: Integer;

const
Loads = 8;//Fill in this line, how many iron rocks to mine

procedure LoadDTMS;
begin
IronOre := DTMFromString('78DA63B464666058C3C8800C1C35E4C0344C9' +
'4D10AA86629AA1A0B25495435F64498630A54B31D554D4EB80DAA' +
'1A6BA09A9504CCD106AAD98CAAA628C60153CD5A54355E365AA86' +
'A0C806A96A1AAB133524655E30454B311558D9BB602A6DF17A1D9' +
'A5AB84A20600567F0F9E');

IronUnder := DTMFromString('78DA63AC656460580AC44820DD95074CC3441' +
'96B80AC75A86A7AE20551D59461AAE98C154055530D64CD415513' +
'6AC985AAA605C89A81AA26DB8317554D23903505554DB11F9A9A1' +
'E206B01AA9A481B34BBBA81AC55A86AF2BD51CD01003FB30F70');

IronRight := DTMFromString('78DA635CCCC8C0D000C44820D6520B4CC3441' +
'9170059DDA86A12AD7550D5CCC4541369C385AA6616905547C09C' +
'A9405615AA9ACE580154357381AC0A026E5E026495A1AA71D3E74' +
'055B311C8AA45552325C08DA20600F34C0E6E');
end;

procedure MineFirstRock;//Mine one rock
begin
MakeCompass('N');
if(FindDTM(IronUnder, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 5, 5, True);
Wait(300+Random(300));
Inc(I);
end;
end;

Procedure MineSecondRock;//Mine the other rock
begin
MakeCompass('N');
if(FindDTM(IronRight, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 4, 4, True);
Wait(300+Random(300));
Inc(I);
end;
end;

procedure DropTheIron;//Drops the iron
begin
repeat
if(FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 5, 5, False);
ChooseOption('Drop');
Dec(I);
end;
until(I = 0);
end;

procedure AntiBan;
begin
case Random(3) of
0: HoverSkill('Mining', True);
1: BoredHuman;
2: Wait(RandomRange(3000, 4000));
end;
end;

procedure ScriptTerminate;
begin
FreeDTM(IronOre);
FreeDTM(IronUnder);
FreeDTM(IronRight);
end;

begin//mainloop
SetUpSRL;
ActivateClient;
LoadDTMS;
repeat
if(not(LoggedIn))then
Exit;
case Random(3) of//Not sure why this case is here..
0: MineFirstRock;
1: AntiBan;
2: MineSecondRock;
end;
MineFirstRock;
MineSecondRock;
if(InvFull)then//With this it will drop the iron at the full load..
DropTheIron;
Inc(Runs);//So it really will do how many loads the user puts in ;)
until(Loads = Runs);
end.

STANDARDIZE ME CAP'N!

;)

……..

I have to re standardize this don't I? :p

one second..

actually..

too much work..

read some tuts about it if you want ;)

and..

I had the if(InvFull)then DropTheIron; because people don't usually drop them right after they mine them..

you could do a case tho :o

Theolithical

2009-04-08 12:52:24

Okay, V.5 is out right now. I'm pretty sure that I got the standards right for the most part, and the script runs without getting errors, but I'm not sure if it actually works.