SRL Archive - First Scripts

RCopperMiner my first script :)


ringgold101

2013-04-09 18:59:36

My first ever script! Sorry it's a bit messy but here it is :)
Finally I stopped being a leacher and read the srl tuts and guides :)
Here is a pic to show where to start it! It's in the burthorpe mine.
Thank you everyone who posted guides I couldn't have done it without yall :)

program RCopperMiner;
{$DEFINE SMART8}
{$i srl/srl.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

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

procedure AntiBan;
begin
If(not(LoggedIn)) then
Exit;
ExitSquealOfFortune;
case Random(60) of
10: RandomRClick;
20: HoverSkill('Mining', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
end;
end;

procedure ClickMineSpot;
var x, y: integer;
begin
if FindObj(x, y , 'ine', 5214973, 30) then
begin
Writeln('We found the rock!');
ClickMouse2(mouse_right);
ChooseOption('ine');
wait(5900+random(350));
repeat
Wait(1100+random(250));
ClickMineSpot;
AntiBan;
Until (InvFull);
end;
end;

procedure DropOre;
var i: integer;
begin
Writeln('Droping all ore!');
for i:= 0 to 2 do
begin
DropPattern(Random(2) + 1);
if InvCount = 0 then
break;
end;
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LogInPlayer;
ClearDebug;
repeat
wait(500);
ClickMineSpot;
DropOre;
Antiban;
until false
end.


Post bugs and errors below I will try my best to fix them!

Zeds

2013-04-10 16:17:43

What tuts did you read? Interested in learning more myself

ringgold101

2013-04-10 16:31:42

From: Zeds
What tuts did you read? Interested in learning more myself


http://villavu.com/forum/showthread.php?t=58935
http://villavu.com/forum/showthread.php?t=44942
this link is for the section with all guides on scripting http://villavu.com/forum/forumdisplay.php?f=490
And I played around with the simba program :)

t4q

2013-04-11 04:48:54

Congratulations on your release :)
I'd change this
ClickMouse2(mouse_right);
ChooseOption('ine');


for

ClickMouse2(mouse_left);

because legit player usually left clicks rocks ;)
I see you use case random() of in antiban. Try adding it to choose which mouse click it does.