SRL Archive - Jr. Member RS3 Scripts

[RS3] Brose AIO Stationary Crafter, Fletcher, Herbs Cleaner, Pot Maker, etc etc


Brose

2014-12-14 17:02:07

Brose's AIO Stationary Crafter v1.5

UPDATE: Version 1.5 is released!!
How did a simple stationary crafting script get so complicated… :duh:

There is a similar script on the First Scripts forum. However this script is an improvement over the previous version.

Features
  • This script is basically used to replace those mundane stationary crafting kind of tasks which involves grabbing a bunch of stuff from your bank and doing something with them within a few simple clicks. You can fletch logs into bows, string bows, cut stones, clean herbs, make unfinished pots, and probably alot more.
  • Contains antiban and actAFK functions.
  • [New] Has an antiban function which simulates checking chat. I personally tend to stay in the private chat tab so that feature was pretty much for my own use. It will click on the 'All Chat' and scroll up a certain number of times, pause, then scroll back down and click back to 'private chat'.
  • Works on all stationary crafting / herbing / mixing / fletching etc…
  • [NEW]Works for transmutation and overload potion mixing as well!!!
  • Has an option for you to use presets or not. This was mainly because the festive aura was preventing me from using presets. Someone informed me that the aura no longer prevent presets from being used. Hurrayz!
  • Sound triggers to alert you when you are done or when the script is terminated
  • [NEW] Able to return the GE price for the materials and final output product and calculate profits. It works no matter what items(s) you are crafting!! Ok, this function is a little pain in the nether region. So far, anything with a crazy mouse over text will throw the script out of the window. I am not kidding you. Simba reads the mouseOverText for Yew Shortbow as 'Wield Yew shortbow 0gggBB i # st AFFgrgFX i @ze AggB i ArrBV TXFB i RgnBB4 gFBB4 i IBvBI i gg' This includes weapons. However I already made it work for bows since when you fletch, the output are bows. Which means for items with description which have the mini text starting with 'Damage: ', it will work. I wasn't bothered with adding in other functions to trigger on other text for armours or staves or what not yet since I dont really craft staves myself.

How to use it
IMPORTANT PLEASE READ. With the new Transmutation function and Overloads it is now a pain in the behind to fill in all the stuff…
  1. Fill in your player login and password and the world
  2. Loads_to_do is simply what it says.
  3. USE_PRESETS put True if you are going to use it. I coded this in when the festive aura got added in and prevented me from using my presets. If you are using presets, use preset 1.
  4. Change the anti_ban frequency and afk_freq if you want to.
  5. WHICH_BANK is to select which bank you are going to be running this script from. The entire list is further down in comments. It is defaulted to the Burthorpe Bank. Which means if you are not changing a thing, it only works if you are standing at the Burthorpe bank.
  6. CRAFT_TYPE. Ok this is very important. Please set this correctly. I am going to copy and paste what I wrote in the script.
  7. Your options are:
    ONE_MAT : Cleaning herbs, cutting logs into shafts, fletching logs into
    unfinished bows, etc. There would be 28 of the same material
    TWO_MAT : Mixing clean herbs into vial of water, stringing bows, finishing
    pots, etc. 1:1 ratio needed which means 14 of each material
    TRANSMUTE : Divination transmutation. Slot 1 will be the energy whilst the
    remaining will be the material.
    **IMPORTANT** Please fill in Mats Needed and output below for profit to be correct
    OVERLOAD : Total of 6 materials. 5 different types of potions and 1 type of
    clean herb. 4 of each type making a total of 24.
  8. The next 3 constants namely, OUTPUT_PER_LOAD, MAT_ONE_NEEDED, MAT_TWO_NEEDED, only matters when you are using CRAFT_TYPE = 'TRANSMUTE'. If you are using the other 3 options, just ignore.
  9. The next few constants only matter is you are NOT going to use preset. And if so, set the slot in your bank for the 1st material and the slot for the 2nd material and so on. The top left slot is slot 1.
  10. If you want the script to alert you when it is done or when it is terminated, create a new folder called 'sounds' in the includes folder and download the rar file and unzip the wave file in it.
  11. Stand beside your designated bank and press play.


program Brose_AIO_Crafter;
{$DEFINE SMART}
{$i srl-6/srl.simba}

//////////////// Setup the usual stuff here /////////////////////
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
isMember := true;
world := 69;
end;
currentPlayer := 0;
end;

const
{ Change these constants if you want }
LOADS_TO_DO = 24; //Self explanatory
USE_PRESETS = TRUE; //If TRUE it will use preset 1, if FALSE it wont use presets
ANTIBAN_FREQ = 3; //% chance to perform antiban every 3 secs of crafting time.
AFK_FREQ = 1; //% chance to act AFK every crafting cycle.
WHICH_BANK = BANK_TABLE_BURTHORPE;
//The failsafe only works at Burthorpe Bank.
{ Misc constants }
CRAFT_TYPE = 'TWO_MAT'; //See below...
(*------------------------------------------------------------------------------
I would highly suggest reading the forum thread
@ https://villavu.com/forum/showthread.php?t=111268

Your options are:
ONE_MAT : Cleaning herbs, cutting logs into shafts, fletching logs into
unfinished bows, etc. There would be 28 of the same material
TWO_MAT : Mixing clean herbs into vial of water, stringing bows, finishing
pots, etc. 1:1 ratio needed which means 14 of each material
TRANSMUTE : Divination transmutation. Slot 1 will be the energy whilst the
remaining will be the material.
**IMPORTANT** Please fill in Mats Needed and output below for profit to be correct
OVERLOAD : Total of 6 materials. 5 different types of potions and 1 type of
clean herb. 4 of each type making a total of 24.
------------------------------------------------------------------------------*)

(* If CRAFT_TYPE = TRANSMUTE, please fill in the next section. If not just ignore
I will be using Maple logs to Yew logs transmutation as example to explain
The transmutation requires 2 lustrous energy and 3 Maple logs to create 1 Yew log *)

OUTPUT_PER_LOAD = 14; //If you are transmuting yew logs, you can do 9 per load
MAT_ONE_NEEDED = 1; //No of material 1 needed per single output. (2) energy
MAT_TWO_NEEDED = 1; //No of material 2 needed per single output. (3) Maple logs
//OUTPUT_NUMBER = 1; //Personally I dont know of anything that creates more than 1 output
(*****************************************************************************)

{ This section is only relevant if USE_PRESETS = FALSE }
MAT1_ISINSLOT = 2; //The slot Mat 1 is found in the bank. This is not impt if USE_PRESETS = TRUE
MAT2_ISINSLOT = 3; //The slot Mat 2 is found in the bank - This is not impt if USE_PRESETS = TRUE.
{ Mats 2 to 6 are only used for overloads }
MAT3_ISINSLOT = 4; //The slot Mat 3 is found in the bank. This is not impt if USE_PRESETS = TRUE
MAT4_ISINSLOT = 5; //The slot Mat 4 is found in the bank - This is not impt if USE_PRESETS = TRUE.
MAT5_ISINSLOT = 6; //The slot Mat 5 is found in the bank. This is not impt if USE_PRESETS = TRUE
MAT6_ISINSLOT = 7; //The slot Mat 6 is found in the bank - This is not impt if USE_PRESETS = TRUE.

(*/////////////////////////////////////////////////////////////////////////////

/$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$$ /$$
/$$__ $$|__ $$__/ /$$__ $$| $$__ $$ | $$
| $$ \__/ | $$ | $$ \ $$| $$ \ $$ | $$
| $$$$$$ | $$ | $$ | $$| $$$$$$$/ | $$
\____ $$ | $$ | $$ | $$| $$____/ |__/
/$$ \ $$ | $$ | $$ | $$| $$
| $$$$$$/ | $$ | $$$$$$/| $$ /$$
\______/ |__/ \______/ |__/ |__/

//////////////////////////////////////////////////////////////////////////////*)

(*
BANK_NPC_BLUE
BANK_NPC_GREY
BANK_NPC_GREEN
BANK_NPC_DRAYNOR
BANK_BOOTH
BANK_CHEST_SW
BANK_CHEST_SHANTAY
BANK_CHEST_DUEL
BANK_CHEST_CW
BANK_CHEST_GROTTO
BANK_TABLE_BURTHORPE
BANK_CHEST_LUMBRIDGE
*)

SCRIPT_VERSION = '1.5';

{ Bank color constants }
bank_col = 6839387;
bank_tol = 13;
bank_hue = 0.55;
bank_sat = 0.33;

var
a, b, k, profitPer, loadsDone, startingXP, antibanCount, actAfkCount: integer;
mat_1_Name, mat_2_Name, mat_3_Name, mat_4_Name, mat_5_Name, mat_6_Name, output_Name, output2_Name : String;

procedure progressReport;
var
loadsPH, XP, XPH, profitPerLoad, profitPH : Integer;
begin
XP := (chatBox.getXPBar - startingXP);
XPH := round(XP * (3600.0 / (getTimeRunning / 1000.0)));
loadsPH := round((loadsDone * (3600.0 / (getTimeRunning / 1000.0))));
profitPerLoad := round(profitPer * k);
profitPH := round((profitPerLoad * loadsDone) * (3600.0 / (getTimeRunning / 1000.0)));

writeln('|===========================================================|');
writeln('| Brose AIO Crafter v' + padR(toStr(SCRIPT_VERSION), 22), '|');
writeln('|===========================================================|');
writeln(padR('| Currently making: ' + output_Name, 60) + '|');
writeln(padR('| Running For: ' + timeRunning, 60) + '|');
writeln(padR('| Loads done: ' + groupDigits(loadsDone, ','), 40) + padR('Loads/H: ' + groupDigits(loadsPH, ','), 20) + '|');
writeln(padR('| Profit made: ' + groupDigits((profitPerLoad * loadsDone), ','), 40) + padR('Profit/Hour: ' + groupDigits(profitPH, ','), 20) + '|');
writeln(padR('| Exp Earned: ' + groupDigits(XP, ','), 40) + padR('Exp/Hour: ' + groupDigits(XPH, ','), 20) + '|');
writeln(padR('| Antibans performed: ' + groupDigits(antibanCount, ','), 40) + padR('AFK Count: ' + groupDigits(actafkcount, ','), 20) + '|');
writeln('|___________________________________________________________|');
writeln('|___________________________________________________________|');

end;

procedure paintStatus(status: string);
begin
{$IFDEF SMART}
try
smartImage.clear();
smartImage.drawText('Status: ' + status, point(chatbox.x2 - 320, chatbox.y2 - 19), smallChars, false, 255);
except
end;
{$ENDIF}
end;

procedure collectMatName()
var
mat_1, mat_2, mat_3, mat_4, mat_5, mat_6 : string;
begin
case (CRAFT_TYPE) of
'ONE_MAT': begin
tabBackpack.mouseSlot(randomRange(1,3), MOUSE_MOVE);
writeLn('getting mat 1 name... (1)');
wait(randomRange(1000,1200));
mat_1:= getMouseOverText;
mat_1_Name:= copy(mat_1, (Pos(' ', mat_1) + 1), length(mat_1));
writeln(mat_1_Name);
end;
'TWO_MAT': begin
tabBackpack.mouseSlot(randomRange(1,3), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 1 name ... (2)');
mat_1:= getMouseOverText;
mat_1_Name:= copy(mat_1, (Pos(' ', mat_1) + 1), length(mat_1));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(16,18), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 2 name ... (2)');
mat_2:= getMouseOverText;
mat_2_Name:= copy(mat_2, (Pos(' ', mat_2) + 1), length(mat_2));
writeln(mat_1_Name + ', ' + mat_2_Name);
end;
'TRANSMUTE': begin
tabBackpack.mouseSlot(1, MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 1 name ... (transmute)');
mat_1:= getMouseOverText;
mat_1_Name:= copy(mat_1, (Pos(' ', mat_1) + 1), length(mat_1));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(6,9), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 2 name ... (transmute)');
mat_2:= getMouseOverText;
mat_2_Name:= copy(mat_2, (Pos(' ', mat_2) + 1), length(mat_2));
writeln(mat_1_Name + ', ' + mat_2_Name);
end;
'OVERLOAD': begin
tabBackpack.mouseSlot(randomRange(1,4), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 1 name ... (overload)');
mat_1:= getMouseOverText;
mat_1_Name:= copy(mat_1, (Pos(' ', mat_1) + 1), length(mat_1));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(5,8), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 2 name ... (overload)');
mat_2:= getMouseOverText;
mat_2_Name:= copy(mat_2, (Pos(' ', mat_2) + 1), length(mat_2));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(9,12), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 3 name ... (overload)');
mat_3:= getMouseOverText;
mat_3_Name:= copy(mat_3, (Pos(' ', mat_3) + 1), length(mat_3));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(13,16), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 4 name ... (overload)');
mat_4:= getMouseOverText;
mat_4_Name:= copy(mat_4, (Pos(' ', mat_4) + 1), length(mat_4));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(17,20), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 5 name ... (overload)');
mat_5:= getMouseOverText;
mat_5_Name:= copy(mat_5, (Pos(' ', mat_5) + 1), length(mat_5));

wait(randomRange(500,800));
tabBackpack.mouseSlot(randomRange(21,24), MOUSE_MOVE);
wait(randomRange(1000,1200));
writeln('getting mat 6 name ... (transmute)');
mat_6:= getMouseOverText;
mat_6_Name:= copy(mat_6, (Pos(' ', mat_6) + 1), length(mat_6));
writeln(mat_1_Name + ', ' + mat_2_Name + ', ' + mat_3_Name + ', ' + mat_4_Name + ', ' + mat_5_Name + ', ' + mat_6_Name)
end;
end;
end;

procedure collectOutputName()
var
z : integer;
output : string;
begin
tabBackpack.mouseSlot(2, MOUSE_MOVE);
wait(randomRange(1000,1200));
output:= getMouseOverText;

{ this is for bows with the mini text Damage: }
if (Pos(' 0gggBB', output) = 0) then
z := length(output)
else
z := (Pos(' 0gggBB', output) - 1);
{ You have no idea how much headache this portion gave me... }

output_Name:= copy(output, (Pos(' ', output) + 1), (z - Pos(' ', output)) );
end;

procedure getPrice();
var
a, b, c, mat_1_Price, mat_2_Price, mat_3_Price, mat_4_Price, mat_5_Price, mat_6_Price, output_Price, output2_Price: integer;
mat_1_String, mat_2_String, mat_3_String, mat_4_String, mat_5_String, mat_6_String,
output_String, output2_string, wikiaPageMat1, wikiaPageMat2, wikiaPageMat3, wikiaPageMat4,
wikiaPageMat5, wikiaPageMat6, wikiaPageOutput, wikiaPageOutput2, priceString : string;
begin
{ this section replaces spaces with _ }
mat_1_String:= stringReplace(mat_1_Name, ' ', '_', [rfReplaceAll]);
output_String:= stringReplace(output_Name, ' ', '_', [rfReplaceAll]);

if (CRAFT_TYPE <> 'ONE_MAT') then
mat_2_String:= stringReplace(mat_2_Name, ' ', '_', [rfReplaceAll]);

if (CRAFT_TYPE = 'OVERLOAD') then
begin
mat_3_String:= stringReplace(mat_3_Name, ' ', '_', [rfReplaceAll]);
mat_4_String:= stringReplace(mat_4_Name, ' ', '_', [rfReplaceAll]);
mat_5_String:= stringReplace(mat_5_Name, ' ', '_', [rfReplaceAll]);
mat_6_String:= stringReplace(mat_6_Name, ' ', '_', [rfReplaceAll]);
//output2_String:= stringReplace(output2_Name, ' ', '_', [rfReplaceAll]);
end;

{ this section pulls price from wiki page }
wikiaPageMat1 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_1_String);
mat_1_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat1), numbers), -1);
Writeln('Price per ' + mat_1_Name + ': ' + toStr(mat_1_Price));

wikiaPageOutput := getPage('http://runescape.wikia.com/wiki/Exchange:' + output_String);
output_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageOutput), numbers), -1);
Writeln('Price per ' + output_Name + ': ' + toStr(output_Price));

if (CRAFT_TYPE <> 'ONE_MAT') then
begin
wikiaPageMat2 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_2_String);
mat_2_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat2), numbers), -1);
Writeln('Price per ' + mat_2_Name + ': ' + toStr(mat_2_Price));
end;

if (CRAFT_TYPE = 'OVERLOAD') then
begin
wikiaPageMat3 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_3_String);
mat_3_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat3), numbers), -1);
Writeln('Price per ' + mat_3_Name + ': ' + toStr(mat_3_Price));

wikiaPageMat4 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_4_String);
mat_4_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat4), numbers), -1);
Writeln('Price per ' + mat_4_Name + ': ' + toStr(mat_4_Price));

wikiaPageMat5 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_5_String);
mat_5_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat5), numbers), -1);
Writeln('Price per ' + mat_5_Name + ': ' + toStr(mat_5_Price));

wikiaPageMat6 := getPage('http://runescape.wikia.com/wiki/Exchange:' + mat_6_String);
mat_6_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageMat6), numbers), -1);
Writeln('Price per ' + mat_6_Name + ': ' + toStr(mat_6_Price));

(* wikiaPageOutput2 := getPage('http://runescape.wikia.com/wiki/Exchange:' + output2_String);
output2_Price := strToIntDef(ExtractFromStr(between('GEPrice">', '</span>', wikiaPageOutput2), numbers), -1);
Writeln('Price per ' + output2_Name + ': ' + toStr(output2_Price)); *)
end;

if (CRAFT_TYPE = 'TRANSMUTE') then
begin
a:= OUTPUT_PER_LOAD;
b:= MAT_ONE_NEEDED;
c:= MAT_TWO_NEEDED;
end else
begin
a:= 1;
b:= 1;
c:= 1;
end

profitPer := (( a * (output_Price{ + output2_Price})) - ((b * mat_1_Price) + (c * mat_2_Price) + mat_3_Price + mat_4_Price + mat_5_Price + mat_6_Price));
writeln('Profit per ' + output_Name + ': ' + toStr(profitPer));
if (profitPer < 0) then
writeLn('OMG we are losing money!!! Are you serious about this?');
end;

procedure antiBan();
var
i, x, y : integer;
begin
if Random(100) < AntiBan_Freq then
begin
paintStatus('Activating Antiban');
writeLn('Activating Antiban');
case Random(11) of
0: RandomRClickItem();
1: begin
MouseOffClient(Random(5));
wait(randomRange(3000,7000));
end;
2: PickUpMouse;
3: MouseMovingObject();
4: SleepAndMoveMouse(200 + Random(50));
5: PickUpMouse();
6: begin
hoverRandomSkill();
wait(gaussRangeInt(1500,5000));
end;
7: randomCameraAngle(MS_ANGLE_HIGH);
8: begin
case random(3) of
0: begin
tabStats.getSkillLevel(SKILL_FLETCHING);
hoverSkill(SKILL_FLETCHING);
end;
1: begin
tabStats.getSkillLevel(SKILL_CRAFTING);
hoverSkill(SKILL_CRAFTING);
end;
2: begin
tabStats.getSkillLevel(SKILL_HERBLORE);
hoverSkill(SKILL_HERBLORE);
end;
end;
wait(gaussRangeInt(1500,5000));
end;
9: smallRandomMouse();
10: begin //Simulates checking chat
i := random(7);
mouse(24, 491, 3, 3, MOUSE_LEFT);
mouseBox(chatbox.getChatArea(), MOUSE_MOVE);
wait(randomRange(500,2000));
getMousePos(x, y);
mousescroll(point(x, y), (i + 3), false);
wait(random(2500,5000));
mousescroll(point(x, y), (i + 4));
wait(random(400,600));
mouse(70, 491, 3, 3, MOUSE_LEFT);
end;
end;
inc(antiBanCount);
end;
end;

procedure actAFK();
var
i,k : integer;
begin
if RandomRange(0,101) < AFK_FREQ then
begin
i:= gaussRangeInt(60000,360000);
k:= round (i/1000);
MouseOffClient(Random(5));
writeln(padR('[ Acting AFK For: ' + inttostr(k), 1) + 'secs ]');
paintStatus(padR('Going AFK for: ' + inttostr(k), 1) + 'secs...');
wait (i);
inc (actafkCount);
end;
end;

procedure boing();
begin
PlaySound('Includes/sounds/boing.wav');
end;

procedure getStuff();
begin
case (USE_PRESETS) of
TRUE: begin
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
wait(randomRange(1000, 2000));
writeln('Getting stuff');
end;
FALSE: begin
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomRange(1000, 2000));
writeln('Getting stuff');
case (CRAFT_TYPE) of
'ONE_MAT': begin
case random(10) of
0..4: bankScreen.withdraw(MAT1_ISINSLOT, WITHDRAW_AMOUNT_ALL_BUT_ONE);
5..8: bankScreen.withdraw(MAT1_ISINSLOT, WITHDRAW_AMOUNT_ALL);
9: bankScreen.withdraw(MAT1_ISINSLOT, randomRange(14, 99));
end;
wait(randomrange(1000,1700));
end;
'TWO_MAT': begin
bankScreen.withdraw(MAT1_ISINSLOT, 14);
wait(randomrange(1000,1700));
case random(10) of
0..4: bankScreen.withdraw(MAT2_ISINSLOT, WITHDRAW_AMOUNT_ALL_BUT_ONE);
5..8: bankScreen.withdraw(MAT2_ISINSLOT, WITHDRAW_AMOUNT_ALL);
9: bankScreen.withdraw(MAT2_ISINSLOT, randomRange(14, 99));
end;
wait(randomrange(1000,1700));
end;
'TRANSMUTE': begin
case random(10) of
0..4: bankScreen.withdraw(MAT1_ISINSLOT, WITHDRAW_AMOUNT_ALL_BUT_ONE);
5..9: bankScreen.withdraw(MAT1_ISINSLOT, WITHDRAW_AMOUNT_ALL);
end;
wait(randomrange(1000,1700));
case random(10) of
0..4: bankScreen.withdraw(MAT2_ISINSLOT, WITHDRAW_AMOUNT_ALL_BUT_ONE);
5..8: bankScreen.withdraw(MAT2_ISINSLOT, WITHDRAW_AMOUNT_ALL);
9: bankScreen.withdraw(MAT2_ISINSLOT, randomRange(27, 99));
end;
wait(randomrange(1000,1700));
end;
'OVERLOAD': begin
bankScreen.withdraw(MAT1_ISINSLOT, 4);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT2_ISINSLOT, 4);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT3_ISINSLOT, 4);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT4_ISINSLOT, 4);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT5_ISINSLOT, 4);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT6_ISINSLOT, 4);
wait(randomrange(1000,1700));
end;
end;
end;
end;
bankScreen.close();
end;

procedure clickBank();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if productionScreen.isOpen() then //this is failsafe in case production screen
productionScreen.close(); //is still opened

bankScreen.open(WHICH_BANK);
if bankScreen.isOpen() then
begin
wait(randomRange(2000, 3000));
getStuff();
end else
begin //this is supposed to be the failsafe for bank finding
writeln('Cant find bank, failsafe kicking in...');
findColorsSpiralTolerance(x, y, TPA, bank_col, mainScreen.getbounds(), bank_tol, colorSetting(2, bank_hue, bank_sat));
if length(TPA) < 1 then
begin
writeLn('Even the failsafe failed... Couldn''t find the bank for some reason!');
exit;
end else;

smartImage.clearArea(mainScreen.getBounds());
mouseSpeed := randomRange(10, 30);
ATPA := TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
writeln('Locating bank...');
if isMouseOverText(['ank', 'booth'], 1000) then
begin
fastclick(mouse_left);
getStuff();
end else writeLn('Couldn''t find the bank for some reason!');
break;
end
end;
end;

procedure craftOneMats();
begin
mouseSpeed := randomRange(20, 40);
tabBackPack.mouseSlot(randomRange(1,7), MOUSE_LEFT);
writeLn('Opening crafting window');
paintStatus('Opening craft window');
end;

procedure craftTwoMats();
begin
case random(5) of
0..3: begin
mouseSpeed := randomRange(20, 40);
tabBackPack.mouseSlot(randomRange(1, 11), MOUSE_LEFT);
wait(randomrange(300,800));
tabBackPack.mouseSlot(randomRange(16, 28), MOUSE_LEFT);
end;
4: begin
mouseSpeed := randomRange(20, 40);
tabBackPack.mouseSlot(randomRange(16, 28), MOUSE_LEFT);
wait(random(300,800));
tabBackPack.mouseSlot(randomRange(1, 11), MOUSE_LEFT);
end;
end;
writeLn('Opening crafting window');
paintStatus('Opening craft window');
end;

procedure craftTransmute();
begin
mouseSpeed := randomRange(20, 40);
tabBackPack.mouseSlot(1, MOUSE_LEFT);
writeLn('Opening crafting window');
paintStatus('Opening craft window');
end;

procedure craftOverload();
begin
mouseSpeed := randomRange(20, 40);
tabBackPack.mouseSlot(randomRange(1, 3), MOUSE_LEFT);
wait(randomrange(300,800));
tabBackPack.mouseSlot(randomRange(5, 12), MOUSE_LEFT);
writeLn('Opening crafting window');
paintStatus('Opening craft window');
end;

procedure startCraft();
var
craftTime: TTimeMarker
begin
mouseSpeed := randomRange(10, 30);
craftTime.start();

repeat
wait(2000);
until productionScreen.isOpen() or toolScreen.isOpen();

if toolScreen.isOpen() then
begin;
toolScreen.select('Knife');
end;

if productionScreen.isOpen() then
begin;
productionScreen.clickStart();
writeLn('Crafting...');
paintStatus('Crafting stuff');
antiBan();
repeat
wait(3000);
antiBan();
until not progressScreen.isOpen() or (craftTime.getTime() > 60000);
end;
end;

procedure mainLoop();
begin
clickBank();

while (a < 1) do
begin
collectMatName();
inc(a);
end;

case (CRAFT_TYPE) of
'ONE_MAT': craftOneMats();
'TWO_MAT': craftTwoMats();
'TRANSMUTE': craftTransmute();
'OVERLOAD': craftOverload();
end;

startCraft();

while (b < 1) do
begin
collectOutputName();
getPrice();
inc(b);
end;

inc(loadsDone);
progressReport();
actAFK();
end;

begin
clearDebug();
{$IFDEF SMART}
smartEnableDrawing := true;
{$ENDIF}
setupSRL();
declarePlayers();
disableSRLdebug:=true;

if not isLoggedIn() then
begin
players[currentPlayer].login();
exitTreasure();
claimTicket();
mainScreen.setZoom(true);
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;

startingXP := chatBox.getXPBar;
addOnTerminate('boing');

case (CRAFT_TYPE) of
'ONE_MAT' : k:= 28;
'TWO_MAT' : k:= 14;
'TRANSMUTE' : k:= OUTPUT_PER_LOAD;
'OVERLOAD' : k:= 4;
end;

repeat
begin
smartImage.clearArea(mainScreen.getBounds());
mainLoop();
end;
until (loadsDone >= LOADS_TO_DO);

if (loadsDone >= LOADS_TO_DO) then
begin
writeLn('Okay! All loads completed!');
PlaySound('Includes/sounds/Cha_Ching_Register.wav');
end;
end.

IROC-Z

2014-12-14 19:18:42

Congrats on the release!

keff

2014-12-14 20:13:43

Gratz on release!!

GRIM

2014-12-14 21:06:47

Nice release -
Also Festive Auras were updated to allow the use of presets with them!
=)

J_R

2014-12-15 01:00:22

For things that require a different ratio to 1 and 1:1 I can think of overloads. Even though overloads are not too tedious, I tend to have to do them by hand when I'd prefer to be able to bot this :P

For transmutation, it's super easy to get that working. Just bind the energy to an action bar slot and press that + spacebar to do the transmutation. It's probably faster to do this strategy for fletching/bonfires/cleaning herbs too; however there are some things I'm sure this might fail on (making extreme potions is one, don't remember the rest). Definitely something worth looking into imo.

The Mayor

2014-12-15 04:03:54

Very nice script ;) I'm sure you don't need all those global variables though :)

Brose

2014-12-15 05:57:57

From: The Mayor
Very nice script ;) I'm sure you don't need all those global variables though :)

I was thinking about that very carefully but I thought i needed them because half of the global variables belong to the price checking feature. The way I did it was because I needed to grab the name twice. Once before I start crafting, and once after i finish crafting. Since I needed 2 procedure / function to accomplish them, I am not sure how to do it without using global var. If it is those hardcoded kind of getPrice function or procedure or if I only need to do it once then I wouldnt need that many global var.
The other half of the global var …. err yes… I should have placed them under my progressReport's procedure =) Oops!

Brose

2014-12-15 06:33:34

From: J_R
For things that require a different ratio to 1 and 1:1 I can think of overloads. Even though overloads are not too tedious, I tend to have to do them by hand when I'd prefer to be able to bot this :P

For transmutation, it's super easy to get that working. Just bind the energy to an action bar slot and press that + spacebar to do the transmutation. It's probably faster to do this strategy for fletching/bonfires/cleaning herbs too; however there are some things I'm sure this might fail on (making extreme potions is one, don't remember the rest). Definitely something worth looking into imo.


Actually the transmutation feature would be exactly the same as the steps for crafting 1 mat except that instead of random-ing clicking through 1 to 11 slots to begin the crafting, you only left click 1 slot instead. I might have to think of a way to do that auto GetPrice thingy. Maybe a way to detect no of different items in backpack.

Sorry what are overloads? I am new to this game and even newer to scripting
Ok nvm, I just wikied and youtube it. So basically it requires 6 mats. 5 different pots and a clean herb. 4 each to take up 24 slots. And you mix it by USE-ing any of the pots or herb on another pot and… does the production screen appear? The youtube videos are not very clear and in legacy mode or some different looking UI that i dont understand.

uhit

2014-12-15 06:59:45

From: Brose
Actually the transmutation feature would be exactly the same as the steps for crafting 1 mat except that instead of random-ing clicking through 1 to 11 slots to begin the crafting, you only left click 1 slot instead. I might have to think of a way to do that auto GetPrice thingy. Maybe a way to detect no of different items in backpack.

Sorry what are overloads? I am new to this game and even newer to scripting
Ok nvm, I just wikied and youtube it. So basically it requires 6 mats. 5 different pots and a clean herb. 4 each to take up 24 slots. And you mix it by USE-ing any of the pots or herb on another pot and… does the production screen appear? The youtube videos are not very clear and in legacy mode or some different looking UI that i dont understand.


Production screen does appear yep

Brose

2014-12-15 09:42:27

From: uhit
Production screen does appear yep


So lets say for overload mixing.
I withdraw the materials in this particular setup
slots 1 to 4: Clean herbs
slots 5 to 8: Pot A
slots 9 to 12: Pot B
slots 13 to 16: Pot C
slots 17 to 20: Pot D
slots 21 to 24: Pot E
Last 4 slots empty

And I click herb and use it on any of the pots. Production Screen comes up. I click start. Then whats the outcome?
Do I get the overload potions in slot 1 to 4? And empty vials for the remaining slots 5 to 20?

uhit

2014-12-15 12:04:23

From: Brose
So lets say for overload mixing.
I withdraw the materials in this particular setup
slots 1 to 4: Clean herbs
slots 5 to 8: Pot A
slots 9 to 12: Pot B
slots 13 to 16: Pot C
slots 17 to 20: Pot D
slots 21 to 24: Pot E
Last 4 slots empty

And I click herb and use it on any of the pots. Production Screen comes up. I click start. Then whats the outcome?
Do I get the overload potions in slot 1 to 4? And empty vials for the remaining slots 5 to 20?


Yes

J_R

2014-12-15 15:50:59

Sounds about right but the extra vials shouldn't matter for the purpose of the script. If you wanted to be extra-weird I suppose you could actually use the pots with each other to still make overloads, but I don't think anyone does it this way :P

Brose

2014-12-16 04:58:04

From: J_R
Sounds about right but the extra vials shouldn't matter for the purpose of the script. If you wanted to be extra-weird I suppose you could actually use the pots with each other to still make overloads, but I don't think anyone does it this way :P


Actually when I looked at some youtube videos it seems that some of them do use pots on one another to be able to make it. However the problem would be that left clicking on pots "might" drink it instead and would make it look really odd if you were right clicking to select use all the time when you are crafting overloads for half and hour or so.

But yea it supports transmutation and overloads now…

J_R

2014-12-16 05:48:31

Cool, will definitely give it a spin when I get a herblore pillar :)