Simba Code:
program new;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR\SRL\misc\SmartGraphics.simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}
var bars: integer;
function F_BankScreen: Boolean;
begin
Result := (CountColor(2070783, 176, 7, 350, 38) > 200);
end;
function F_OpenBank: Boolean;
var
Booth: TPoint;
begin
if (not LoggedIn) or (F_BankScreen) then
Exit;
Booth := R_TileToMS(Point(3186, 3436));
MMouse(Booth.X, Booth.Y, 2, 2);
Sleep(100 + Random(100));
if (R_IsUpText('Bank Ba')) then begin
ClickMouse2(Mouse_Left);
end else begin
ClickMouse2(Mouse_Right);
Sleep(250 + Random(250));
R_ChooseOption('Bank Ba');
end;
Sleep(500 + Random(250));
if (PinScreen) then
InPin(Players[CurrentPlayer].Pin);
Result := WaitFunc(@F_BankScreen, 250, 2500);
Sleep(1000 + Random(250));
end;
procedure F_CloseBank;
begin
if (not LoggedIn) or (not F_BankScreen) then
Exit;
MMouse(486+randomrange(-2, 2), 25+randomrange(-2, 2), 2, 2);
ClickMouse2(Mouse_Left);
Sleep(250 + Random(250));
end;
function F_WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
var
BBox: TBox;
X, Y: Integer;
begin
Result := False;
FixBank;
if (not LoggedIn) or (not F_BankScreen) then
exit;
BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
BBox := IntToBox(BBox.X1 - 2, BBox.Y1 + 30, BBox.X2 - 2, BBox.Y2 + 23);
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 - 2, BBox.Y1 + 10, BBox.X2 - 2, BBox.Y2 + 3, mouse_move);
if (Length(Uptexts) > 0) then
if (not R_WaitUpTextMulti(Uptexts, 500)) then
Exit;
if (Amount = 1) then
ClickMouse2(mouse_left)
else
ClickMouse2(mouse_right);
if (Amount = 1) then
begin
Result := True;
Wait(RandomRange(250, 550));
Exit;
end;
if (Amount = -1) then
begin
if (WaitOptionMultiEx(['Withdraw-All-but', 'l-b'], 'All', Nothing, 300)) then
Result := R_ChooseOption('Withdraw-All-but');
end else
if (Amount = 0) then
begin
if (WaitOptionMultiEx(['Withdraw-All', 'w-A'], 'All', Nothing, 300)) then
Result := R_ChooseOption('Withdraw-All');
end else
if (WaitOptionMultiEx(['Withdraw-' + IntToStr(Amount) + ' ', 'w-' + IntToStr(Amount) + ' '], 'All', Nothing, 300)) then
Result := R_ChooseOption('Withdraw-' + IntToStr(Amount) + ' ');
if (not (Result)) and (Amount > 0) then
begin
if (not OptionsExist(['Withdraw', 'ithdraw', 'draw'], False)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);
if WaitOptionMulti(['Withdraw-X', 'w-X', 'X'], 500) then
begin
X := GetSystemTime + 10000;
while (X >= GetSystemTime) and (not (InRange(CountColor(0, 211, 394, 308, 411), 200, 300))) do
Wait(50);
Wait(RandomRange(75, 400));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;
procedure WithdrawOres;
begin
F_OpenBank;
F_WithdrawEx(3, 0, 9, ['Iron ore']);
F_WithdrawEx(1, 0, 0, ['Coal']);
F_CloseBank;
end;
procedure SuperheatBar;
begin
GameTab(tab_Magic);
MMouse(666 + RandomRange(-3, 3), 313 + RandomRange(-3, 3), 2, 2);
Sleep(100 + Random(100));
ClickMouse2(Mouse_Left);
Sleep(100 + Random(100));
InvMouse(10, 1);
Sleep(1000 + Random(250));
Inc(bars);
end;
procedure Superheat;
var
I: Integer;
begin
for I := 0 to 26 do begin
SuperheatBar;
end;
end;
procedure DepositBars;
var i: integer;
begin
F_OpenBank;
//Deposit(2, 28, True); SRL-5 Deposit() function doesn't work?
for i := 2 to 28 do begin
if (InvCount > 1) then begin
InvMouse(i, mouse_Right);
sleep(200+random(50));
R_ChooseOption('Deposit-All');
end;
end;
end;
procedure proggy;
begin
writeln('Runtime: ' + timerunning);
writeln('Bars made: ' + tostr(bars));
end;
begin
SetupSRL;
SetupReflection;
repeat
WithdrawOres;
Superheat;
DepositBars;
proggy;
until(False);
end.