Thomas
2015-04-13 14:15:03
Hey,
Anyone that might have some spare time: feel free to feedback my herblore script! Once I've tested it some more I'll release it in the Jr members section, and later for public.
Planned updates:
-Managing supplies (wont be releasing this for public)
-Portable well support (at chanty/barb outpost, probably in public version)
-Hover over banking (might release public, will only be for ge/chanty/barb outpost)
Current bugs:
-Sometimes repeats banking procedure before it starts to make items. Most likely solved.
Current status:
-Working well, all current functions seem to work.
-2600 pots/hr
Anyone that might have some spare time: feel free to feedback my herblore script! Once I've tested it some more I'll release it in the Jr members section, and later for public.
Planned updates:
-Managing supplies (wont be releasing this for public)
-Portable well support (at chanty/barb outpost, probably in public version)
-Hover over banking (might release public, will only be for ge/chanty/barb outpost)
Current bugs:
-Sometimes repeats banking procedure before it starts to make items. Most likely solved.
Current status:
-Working well, all current functions seem to work.
-2600 pots/hr
program Herblore;
{$DEFINE SMART}
{$I srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
var
potionCount: integer;
FailTimer: TTimeMarker;
const
VERSION = 0.9;
TIMEOUT = 20000;
SPF_BREAK = 0;
SPF_BREAK_DURATION = 1;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Herblore';
editBoxLabels := ['Break after', 'Break for', 'World'];
editBoxDefaults := ['120', '5', ''];
checkBoxLabels := ['Manage supplies'];
checkBoxDefaults := ['False'];
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
players[i].integers[SPF_BREAK] := strToInt(playerForm.players[i].settings[0]) * 60000;
players[i].integers[SPF_BREAK_DURATION] := strToInt(playerForm.players[i].settings[1]) * 60000;
world := strToInt(playerForm.players[i].settings[2]);
players[i].booleans[0] := strToBool(playerForm.players[i].settings[3]);
end;
end;
procedure debugSPFSettings();
var
i: integer;
begin
writeln('');
writeln('Player file: ', playerForm.playerFile);
for i := 0 to high(players) do
begin
writeln('Break After: ', players[i].integers[SPF_BREAK]);
writeln('Break For: ', players[i].integers[1]);
writeln('Manage supplies: ', players[i].booleans[0]);
writeln('');
end;
end;
procedure findNormalrandoms();
begin
claimTicket;
if (not bankScreen.isOpen()) then
closepopup();
tabBackpack.Open;
end;
function loginCheck(): boolean;
begin
if isLoggedIn() then
exit(true);
if not players[currentPlayer].login() then
exit(false);
findNormalrandoms();
mouseSpeed := 35;
wait(gaussRangeInt(1000, 2000));
minimap.clickCompass();
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);
wait(gaussRangeInt(1000, 2000));
end;
121..140: wait(gaussRangeInt(1000, 2000));
141..200: randomMouseSpeed(2, 30, 40);
end;
end;
procedure takeBreak();
begin
if (players[currentPlayer].worked.getTime() > players[currentPlayer].integers[SPF_BREAK]) then
begin
writeLn('Taking a ~' + toStr(players[currentPlayer].integers[SPF_BREAK] / 60000) + ' minute break');
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
wait(players[currentPlayer].integers[SPF_BREAK_DURATION] + random( - 60000, 180000));
loginCheck;
players[currentPlayer].worked.start();
FailTimer.start();
end;
end;
function banking(preset: integer): Boolean;
begin
if not isLoggedIn then
exit(False);
FailTimer.start();
begin
repeat
if bankscreen.open(BANK_GE) then
break();
minimap.clickCompass();
if (FailTimer.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
exit(True);
until (FailTimer.getTime > TIMEOUT) or (not isLoggedIn());
end;
end;
function makePotions(): boolean;
var
slot: integer;
begin
if not isLoggedIn then
exit;
FailTimer.start();
tabBackpack.Open();
repeat
case random(10) of
0..7: slot := 11;
8..9: slot := 12;
end;
if tabBackpack.mouseSlot(slot, MOUSE_MOVE) and isMouseOverText(['Use Clean']) then
begin
tabBackpack.mouseSlot(slot, MOUSE_LEFT);
wait(gaussRangeInt(100, 200));
case random(10) of
0..7: slot := 16;
8..9: slot := 17;
end;
if tabBackpack.mouseSlot(slot, MOUSE_MOVE) and isMouseOverText(['of water']) then
tabBackpack.mouseSlot(slot, MOUSE_LEFT);
end;
wait(gaussRangeInt(100, 200));
if (not isLoggedIn) or (FailTimer.getTime > TIMEOUT) then
exit;
until productionScreen.IsOpen(2000);
wait(gaussRangeInt(100, 200));
productionScreen.clickStart;
if tabBackpack.waitForShift(randomRange(5000, 7000)) then
exit(True);
end;
procedure progressReport();
var
potsPerHour: Integer;
begin
clearDebug();
potsPerHour := round((potionCount * 60) / (getTimeRunning() / 60000));
writeLn('|=========================================|');
writeLn(PadR('| Love Herblore v' + toStr(VERSION), 42) + '|');
writeLn(PadR('| Time: ' + timeRunning(TIME_ABBREV), 42) + '|');
writeLn(PadR('| Potions Made: ' + toStr(potionCount) + ' (' + toStr(potsPerHour) + ' PH)', 42) + '|');
writeLn(PadR('| Break in: ' + msToTime(players[currentPlayer].integers[SPF_BREAK] - players[currentPlayer].worked.getTime(), TIME_ABBREV), 42) + '|');
writeLn('|=========================================|');
end;
procedure mainloop();
var
FailCount: Integer;
begin
findNormalRandoms();
if banking(BANK_BUTTON_PRESET_1) and (not tabBackpack.isFull()) then
inc(FailCount);
if (FailCount = 4) then
begin
writeln('Failed withdrawing, shutting down');
players[currentPlayer].logout();
terminateScript();
end;
if tabBackpack.isFull() and makePotions() then
repeat
findNormalRandoms();
wait(gaussRangeInt(400, 1000));
antiBan;
if (not isLoggedIn) or (FailTimer.getTime > TIMEOUT) then
exit;
until not (tabBackpack.IsItemInSlot(27));
wait(gaussRangeInt(200, 500));
potionCount := potionCount + 14;
progressReport;
takeBreak;
end;
procedure setup();
begin
clearDebug();
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
terminatescript;
declareplayers();
{$IFDEF SMART}
smartEnableDrawing := True;
smartShowConsole := False;
{$ENDIF}
setupSRL;
disableSRLDebug := true;
FailTimer.start();
players[currentPlayer].worked.start();
end;
begin
setup();
while loginCheck() do
mainLoop();
end.