SRL Archive - General Botting Help

First Bot


opulex23

2014-10-14 03:25:42

Hey, so there is a room in the mining guild with coal and mith rocks in it, including a bank deposit box. I'm trying to make a bot that will mine the coal and mith then deposit it…but unfortunately …I've never botted before and I'm new to coding. I'm trying my heart out here, but I figured it wouldn't hurt to ask for some assistance. My skype is opulex23 OP and a few pointers would help out. If not, I'm sure i'll post it up here one day! look forward to it!

The Mayor

2014-10-14 03:35:51

From: opulex23
Hey, so there is a room in the mining guild with coal and mith rocks in it, including a bank deposit box. I'm trying to make a bot that will mine the coal and mith then deposit it…but unfortunately …I've never botted before and I'm new to coding. I'm trying my heart out here, but I figured it wouldn't hurt to ask for some assistance. My skype is opulex23 OP and a few pointers would help out. If not, I'm sure i'll post it up here one day! look forward to it!



Read this

and then this

and you will have all the skills you need to make the script you're after.

If you like, you can also enter the scripting competition for beginners ;)

Clarity

2014-10-14 03:38:34

If you have any questions after reading the tutorials and trying it out yourself, send me a PM :)

opulex23

2014-10-14 15:49:20

Thanks a bunch guys! I'll buckle down on those :)

opulex23

2014-10-15 07:03:57

From: Clarity
If you have any questions after reading the tutorials and trying it out yourself, send me a PM :)


Tried to PM you, but my posts are lacking :/

Here was my PM though.

Hey, I've been working on my mining script (never really coded before, but i'm really getting it) I seem to be stuck on something and i'm not quite sure what the bug is. Wondering if you could look at it and just tell me what the bug is :/ thanks!

The Mayor

2014-10-15 07:13:51

From: opulex23
Tried to PM you, but my posts are lacking :/

Here was my PM though.

Hey, I've been working on my mining script (never really coded before, but i'm really getting it) I seem to be stuck on something and i'm not quite sure what the bug is. Wondering if you could look at it and just tell me what the bug is :/ thanks!


Post script here

opulex23

2014-10-15 08:49:12

This is embarrassing haha here it is.

program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}

procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;

procedure mineRocks();
begin
// code here
end;

procedure findDepositBox();
var
x, y: integer;
begin
if not isLoggedIn() then
exit;
begin
if mainscreen.findObject(x, y, 6321021 , 13, [' Bank deposit box'], MOUSE_RIGHT) then
begin
chooseOption.select(['Deposit']);
end;
if depositBox.isOpen() then
begin
bankTimer.start() // It highlights this and says compiling failed

repeat
if (depositBox.count > 0) then
begin
depositBox.quickDeposit(QUICK_DEPOSIT_INVENTORY);
end
until(depositBox.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() >10000);

end;

depositBox.close();

end;

procedure depositCoal(); // also says compiling failed for this
begin
//code here
end;

main loop
begin
clearDebug(); Clear the debug box
smartEnableDrawing := true;
setupSRL();
declarePlayers();

if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
mineRocks();
findDepositBox();
depositCoal();
end.




(obviously not even close to being done. Just about 30 minutes of work)

Incurable

2014-10-15 09:19:22

From: opulex23
-snip-


There's no need to be embarrassed, we all start somewhere! ;)

You should edit your post and re-paste your code inside of
 tags so that we can see the proper formatting of it. It makes it much easier to help you debug it that way. :)