From: loginor
- Now with 1.3, It quite frequently open the preset settings at the bank interface, bugging out the whole program.
- It doesn't clear the debug boxes
It has never cleared the debug boxes once they were drawn. I will add the clear atpa again in 1.4.
I would not know why it opens the preset settings tbh, do you know why it might happen?
I'll have a look for it later!
Can you try this version for me?
program Vials;
{$DEFINE SMART}
{$I srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
var
VialCount, WellCount: integer;
Timer: TTimeMarker;
ProgressTimer: TTimemarker;
const
TIMEOUT = 20000;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Vials';
editBoxLabels := ['World'];
editBoxDefaults := ['124'];
checkBoxLabels := ['Placewell'];
checkBoxDefaults := ['True'];
end;
end;
procedure declarePlayers();
var
i: Integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
world := strToInt(playerForm.players[i].settings[0]);
isMember := True;
booleans[0] := strToBool(playerForm.players[i].settings[1]);
end;
end;
procedure findNormalrandoms();
begin
claimTicket;
if (not bankScreen.isOpen()) then
closepopup();
tabBackpack.Open;
end;
procedure afk(duration: integer);
begin
if duration = 1 then
wait(gaussRangeInt(50, 160))
else
wait(gaussRangeInt(1100, 2200));
end;
procedure setCamera();
begin
afk(2);
minimap.clickCompass();
afk(2);
mainScreen.setAngle(MS_ANGLE_HIGH);
afk(2);
mainscreen.setZoom(true);
end;
function loginCheck(): boolean;
begin
if isLoggedIn() then
exit(true);
if not players[currentPlayer].login() then
exit(false);
findNormalrandoms();
mouseSpeed := 35;
setCamera();
exit(true);
end;
procedure antiban();
begin
case random(2000) of
1..3:
begin
hoverRandomSkill();
end;
4..40: mouseMovingObject;
41..60: sleepAndMoveMouse(randomRange(100, 2000));
61..120:
begin
mouseOffClient(4);
afk(2);
end;
121..140: afk(1);
141..200: randomMouseSpeed(2, 30, 40);
end;
end;
procedure progressReport();
var
vialsPH: Integer;
begin
vialsPH := round((VialCount * (3600.0 / (getTimeRunning / 1000.0))));
writeLn(padR('Running For: ' + timeRunning(), 60));
writeLn(padR('Vials: ' + groupDigits(VialCount, ','), 37) + padR('Vials/H: ' + groupDigits(vialsPH, ','), 23));
if players[currentPlayer].booleans[0] then
writeLn(padR('Wells placed: ' + groupDigits(WellCount, ','), 37));
ProgressTimer.start;
end;
function banking(preset: integer): Boolean;
begin
if not isLoggedIn then
exit(False);
Timer.start();
begin
repeat
if bankscreen.open(BANK_CHEST_BARB_OUTPOST) then
break();
setCamera();
if (Timer.getTime > TIMEOUT) or (not isLoggedIn()) then
exit(False);
until bankScreen.isOpen(2000) or pinscreen.isOpen();
if pinScreen.isOpen() then
pinScreen.enter(players[currentPlayer].bankPin);
repeat
if bankScreen.clickButton(preset) then
break;
if (timer.getTime > timeOut) or (not isLoggedIn) then
exit;
until (not bankScreen.isOpen);
end;
result := true;
end;
function findPortable(): Boolean;
var
i, x, y: integer;
portTPA: TPointArray;
portATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit();
findColorsSpiralTolerance(x, y, portTPA, 3031949, mainScreen.getBounds(), 10, colorSetting(2, 0.3, 1.7));
if length(portTPA) < 1 then
exit();
portATPA := portTPA.toATPA(35, 35);
portATPA.filterBetween(0, 20);
portATPA.sortFromSize(25, true);
if length(portATPA) < 1 then
exit();
smartImage.debugATPA(portATPA);
for i := 0 to high(portATPA) do
begin
middleTPAEx(portATPA[i], x, y);
mouse(x, y, 10, 11, MOUSE_MOVE);
if isMouseOverText(['well', 'ortab'], 2500) then
begin
portATPA := [];
exit(true);
end;
end;
end;
function renewPortable(): Boolean;
begin
if not isLoggedIn() then
exit();
writeln('Renewing Portable');
afk(2);
sendKeys('w', 200, 40);
if conversationBox.isOpen(5500) then
begin
conversationBox.selectOption(1);
inc(wellCount);
afk(2);
end;
result := findPortable();
end;
function getVials(): Boolean;
begin
if not isLoggedIn() then
exit();
tabBackpack.open();
if (not tabBackpack.isEmpty) then
exit();
Timer.start();
if isMouseOverText(['well', 'ortab'], 3300) then
begin
fastClick(MOUSE_RIGHT);
if chooseOption.isOpen(3000) then
if chooseOption.select(['ake vials', 'vials', 'vial'], 2000) then
if bankScreen._enterAmount(gaussRangeInt(30, 36), 4000) then
repeat
afk(1);
if (not isLoggedIn()) or (Timer.getTime > TIMEOUT) then
exit();
until tabBackpack.isFull();
VialCount := VialCount + 28;
result := true;
end;
end;
procedure waitPortable();
begin
Timer.start();
repeat
antiban();
if (Timer.getTime() > 120000) then
begin
writeln('No new well found in 2 minutes, terminating script');
players[currentPlayer].logout();
terminateScript();
end;
until findPortable() or (not isLoggedIn());
end;
procedure setup();
begin
disableSRLLog := true;
smartShowConsole := false;
disableSRLDebug := true;
smartEnableDrawing := true;
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
terminatescript;
declareplayers();
setupSRL;
end;
procedure mainloop();
var
i, noWell: integer;
begin
while findPortable() do
begin
findNormalRandoms();
if tabBackpack.isEmpty() and getVials() then
begin
findNormalRandoms();
if banking(BANK_BUTTON_PRESET_1) and tabBackpack.isEmpty() then
begin
findNormalRandoms();
if (progressTimer.getTime > 60000) then
progressReport();
antiban();
end;
end;
end;
while (not findPortable()) do
begin
findNormalrandoms();
if players[currentPlayer].booleans[0] then
begin
if banking(BANK_BUTTON_PRESET_2) and tabBackpack.isEmpty() then
inc(nowell);
if (nowell = 4) then
begin
writeln('Failed withdrawing, shutting down');
players[currentPlayer].logout();
terminateScript();
end;
if tabBackpack.isItemInSlot(1) then
begin
findNormalRandoms();
if renewPortable() then
writeLn('renewed portable');
end;
end
else
waitPortable();
end;
end;
begin
setup();
while loginCheck() do
mainLoop();
end.