Simba Code:
program PlantBuyer;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'username';
password := 'password';
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;
procedure bank();
begin
if bankScreen.open(BANK_NPC_GREY) then
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
end;
procedure runTo(Where: String); // Combined both walking procedures together
var
path: TPointArray;
begin
if not isLoggedIn() then
exit;
case lowercase(Where) of
'bank': path := [Point(129, 130), Point(145, 172), Point(167, 212)];
'garden': path := [Point(114, 161), Point(148, 137), Point(166, 114)];
end;
if not SPS.walkPath(path) then
writeLn('Failed to walk to the ' + Where);
end;
procedure buy();
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 4144414, 11, ['upplie'], MOUSE_RIGHT) then
begin
chooseOption.select(['Trade'], 1000); // You can adjust the wait here instead
wait(RandomRange(1500,1920));
mousebox([53, 150, 87, 189], MOUSE_RIGHT);
if chooseOption.select(['All']) then
tabBackPack.waitForShift(5000);
end;
end;
procedure compass(Where: String); // Combined both compass procedures together
begin
minimap.clickCompass();
case lowercase(Where) of
'bank': mainScreen.setAngle(MS_ANGLE_HIGH);
'garden': mainScreen.setAngle(45);
end;
end;
begin
clearDebug(); // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers(); // Set up your username/pass
SPS.setup('FALLYPLANT', RUNESCAPE_OTHER);
repeat
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitTreasure(); // Exit treasure hunter
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
runTo('Bank');
compass('Bank');
bank();
runTo('Garden');
compass('Shop');
repeat
buy();
until tabBackpack.isFull();
until false;
end.