PDA

View Full Version : Requesting some help with a rsps bot



Neros
11-17-2012, 08:34 AM
hey, so i was wanting to use simba for a rsps i play, now because i can't use srl im pretty much stumped as to how i should go about doing it, i was thinking i'd have to use DTM's somewhere but i'm not sure now color picking seems fine :P

all im trying to make is a script that cuts normal tree's then fletches the inventory into arrow shafts. Really simple but i just dunno what i should be doin without good ol' SRL

At the minute i have came up with this.


program TreeShafter;
{$i SRL/SRL.simba}

const
Tree = 3561544;

var
x, y:Integer;

function inventfull:boolean;
begin
result := countcolortolerance(2770265,578,231,578,446,5) > 2500;
end;

procedure Chop;
begin
if (FindColorSpiralTolerance (x, y, Tree, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
mouse(x, y, 5, 5, true);
wait(8000); //preferably detect inv change/pixel shift instead
end;
wait(8000); //prevent memory surge
repeat
repeat
until inventfull;
FletchLog;
until AllPlayersInactive;
end;

procedure FletchLog;
begin
FindColorTolerance(X,Y,7895169,664,442,664,442,4)
Wait(150 + Random(40));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Left);
wait(100);
FindColorTolerance(X,Y,2770522,574,443,574,447,4)
Wait(150 + Random(40));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Left);
wait(100);
FindColorTolerance(X,Y,16777215,410,385,410,385,4)
Wait(150 + Random(40));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Right);
wait(100);
FindColorTolerance(X,Y,6121839,396,485,396,485,4)
Wait(150 + Random(40));
movemouse(x, y);
Wait(220 + Random(50));
ClickMouse(x, y, Mouse_Left);
wait(20000);
end;

begin
ClearDebug;
SetUpSrl;
SRL_EnableNavBar; // Added for offset for new navbar at the top, otherwise it will get the wrong coordinates
ActivateClient;
Chop;
FletchLog;
end.

Marc000z
11-17-2012, 01:43 PM
It's not the best idea to wait for the inventory to be full. The way I make my bots is I set a time limit: "Wait(10000);", that way the inventory is usually half full or so.

riwu
11-17-2012, 02:32 PM
It's not the best idea to wait for the inventory to be full. The way I make my bots is I set a time limit: "Wait(10000);", that way the inventory is usually half full or so.
Why is making them while it's only half full a better idea than making them while it's full? :confused:

@OP your mainloop could be like this:

repeat
repeat
if FindColorSpir...() then
begin
mouse();
wait(); //preferably detect inv change/pixel shift instead
end;
wait(); //prevent memory surge
until inventfull;
FletchLog;
until AllPlayersInactive;

Of course there's absolutely no failsafe and hence potential infinite loops but good for starters ;)

Neros
11-17-2012, 08:00 PM
Why is making them while it's only half full a better idea than making them while it's full? :confused:

@OP your mainloop could be like this:

repeat
repeat
if FindColorSpir...() then
begin
mouse();
wait(); //preferably detect inv change/pixel shift instead
end;
wait(); //prevent memory surge
until inventfull;
FletchLog;
until AllPlayersInactive;

Of course there's absolutely no failsafe and hence potential infinite loops but good for starters ;)

Thank's riwu, that's helped a little bit, now i just have to write a procedure for fletching the logs... Just wondering if i should be calling FletchLog as a function or not because i get this compiling error when i put it as a second procedure


[Error] C:\Users\Owner\Desktop\TreeShafter.simba(27:4): Unknown identifier 'FletchLog' at line 26

riwu
11-18-2012, 12:30 AM
Thank's riwu, that's helped a little bit, now i just have to write a procedure for fletching the logs... Just wondering if i should be calling FletchLog as a function or not because i get this compiling error when i put it as a second procedure


[Error] C:\Users\Owner\Desktop\TreeShafter.simba(27:4): Unknown identifier 'FletchLog' at line 26
You have to come out with the procedure and put it somewhere above where you call it. Unknown identifier stems from that you didn't create the procedure/put it above.

The purpose of a function is to return a result, if there's no meaningful results to return then use procedure.