Okay thanks. I'll try to fix that soon.
Okay thanks. I'll try to fix that soon.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I think I've got a version that works. I tested it with 100 Rune bars and it worked fine. If someone else could test it with using a Coal bag that would be great.
Simba Code:{==============================================================================\
| All-in-one Superheater |
| by Coh3n |
|==============================================================================|
| |
| Author: Coh3n |
| Description: Superheats any bar |
| Contact: Private message @ SRL-Forums |
| |
| Many more scripts of various types can be found at www.villavu.com! |
\_____________________________________________________________________________}
{==============================================================================\
| Setup Instructions |
|==============================================================================]
| |
| 1. See thread: http://villavu.com/forum/showthread.php?t=72633 |
\_____________________________________________________________________________}
program AIOSuperheater;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
const
SCRIPT_VERSION = '2.3';
const
BAR_BRONZE = 0;
BAR_IRON = 1;
BAR_SILVER = 2;
BAR_STEEL = 3;
BAR_GOLD = 4;
BAR_MITHRIL = 5;
BAR_ADAMANT = 6;
BAR_RUNE = 7;
type
TBar = record
name, statsName: string;
amtPrimary: integer; // number of primary ore for 1 load
hasSecondary: boolean;
expSmithing: extended;
oreUptext: TStringArray;
webString: string;
profit: integer;
end;
{$s+}
type
TNaturesLoc = (BANK, BACKPACK);
{$s-}
// _* means changing won't break script, but still shouldn't change
const
_P_BAR = 0;
_P_BREAK = 1;
_P_TIME = 2;
_P_SPELL_X = 3;
_P_SPELL_Y = 4;
_P_COAL_BAG = 0;
_P_SOUND = 1;
_P_SPELL_KEY = 0;
_P_BANK_DIR = 1;
// not set by user
_P_NATURES_START = 10;
_P_CASTS = 11;
_P_FALSE = 12;
// bank slots for ores
_PRIMARY_SLOT = 9;
_SECONDARY_SLOT = 10;
// __* means changing will break script
const
__SLOT_NATURE = 28; // inventory slot holding the nature runes
__SLOT_COAL_BAG = 27; // inventory slot holding the coal bag
__SPECIAL_MOUSE_SLOTS = 26; // slots >= this slot need the mouse to move in the top half so mouseover text doesn't cover other slots
__EXP_SUPERHEAT = 53;
__MOUSEOVERTEXT_ORE = ['Ore', 're'];
__MOUSEOVERTEXT_COAL = ['Coal', 'oal', 'Co'];
__MOUSEOVERTEXT_CAST = ['Cast', 'ast'];
__ANTIBAN_HOVER = 0;
__ANTIBAN_WAIT = 1;
__BANK_NORTH: TPoint = [275, 155];
__BANK_EAST : TPoint = [315, 185];
__BANK_SOUTH: TPoint = [285, 215];
__BANK_WEST : TPoint = [245, 185];
var
_bars: array of TBar;
antibanChance: integer;
function strToBar(s: string): integer;
begin
case s of
'Bronze': result := BAR_BRONZE;
'Iron': result := BAR_IRON;
'Silver': result := BAR_SILVER;
'Steel': result := BAR_STEEL;
'Gold': result := BAR_GOLD;
'Mithril': result := BAR_MITHRIL;
'Adamant': result := BAR_ADAMANT;
'Rune': result := BAR_RUNE;
else
writeln('Invalid bar selection!');
end;
end;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'AIO Superheater ~ by Coh3n';
scriptHelpThread := 'http://villavu.com/forum/showthread.php?t=72633';
scriptSettingsPath := '';
editBoxLabels := ['Minutes before breaking', 'Minutes to break for', 'Keybind key', 'Spell Point X', 'Spell Point Y', 'Stats ID', 'Stats Password', 'Percent chance for antiban'];
editBoxDefaults := ['0', '0', '0', '0', '0', '', '', '0'];
checkBoxLabels := ['Use Coal bag', 'Save SRL log', 'Show SRL debug', 'Take screenshot of IP', 'Play finishing sound'];
checkBoxDefaults := ['True', 'True', 'True', 'True', 'True'];
comboBoxLabels := ['Bar type', 'Bank direction'];
comboBoxDefaults := ['Steel', 'N'];
// this needs to be done for every element in the comboBoxLabels array
setLength(comboBoxItems, length(comboBoxLabels));
comboBoxItems[0] := ['Bronze', 'Iron', 'Silver', 'Steel', 'Gold', 'Mithril', 'Adamant', 'Rune'];
comboBoxItems[1] := ['N', 'E', 'S', 'W'];
end;
end;
procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.playerNames, playerForm.playerFile);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
integers[_P_BAR] := strToBar(playerForm.players[i].settings[13]);
integers[_P_BREAK] := strToInt(playerForm.players[i].settings[1]);
integers[_P_TIME] := strToInt(playerForm.players[i].settings[0]);
integers[_P_SPELL_X] := strToInt(playerForm.players[i].settings[3]);
integers[_P_SPELL_Y] := strToInt(playerForm.players[i].settings[4]);
booleans[_P_COAL_BAG] := strToBool(playerForm.players[i].settings[8]);
booleans[_P_SOUND] := strToBool(playerForm.players[i].settings[12]);
strings[_P_SPELL_KEY] := playerForm.players[i].settings[2];
strings[_P_BANK_DIR] := playerForm.players[i].settings[14];
end;
statsSetup(534, playerForm.players[0].settings[5], playerForm.players[0].settings[6]);
antibanChance := strToInt(playerForm.players[0].settings[7]);
end;
procedure signature;
begin
Writeln(' ___ ');
Wait(100);
Writeln(' ____ /\__\ ');
Wait(100);
Writeln(' /\___\ ____ \/ _/ ');
Wait(100);
Writeln(' _____ \/_ / /\___\ \/ _____ ');
Wait(100);
Writeln(' /\____\ _______/ / /___ _\/___ \_____ /\____\ ');
Wait(100);;
Writeln(' / / ___\/\______\/ /____\\____/ /_____\/ / ____\ ');
Wait(100);
Writeln(' / / /__ / / ___ / ____ //___ / ____ \/ /___\ ');
Wait(100);
Writeln(' / / /___\ / /__/ / / / / /____/ / / / / /____ / ');
Wait(100);
Writeln(' \/_______//______/_/ /_/_/______/_/__/_/_/____/ / ');
Wait(100);
Writeln(' \/___________________/ ');
Wait(100);
Writeln(PadR(' All-in-one Superheater ' + SCRIPT_VERSION + '!', 57));
end;
procedure findNormalRandoms();
var
p: TPoint;
begin
if (findSpinTicket(p)) then
mouse(p, MOUSE_LEFT);
closeAdWindow();
end;
procedure antiban(which: integer);
begin
if (random(100) + 1 > antibanChance) then
exit;
case which of
__ANTIBAN_HOVER:
begin
writeln('Hovering skills for antiban...');
gameTabs.openTab(TAB_STATS);
hoverSkill(SKILL_MAGIC);
hoverSkill(SKILL_SMITHING);
end;
__ANTIBAN_WAIT:
begin
writeln('Waiting 3-6 seconds for antiban...');
wait(3000 + random(3000));
end;
end;
end;
function randomMinutes(min: integer): integer;
begin
result := randomRange(-min * 60000, min * 60000);
end;
function boolToInt(b: boolean): integer;
begin
if (b) then
result := 1
else
result := 0;
end;
function getBar(bar: integer): TBar;
begin
case bar of
BAR_BRONZE:
with result do
begin
name := 'Bronze Bar';
statsName := 'Bronze Bars Melted';
amtPrimary := 13;
hasSecondary := true;
expSmithing := 6.2;
oreUptext := ['Tin', 'in', 'Copper', 'opper'];
webString := 'Bronze_bar';
end;
BAR_IRON:
with result do
begin
name := 'Iron Bar';
statsName := 'Iron Bars Melted';
amtPrimary := 27;
hasSecondary := false;
expSmithing := 12.5;
oreUptext := ['Iron', 'ron', 'Ir'];
webString := 'Iron_bar';
end;
BAR_SILVER:
with result do
begin
name := 'Silver Bar';
statsName := 'Silver Bars Melted';
amtPrimary := 27;
hasSecondary := false;
expSmithing := 13.7;
oreUptext := ['Silver', 'ilver', 'ver'];
webString := 'Silver_bar';
end;
BAR_STEEL:
with result do
begin
name := 'Steel Bar';
statsName := 'Steel Bars Melted';
amtPrimary := (9 + (boolToInt(players[currentPlayer].booleans[_P_COAL_BAG])) * 8);
hasSecondary := true;
expSmithing := 17.5;
oreUptext := ['Iron', 'ron', 'Ir', 'ro', 'n Or'];
webString := 'Steel_bar';
end;
BAR_GOLD:
with result do
begin
name := 'Gold Bar';
statsName := 'Gold Bars Melted';
amtPrimary := 27;
hasSecondary := false;
expSmithing := 22.5;
oreUptext := ['Gold', 'old'];
webString := 'Gold_bar';
end;
BAR_MITHRIL:
with result do
begin
name := 'Mithril Bar';
statsName := 'Mithril Bars Melted';
amtPrimary := (5 + (boolToInt(players[currentPlayer].booleans[_P_COAL_BAG])) * 5);;
hasSecondary := true;
expSmithing := 30;
oreUptext := ['Mithril', 'ithril', 'ril'];
webString := 'Mithril_bar';
end;
BAR_ADAMANT:
with result do
begin
name := 'Adamant Bar';
statsName := 'Adamant Bars Melted';
amtPrimary := (3 + (boolToInt(players[currentPlayer].booleans[_P_COAL_BAG])) * 4);;
hasSecondary := true;
expSmithing := 37.5;
oreUptext := ['Adamant', 'damant', 'ant'];
webString := 'Adamant_bar';
end;
BAR_RUNE:
with result do
begin
name := 'Rune Bar';
statsName := 'Runite Bars Melted';
amtPrimary := (3 + (boolToInt(players[currentPlayer].booleans[_P_COAL_BAG])) * 2);;
hasSecondary := true;
expSmithing := 50.0;
oreUptext := ['Runite', 'unite'];
webString := 'Rune_bar';
end;
else
writeln('getBar: Invalid bar selected');
end;
end;
function getNaturesBank(): integer;
begin
if (bankScreen.isOpen()) then
result := getItemAmount(bankscreen.getPackSlotBox(__SLOT_NATURE));
if (result <= 0) then
if (bankscreen.isItemInPackSlot(__SLOT_NATURE)) then
begin
writeln('getNaturesBank(): Misread natures, trying again...');
mouse(mainscreen.getCenterPoint().rand(200), MOUSE_MOVE);
result := getItemAmount(bankscreen.getPackSlotBox(__SLOT_NATURE));
end;
end;
function getNaturesBackpack(): integer;
begin
if (tabBackpack.open()) then
result := getItemAmount(tabBackpack.getSlotBox(__SLOT_NATURE));
if (result <= 0) then
if (tabBackpack.isItemInSlot(__SLOT_NATURE)) then
begin
writeln('getNaturesBackpack(): Misread natures, trying again...');
mouse(mainscreen.getCenterPoint().rand(200), MOUSE_MOVE);
result := getItemAmount(tabBackpack.getSlotBox(__SLOT_NATURE));
end;
end;
function getNatures(l: TNaturesLoc): integer;
begin
case l of
TNaturesLoc.BANK:
result := getNaturesBank();
TNaturesLoc.BACKPACK:
result := getNaturesBackpack();
else
writeln('getNatures: Invalid TNaturesLoc');
end;
writeln('getNatures: Player has '+toStr(result)+' nature runes');
end;
function getSmithingExp(bar: TBar; casts: integer): integer;
begin
result := abs(round(bar.expSmithing * casts));
end;
function getMagicExp(casts: integer): integer;
begin
result := abs(round(__EXP_SUPERHEAT * casts));
end;
function getProfit(bar: TBar): integer; // credit to euphemism
var
p, barString, barProfit: string;
begin
p := getPage('http://runescape.wikia.com/wiki/Calculator:Magic/Superheat');
barString := between('<a href="/wiki/' + bar.webString + '"', '</tr>', p);
barProfit := between('>', '<', between('e="c', '/s', barString));
barProfit := replace(barProfit, ',', '', []);
result := strToIntDef(barProfit, -1);
writeln(bar.name+' Profit: '+toStr(result));
end;
function perHour(amt, time: integer): integer;
begin
if (amt = -1) then
begin
result := -1;
exit;
end;
try
result := round((amt * 60) / (time / 60000));
except
end;
end;
const
__PADR = 44;
__TOK = ',';
procedure progressReport();
var
i, _expM, _expS, _worked, profit: integer;
_bar: TBar;
begin
setScriptProp(sp_WriteTimeStamp, [false]);
writeln('');
writeln('[-------------------------------------------]'); // 45
writeln('[ AIO SuperHeater '+SCRIPT_VERSION+' ]');
writeln('[ by Coh3n ]');
writeln('[-------------------------------------------]');
writeln('[ ]');
writeln(padR('[ '+msToTime(getTimeRunning, TIME_ABBREV), __PADR)+']');
writeln('[ ]');
for i := 0 to high(players) do
with players[i] do
begin
_bar := _bars[i];
_expM := getMagicExp(integers[_P_CASTS]);
_expS := getSmithingExp(_bar, integers[_P_CASTS]);
_worked := worked.getTime();
if (_bar.profit > 0) then
profit := (_bar.profit * integers[_P_CASTS])
else
profit := -1;
if (isActive) then
writeln(padR('[ Player ~ '+toStr(i)+' (True)', __PADR)+']')
else
writeln(padR('[ Player ~ '+toStr(i)+' ('+strings[_P_FALSE]+')', __PADR)+']');
writeln(padR('[ Worked ~ '+msToTime(_worked, TIME_BARE), __PADR)+']');
writeln(padR('[ Bar ~ '+_bar.name, __PADR)+']');
writeln(padR('[ Casts ~ '+groupDigits(integers[_P_CASTS], __TOK)+' ('+groupDigits(perHour(integers[_P_CASTS], _worked), __TOK)+' P/H)', __PADR)+']');
writeln(padR('[ Magic XP ~ '+groupDigits(_expM, __TOK)+' ('+groupDigits(perHour(_expM, _worked), __TOK)+' P/H)', __PADR)+']');
writeln(padR('[ Smith XP ~ '+groupDigits(_expS, __TOK)+' ('+groupDigits(perHour(_expS, _worked), __TOK)+' P/H)', __PADR)+']');
writeln(padR('[ Total XP ~ '+groupDigits(_expM+_expS, __TOK)+' ('+groupDigits(perHour((_expM+_expS), _worked), __TOK)+' P/H)', __PADR)+']');
writeln(padR('[ Profit ~ '+groupDigits(profit, __TOK)+' ('+groupDigits(perHour(profit, _worked), __TOK)+' P/H)', __PADR)+']');
writeln('[ ]');
disguise('Spells Cast: '+groupDigits(integers[_P_CASTS], __TOK));
end;
writeln('[-------------------------------------------]');
writeln('[-------------------------------------------]');
setScriptProp(sp_WriteTimeStamp, [false]);
end;
function isBackpackOpen(): boolean;
begin
result := tabBackpack.isOpen();
end;
function isMagicTabOpen(): boolean;
begin
result := gameTabs.isTabActive(TAB_MAGIC);
end;
function waitPackCountChanged(oldCount: integer; time: integer): boolean;
var
t: integer := getSystemTime() + time;
begin
while ((getSystemTime() < t) and (not result)) do
begin
result := (bankscreen.getPackCount() <> oldCount);
wait(50);
end;
end;
// Returns false if the player is finished casting (i.e. out of runes)
function setCasts(inBank: boolean): boolean;
var
nats, prevCasts: integer;
begin
result := true;
if (inBank) then
nats := getNatures(TNaturesLoc.BANK)
else
nats := getNatures(TNaturesLoc.BACKPACK);
if (nats <= 0) then
nats := 0;
with players[currentPlayer] do
begin
prevCasts := integers[_P_CASTS];
// failsafe in case there was a getNatures fail (can't cast more than the amount of primary ore)
if ((nats = 0) and (integers[_P_NATURES_START] - prevCasts > _bars[currentPlayer].amtPrimary)) then
exit;
integers[_P_CASTS] := (integers[_P_NATURES_START] - nats);
statsIncVariable(_bars[currentPlayer].statsName, (integers[_P_CASTS] - prevCasts));
if (integers[_P_CASTS] >= integers[_P_NATURES_START]) then
begin
result := false;
strings[_P_FALSE] := 'Finished';
end;
end;
end;
function depositJunk(bar: TBar): boolean;
var
endSlot: integer;
begin
endSlot := (bar.amtPrimary + boolToInt(players[currentPlayer].booleans[_P_COAL_BAG]));
writeln(endSlot);
result := bankscreen.deposit([1..endSlot]);
end;
function withdrawOres(bar: TBar): boolean;
var
nats, t, amt: integer;
begin
nats := getNatures(TNaturesLoc.BANK);
if (nats <= 0) then
exit;
if (nats >= bar.amtPrimary) then
begin
amt := (bar.amtPrimary * boolToInt(bar.amtPrimary <> 27)); // either bar.amtPrimary or 0
if (amt = 0) then
result := bankscreen.withdraw(_PRIMARY_SLOT, WITHDRAW_AMOUNT_ALL, __MOUSEOVERTEXT_ORE)
else
result := bankscreen.withdraw(_PRIMARY_SLOT, amt, __MOUSEOVERTEXT_ORE)
end else begin
// withdraw the amount of runes we have left
_bars[currentPlayer].amtPrimary := nats;
result := bankscreen.withdraw(_PRIMARY_SLOT, nats, __MOUSEOVERTEXT_ORE);
end;
if (bar.hasSecondary) then
begin
result := false;
bankscreen.withdraw(_SECONDARY_SLOT, WITHDRAW_AMOUNT_ALL, __MOUSEOVERTEXT_COAL);
t := (getSystemTime() + 3000);
while (getSystemTime() < t) do
begin
if (isItemIn(bankscreen.getPackSlotBox(_bars[currentPlayer].amtPrimary + 1))) then
begin
result := true;
break;
end;
wait(50);
end;
end;
end;
function fillCoalBag(bar: TBar): boolean;
var
oldCount: integer;
begin
if (not players[currentPlayer].booleans[_P_COAL_BAG]) then
exit;
if (bankscreen.withdraw(_SECONDARY_SLOT, WITHDRAW_AMOUNT_ALL, __MOUSEOVERTEXT_COAL)) then
begin
mouseBox(bankscreen.getPackSlotBox(__SLOT_COAL_BAG), MOUSE_MOVE);
oldCount := bankscreen.getPackCount();
fastClick(MOUSE_RIGHT);
if (chooseOption.select(['Fill', 'ill', 'll'], 500)) then
begin
wait(randomRange(100, 200));
mouseBox(bankscreen.getBankSlotBox(_PRIMARY_SLOT), MOUSE_MOVE); // gets rid of other spell info. that may appear after clicking "Fill"
// in case the coal bag only needed a few ore to fill
if (waitPackCountChanged(oldCount, 3000)) then
result := depositJunk(bar);
end;
end;
end;
function getBankPoint(bankDir: string): TPoint;
begin
case lowerCase(bankDir) of
'n': result := __BANK_NORTH;
'e': result := __BANK_EAST;
's': result := __BANK_SOUTH;
'w': result := __BANK_WEST;
else
writeln('getBankPoint(): ERROR; invalid bank direction for player: ', currentPlayer);
end;
end;
function openBank(): boolean;
var
c: integer;
t: integer := (getSystemTime() + 6000);
begin
if (not isLoggedIn()) then
exit;
if (bankscreen.isOpen()) then
begin
result := true;
exit();
end;
repeat
mouse(getBankPoint(players[currentPlayer].strings[_P_BANK_DIR]).rand(15), MOUSE_MOVE);
// a failsafe in case it tries to cast a spell on the bank booth
if (isMouseOverText(['Cast', 'ast', 'heat', 'item'])) then
begin
fastClick(MOUSE_LEFT);
wait(50 + random(50));
end;
fastClick(MOUSE_LEFT);
while (getSystemTime() < t) and (not result) do
begin
if (pinscreen.isOpen()) then
if (pinscreen.enter(players[currentPlayer].bankPin)) then
t := (getSystemTime() + 6000);
result := bankscreen.isOpen();
wait(50);
end;
inc(c);
until(result or (c >= 3));
end;
function bank(bar: TBar): boolean;
var
c: integer;
begin
if (not isLoggedIn()) then
exit;
findNormalRandoms();
antiban(__ANTIBAN_HOVER);
if (openBank()) then
begin
wait(200 + random(200));
if (not setCasts(true)) then // if player is finished casting
exit;
repeat // loop as a failsafe
depositJunk(bar);
if (not fillCoalBag(bar)) then // in case the bag is already full
depositJunk(bar);
result := withdrawOres(bar);
if (not result) then
begin
writeln('bank: Failed to withdraw ores '+toStr(c)+' times');
mouseOffClient(OFF_CLIENT_RANDOM);
end else
progressReport();
inc(c);
until(result or (not isLoggedIn()) or (c >= 3));
bankscreen.close();
end else
writeln('bank: Failed to open');
end;
function cast(): boolean;
var
p: TPoint;
begin
with players[currentPlayer] do
if (gameTabs.openTab(TAB_MAGIC)) then
begin
getMousePos(p.x, p.y);
if (inRange(p.x, integers[_P_SPELL_X] - 3, integers[_P_SPELL_X] + 3) and
inRange(p.y, integers[_P_SPELL_Y] - 3, integers[_P_SPELL_Y] + 3)) then // so the mouse doesn't move only a couple pixels when casting
mouse(p, MOUSE_LEFT)
else
mouse(point(integers[_P_SPELL_X] + randomRange(-3, 3), integers[_P_SPELL_Y]), MOUSE_LEFT);
result := true;
end;
end;
function castSlot(slot: integer; bar: TBar): boolean;
var
x, y, mouseSlot: integer;
successful: boolean = false;
begin
if (not isLoggedIn()) then
exit;
if (not cast()) then
exit;
if (waitFunc(@isBackpackOpen, 50, 2000)) then
begin
getMousePos(x, y);
mouseSlot := tabBackpack.pointToSlot(point(x, y));
antiban(__ANTIBAN_WAIT);
if (slot > mouseSlot) or (not isMouseOverText(bar.oreUptext, 300)) then
tabBackpack.mouseSlot(bar.amtPrimary, MOUSE_MOVE);
if (isMouseOverText(bar.oreUptext, 300)) then
begin
fastClick(MOUSE_LEFT);
successful := true;
end else
writeln('castSlot: Failed to find mouseOverText "'+toStr(bar.oreUptext)+'"');
end;
if (successful) then
result := waitFunc(@isMagicTabOpen, 50, 2000);
end;
function castKeyBind(barSlot: integer; bar: TBar): boolean;
var
b, bSlot: TBox;
oldOutline, c: integer;
t := (getSystemTime() + 3000);
begin
if (not tabBackpack.open()) then
exit();
if (bar.amtPrimary >= __SPECIAL_MOUSE_SLOTS) then
begin
b := tabBackpack.getSlotBox(bar.amtPrimary);
bSlot := intToBox(b.x1, b.y1, b.x2, b.y1 + round((b.y2 - b.y1) / 2)); // move to only the top half of the slot so mouseovertext doesn't cover other slots
mouseBox(bSlot, MOUSE_MOVE);
end else
tabBackpack.mouseSlot(bar.amtPrimary, MOUSE_MOVE);
tabBackpack.waitWhileLocked();
repeat
typeSend(players[currentPlayer].strings[_P_SPELL_KEY], false);
if (isMouseOverText(__MOUSEOVERTEXT_CAST, 300)) then
begin
oldOutline := countColor(ITEM_OUTLINE_BLACK, tabBackpack.getSlotBox(barSlot));
fastClick(MOUSE_LEFT);
// wait until bar replaces ore in backpack
while (not result) and (getSystemTime() < t) do
begin
result := (countColor(ITEM_OUTLINE_BLACK, tabBackpack.getSlotBox(barSlot)) <> oldOutline);
wait(50 + random(50));
end;
end;
c := c + 1;
until(result or (c >= 5));
if (not result) then
writeln('castKeyBind: Failed to cast via key bind');
end;
function castLoad(bar: TBar): boolean;
var
i, c, t: integer;
didCast: boolean;
begin
for i := 1 to (bar.amtPrimary) do
repeat
inc(t);
if (players[currentPlayer].strings[_P_SPELL_KEY] <> '') then
didCast := castKeyBind(i, bar)
else
didCast := castSlot(i, bar);
if (didCast) then
begin
t := 0;
inc(c);
break;
end;
if (getNatures(TNaturesLoc.BACKPACK) <= 0) then // if run out of runes
exit;
if (t >= 3) then // something went wrong, exit
exit;
until(not isLoggedIn());
result := (c = (bar.amtPrimary));
end;
procedure takeBreak();
var
t, breakTime: integer;
begin
if (length(players) > 1) then
players.next(true)
else begin
breakTime := (players[currentPlayer].integers[_P_BREAK] * 60000) + randomMinutes(5);
if (breakTime >= (30 * 60000)) then
players[currentPlayer].logout()
else
players[currentPlayer].exitToLobby();
t := (getSystemTime + (breakTime));
writeln('Breaking for '+msToTime(t - getSystemTime, TIME_BARE));
while (getSystemTime < t) do
begin
writeln('Time left: '+msToTime(t - getSystemTime, TIME_BARE));
wait(randomRange(10000, 20000));
end;
players[currentPlayer].login();
end;
findNormalRandoms();
end;
function setupPlayer(): boolean;
var
t: integer;
begin
if (players[currentPlayer].login()) then
begin
minimap.clickCompass();
mainscreen.setAngle(MS_ANGLE_HIGH);
result := true;
findNormalRandoms();
// in case a different tab is accidentially opened
while ((players[currentPlayer].integers[_P_NATURES_START] <= 0) and (t < 3)) do
begin
players[currentPlayer].integers[_P_NATURES_START] := getNatures(TNaturesLoc.BACKPACK);
wait(50 + random(50));
t := t + 1;
end;
writeln('Player '+toStr(currentPlayer)+' start Nature runes: '+
toStr(players[currentPlayer].integers[_P_NATURES_START]));
end;
end;
procedure setupScript();
var
i: integer;
begin
// set SRL variables
declarePlayers();
for i := 0 to high(players) do
if (not players[i].isActive) then
players[i].Strings[_P_FALSE] := 'User set false';
setLength(_bars, length(players));
for i := 0 to high(_bars) do
begin
_bars[i] := getBar(players[i].integers[_P_BAR]);
_bars[i].profit := getProfit(_bars[i]);
end;
end;
procedure next(why: string = '');
begin
findNormalRandoms();
players[currentPlayer].isActive := false;
if (players[currentPlayer].strings[_P_FALSE] = '') then
players[currentPlayer].strings[_P_FALSE] := why;
if ((length(players) <= 1) or (players.getActive <= 1)) then
begin
bankscreen.close();
tabBackpack.waitWhileLocked();
setCasts(false);
players[currentPlayer].logout();
writeln('Player '+toStr(currentPlayer)+': '+why);
if (players[currentPlayer].booleans[_P_SOUND]) then
playSound(scriptPath + 'finished.wav');
terminateScript();
end else
players.next(false);
end;
procedure onLogin();
begin
exitSquealOfFortune();
findNormalRandoms();
end;
procedure mainloop();
var
tmp: TTimeMarker;
begin
repeat
if (not setupPlayer()) then
begin
next('Login fail');
continue;
end;
tmp.start();
repeat
// break or switch players if it's time
with players[currentPlayer] do
if (integers[_P_TIME] > 0) then
if (tmp.getTime() >= (integers[_P_TIME] * 60000 {+ randomMinutes(5)})) then
begin
wait(100 + random(50));
takeBreak();
tmp.reset();
tmp.start();
break;
end;
if (not bank(_bars[currentPlayer])) then
begin
if (not isLoggedIn()) then // for connection loss
break;
writeln('Failed to bank, possibly lag; waiting about 10 seconds...');
wait(randomRange(8000, 12000));
if (not bank(_bars[currentPlayer])) then // retry
begin
next('Failed to bank');
break;
end;
end;
if (not castLoad(_bars[currentPlayer])) then
begin
if (not isLoggedIn()) then // for connection loss
break;
writeln('Failed to cast a full load, possibly lag; waiting about 10 seconds...');
wait(randomRange(8000, 12000));
if (not setCasts(false)) then // if finished
begin
next();
break;
end else
continue;
end;
//statsCommit();
until(not players[currentPlayer].isActive);
if (not players[currentPlayer].isActive) then
next('Set false in SRL');
until(players.getActive() <= 0);
end;
procedure terminate();
begin
progressReport();
end;
begin
clearDebug();
signature();
writeln('Loading, please wait...');
disguise('Spells Cast: 0');
{$IFNDEF SMART}
activateClient();
{$ENDIF}
setScriptProp(sp_WriteTimeStamp, [true]);
addOnTerminate('terminate');
setSupressExceptions(false);
SRL_Events[EVENT_LOGIN] := @onLogin;
smartShowConsole := false;
initPlayerForm();
runPlayerForm();
try
disableSRLLog := (not strToBool(playerForm.players[0].settings[9]));
disableSRLDebug := (not strToBool(playerForm.players[0].settings[10]));
disableIPScreenshots := (not strToBool(playerForm.players[0].settings[11]));
except
end;
if (not playerForm.isScriptReady) then
exit;
setupSRL();
setupScript();
mainloop();
end.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
Yeah if you don't use a Coal bag you shouldn't notice a difference.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I used a coal bag, didn't seem to work well. Worked perfectly without.
Last edited by Coh3n; 04-14-2014 at 01:12 AM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Once I am done with P1ng's Fishing script for the night I will see if the coal bag works for me. May as well get my 97 Magic to 99 already. :P
EDIT: [0:00:16]: Exception in Script: Runtime error: "Access violation" at line 1265, column 7 in file "C:\Users\Zacharie\Documents\Simba\Includes\sr l-6\lib\core\players.simba"
The following bitmaps were not freed: [Minimap Mask]
Last edited by Godless; 04-14-2014 at 02:04 PM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I'm fairly sure I did it correctly, as I've done it many times. I'll double check, may have just been a silly typo.
EDIT: Was just a typo. Coal bag is working fine for me. Although I do get a massive amount of lag using your script for some reason (even using Direct X - seems to be script related, nothing else has done it to me). Sadly I won't be able to use this to finish 99 Magic. Such a pity, seems like a good script.
Last edited by Godless; 04-15-2014 at 06:32 AM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Coh3n,
She's working great with the coal bag.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
it works pretty good i got it to run for 2 hrs last night but today it is banking after entering the pin it thinks it failed to bank even though it didnt then logs out.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Computer is not old or slow, but it isn't great. Not sure what it could be. Maybe my connection was having a bad day. I'll try again a bit later and keep my fingers crossed. Could never get Simba to work without SMART, even though I followed the instructions. Not sure why.
I don't think it's in the instructions (at least not my guide), but to run without SMART you need to run it in DirectX. Outside of SMART, Simba can't read colors from OpenGL.
If it does turn out the be the script I might have to take a look and see if there's something being called every ~1ms.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
A amazing script! Worked well for me.
Withdrawing and depositing random items, sometimes not withdrawing coal for steel bars, making iron instead.
Don't know why this is happening, nothing peculiar in debug. Not using coal bag.
Last edited by Bulbasaur; 04-28-2014 at 03:44 PM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
The bank will open without delay when clicked the first time, then the script immediately rapidly clicks where it thinks the banker is.
Lag is called almost every inventory, though my connection appears to be stable. 80-120ms latency to many servers.
Gapping my bank like this cured the withdrawal of random items. I also reduced the wait time of lag breaks.
400 casts p/h to 850 p/h. Good enough for my needs.
Last edited by Bulbasaur; 04-28-2014 at 06:26 PM.
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
There are currently 1 users browsing this thread. (0 members and 1 guests)