Hi this is my first try at scripting, I have followed the guide on the help and tutorials section thanks to Mayor.
I have been making a bit of profit from buying fruit and then putting them in baskets, the profit vary's depending on what the GE prices are like. If you see your code in here im sorry but its probably stolen from a script you wrote :P.
To set this is up you need to use preset 2, in this preset you want 4 baskets in the first 4 slots followed by fruit for the rest of the slots. The basket should be assigned to quick-slot 1 on the quick-slot bar.
THE ONLY BANK SUPPORTED AT THE MOMENT IS DRAYNOR
I am just looking for feedback and criticism on my code before I start on my other goal of making a master farmer pickpocketer followed by a dragon slayer script (not sure which dragon yet).
I am by no means competent at scripting and I hardly understand it, but over time I may get better.
This is from using apples
================================================== ======
Cadets auto basketeer
Time Run: 20 Minutes and 54 Seconds
Baskets Filled: 724
Loads Done: 181
Profit Made: 289600
Per Hour: 830883
================================================== ======
Simba Code:
program Basketeer;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
LoadsDone, Slot, x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
///*//////////////////////Start of player set up\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\\\
Const
QuickKey = 1; //The slot in which the basket is asigned to
ProfitPB = 400; //The amount of profit per basket filled, depends on fruit
bankPin = ''; //Your bank pin
BankLoc = BANK_NPC_DRAYNOR; //Change depending on the bank you are using
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; //Enter user name here
password := ''; //Enter password here
isActive := true;
isMember := true;
end;
currentPlayer := 0;
end;
///*//////////////////////End of player set up\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\\\
Procedure FindNormalRandoms;
Begin
exitTreasure();
claimTicket();
End;
procedure progressReport();
var
basketFilled, profit, profitPerHour: integer;
begin
basketFilled := LoadsDone * 4;
profit := (basketFilled * ProfitPB);
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
writeLn('========================================================');
writeLn('Cadets auto basketeer');
writeLn('Time Run: ' + timeRunning);
writeLn('Baskets Filled: ' + intToStr(basketFilled));
writeLn('Loads Done: ' + intToStr(loadsDone));
writeLn('Profit Made: ' + intToStr(profit));
writeLn('Per Hour: ' + intToStr(profitPerHour));
writeLn('========================================================');
end;
procedure openBank();
begin
bankScreen.open(BankLoc);
if (pinscreen.isOpen()) then
writeln('Pinscreen is open!');
if (pinScreen.enter(bankPin)) then
writeln('Entered our bank pin!');
if not bankScreen.isOpen then
wait(650);
begin
if bankScreen.isOpen then
exit;
findColorsSpiralTolerance(x, y, TPA, 5385548, mainScreen.getBounds(), 16, colorSetting(2, 0.59, 0.72));
if (Length(TPA) < 1) then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['anker'], 500) then
begin
fastClick(MOUSE_LEFT);
break;
end;
end;
end;
end;
procedure withdrawPreset();
begin
if (bankScreen.isOpen()) then
begin
bankScreen.clickButton(BANK_BUTTON_PRESET_2);
end;
inc(LoadsDone);
end;
procedure fillBasket();
var
timesTried:integer;
T: TTimeMarker;
begin
FindNormalRandoms;
If Not IsLoggedIn Then
Exit;
If TabBackpack.IsEmpty then
Exit;
T.Start;
Repeat
SendKeys(ToStr(QuickKey), 60 + Random(60), 60 + Random(60));
Wait(GaussRangeInt(50,100));
If Not IsLoggedIn Then
Exit;
If T.GetTime>15000 Then
Exit;
Until (T.GetTime>1450);
End;
{Main Loop}
begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
Minimap.ClickCompass;
MainScreen.SetAngle(MS_ANGLE_HIGH);
end;
openBank();
Wait(RandomRange(500,1500));
withdrawPreset();
Wait(RandomRange(100,500));
fillBasket();
Wait(RandomRange(1700,2200));
progressReport();
until (false);
end.