Simba Code:
program lunar_planker;
{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
const
User = '';
Pass = '';
Pin = '';
Anti_Ban = true;
Sm_Break = true; { Small Breaks }
Sm_Break_Time : TIntegerArray
:= [4, 50]; //in Seconds
var
firstTime: boolean;
log, plank: TItem;
lastSlot, fails, planks: Integer;
spellBox: Tbox:= toBox(557, 359, 575, 377);
procedure Terminate(reason : string);
begin
writeln('Terminating: ', Reason);
terminateScript;
end;
{ Moves the mouse, simulating human imperfectness/hand shakyness }
procedure shiftMouse(Radius : Integer);
var
TPA : TPointArray;
begin
TPA := TPAFromCircle(getMousePnt().x, getMousePnt().y, Radius);
FillEllipse(TPA);
HumanMMouse(TPA[random(length(TPA))], 3, 3);
end;
Procedure mouseBox(B: TBox; ClickType: Integer); override;
var
Pnt : TPoint;
begin
if (not (mouseInBox(B))) then
begin
gaussBox(Pnt.x, Pnt.y, B.X1, B.Y1, B.X2, B.Y2);
case RandomRange(0, 15) of
0..4: brakeMMouse(Pnt, 0, 0, True);
5..9: brakeMMouse(Pnt, 0, 0, false);
10..14: humanMMouse(Pnt, 0, 0);
15: missMouse(Pnt, 0,0);
end;
end;
wait(randomRange(25,150));
fastClick(ClickType);
end;
procedure SmallBreak();
var
I : Integer;
begin
if (random(5) > 2) then MMouseOffClient('random');
I := (randomRange(Sm_Break_Time[0] * 1000, Sm_Break_Time[1] * 1000));
writeln('Taking a small break for ' + msToTime64(I));
sleep(I);
end;
procedure Antiban();
begin
firstTime := true;
case random(0, 150) of
0..20: begin sleep(randomrange(3000, 6000)); hoverSkill(SKILL_MAGIC, False); end;
21..30: pickUpMouse();
31..55: SleepAndMoveMouse(200 + random(2000));
56..64: if (Sm_Break = true) then smallBreak();
65..150: shiftMouse(1 + random(12));
end;
if (random(500) = 1) and (Sm_Break = true) then smallBreak();
end;
procedure Login();
begin
Sleep(RandomRange(2000, 15000));
LoginPlayer(false);
end;
procedure Planking();
var
X, Y, I: integer;
TIA: TIntegerArray;
bool: boolean;
begin
bool := false;
if (isInterfaceOpen()) then
closeInterface();
if (firstTime = false) and (random(40) > 1) then
mouseBox((spellBox), mouse_move);
firstTime := false;
if (not (WaitTab(tab_Magic, 2 + random(100), 2000 + random(500)))) then
gametab(tab_Magic);
if (not (pointInBox(getMousePnt(), spellBox))) then
mouseBox(spellBox, Mouse_left)
else
fastClick(mouse_left);
if WaitTab(tab_inv, 2 + random(15), 2000 + random(500)) then
begin
TIA := log.getSlots();
if length(TIA) < 1 then exit;
for I := 0 to high(TIA) do
if (TIA[I] = lastSlot) then
begin
writeln('last slot = log slot... waiting for plank to appear...');
if random(20) > 1 then
try
writeln('Hovering over next log');
if interactSlot(TIA[I + 1], mouse_move) then
bool := true;
except
writeln('Array index does not exist');
end
if waitFindDTM(plank.DTM, X, Y, invBox(lastSlot), 5 + random(70), 1000 + random(2000)) then
TIA := log.getSlots();
end;
if ((bool = false) and (random(40) < 2)) then
begin
I := random(length(TIA));
if interactSlot(TIA[I], mouse_left) then
begin
lastSlot := I;
inc(planks);
end;
end else
begin
if interactSlot(TIA[0], mouse_left) then
begin
lastSlot := TIA[0];
inc(planks)
end;
end
end;
end;
procedure Banking();
var
TPA: TPointArray;
ATPA: T2DPointArray;
I, X, Y: Integer;
T: Timer;
tCol : TColEx;
TIA: TIntegerArray;
label
doPin, doRestock;
begin
sleep(randomRange(200, 400));
if (Interfaces[PINSCREEN].isVisible()) then
goto doPin;
if (isBankOpen()) then
goto doRestock;
if (waitupText('->', 75 + random(175))) then
fastClick(MOUSE_LEFT);
tCol.create(332121, 7, 0.17, 1.71);
if (not tCol.findAllIn(AREA_MS, TPA)) then
exit;
ATPA := FloodFillTPA(TPA);
if (length(ATPA) < 1) then
exit;
sortATPASize(ATPA, true);
humanMMouse(middleTPA(ATPA[0]), 0, 0);
if (waitUptextMulti(['ank', 'est'], 150 + random(175))) then
fastClick(MOUSE_LEFT)
else
begin
fastClick(MOUSE_RIGHT);
if (not (waitOption('ank', 250))) then exit;
end;
T.start();
while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (T.TimeElapsed() < 3000) do
sleep(random(150, 250));
if (Interfaces[PINSCREEN].isVisible()) then
goto doPin;
if (not isBankOpen()) then
exit;
doRestock:
begin
TIA := plank.getSlots();
if length(TIA) < 2 then
begin
plank.interact(Mouse_left);
sleep(random(75, 300));
end
else
begin
interactSlot(TIA[random(length(TIA))], mouse_right);
waitOption('eposit-All', 250);
sleep(random(76, 300));
end;
if (findDTM(log.DTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
HumanMMouse(point(x, y), 0, 0);
sleep(random(20, 100));
fastClick(MOUSE_RIGHT);
if (random(0, 5) = 1) then
waitOption('ithdraw-All ', 250)
else
waitOption('ithdraw-All-but-1', 250);
end else
inc(fails);
sleep(randomrange(200, 500));
firstTime := true;
lastSlot := -1;
closeInterface();
planking();
exit;
end
doPin:
begin
inPin(Me.Pin);
goTo doRestock;
end;
end;
procedure free;
begin
freeDTM(log.DTM);
freeDTM(plank.DTM);
end;
function PerHour(Thing: extended): int64;
begin
result := Round(Thing * (3600.0 / (GetTimeRunning / 1000.0)));
end;
function GetState(): Procedure;
begin
if (not (isLoggedIn())) then exit(@login);
if (Random(0, 500) = 1) and (Anti_Ban = true) then exit(@Antiban);
if (Random(0, 1500) = 1) and (Sm_Break = true) then exit(@SmallBreak);
case (log.inInventory()) of
true: exit(@planking);
false: exit(@banking);
end;
end;
procedure Execute();
var
CurrentState : procedure;
begin
if (fails > 5) then terminate('too many fails');
sleep(RandomRange(10, 75));
CurrentState := GetState();
writeln(MsToTime(getTimeRunning, 3) + ' | ' + 'State: ' + Between('"', '"', ToStr(@CurrentState)) + ' > Planks Made: ', planks , ' (',PerHour(planks), ') > Experience: ', planks * 90, ' (', perhour(planks * 90), ')');
CurrentState();
end;
begin
InitAL();
MouseSpeed := RandomRange(20, 25);
Me.Name := User;
Me.Pass := Pass;
Me.Pin := Pin;
Me.Active := True;
Me.Member := True;
log.DTM := DTMFromString('mbQAAAHicY2VgYKhkYWDIB+JaIC4A4nog3srIwLARivcC8S4g3j0/iyHTnpNh55xMMH1wSR4DK1A/OmbEgsEAAHvrDNY=');
plank.DTM := DTMFromString('mbQAAAHicY2VgYChjYWAoBOISIK4C4jogzmcE8oG4EohTgTgFiKNdTRhSfC0ZQhz0wGwfKy0GVqB+dMyIBYMBAHl3CLk=');
firstTime := true;
addonterminate('free');
while (Me.Active) do
Execute();
end.