Brose
2014-12-12 17:49:28
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.
How to use it
1. Fill in your player login and password and the world
2. Change the anti_ban frequency and afk_freq if you want to.
3. 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.
4. The number_of_mats constant determines how many materials are you using for your particular operation. Eg. If you are fletching logs to bow. Thats 1. If you are cleaning herbs, thats 1 as well. If you are stringing bows, thats 2. If you are mixing herbs into vial of water, thats 2. So far for those 2 mats craft, it only works on those ratio 1:1 crafts which means it will be 14 of each material in your inventory. I personally do not craft or create or mix anything with a different ratio. If you do, let me know.
5. Loads_to_do is simply what it says.
6. 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.
7. The next 2 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. The top left slot is slot 1.
8. If you want the script to alert you when it is done, create a new folder called 'sounds' in the includes folder and download the rar file and unzip the wave file in it.
Ok have fun.
You can fletch logs into bows, string bows, cut stones, clean herbs, make unfinished pots, and probably alot more.
How to use it
1. Fill in your player login and password and the world
2. Change the anti_ban frequency and afk_freq if you want to.
3. 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.
4. The number_of_mats constant determines how many materials are you using for your particular operation. Eg. If you are fletching logs to bow. Thats 1. If you are cleaning herbs, thats 1 as well. If you are stringing bows, thats 2. If you are mixing herbs into vial of water, thats 2. So far for those 2 mats craft, it only works on those ratio 1:1 crafts which means it will be 14 of each material in your inventory. I personally do not craft or create or mix anything with a different ratio. If you do, let me know.
5. Loads_to_do is simply what it says.
6. 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.
7. The next 2 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. The top left slot is slot 1.
8. If you want the script to alert you when it is done, create a new folder called 'sounds' in the includes folder and download the rar file and unzip the wave file in it.
Ok have fun.
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 := 124;
end;
currentPlayer := 0;
end;
const
{ Change these constants if you want }
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 }
NO_OF_MATS = 2; //No. of types of mats for crafting. Either 1 or 2
LOADS_TO_DO = 72; //Self explanatory
USE_PRESETS = TRUE; //If TRUE it will use preset 1, if FALSE it wont use presets
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. ignore if No_of_mats = 1
//MAT_NAME = ['grimy irit'];
////////////////////////////////////////////////////////////////////////////////
(*
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.2';
{ Bank color constants }
bank_col = 6839387;
bank_tol = 13;
bank_hue = 0.55;
bank_sat = 0.33;
var
loadsDone, XP, startingXP, loadsPH, XPH, antibanCount, actAfkCount: integer;
procedure progressReport;
begin
XP := (chatBox.getXPBar - startingXP);
XPH := round(XP * (3600.0 / (getTimeRunning / 1000.0)));
loadsPH := round((loadsDone * (3600.0 / (getTimeRunning / 1000.0))));
writeln('|===========================================================|');
writeln('| Brose AIO Crafter v' + padR(toStr(SCRIPT_VERSION), 21), '|');
writeln('|===========================================================|');
writeln(padR('| Running For: ' + timeRunning, 60) + '|');
writeln(padR('| Loads done: ' + groupDigits(loadsDone, ','), 40) + padR('Loads/H: ' + groupDigits(loadsPH, ','), 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 antiBan();
begin
if Random(100) < AntiBan_Freq then
begin
paintStatus('Activating Antiban');
writeLn('Activating Antiban');
case Random(10) 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();
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 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 (NO_OF_MATS) of
1: 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, 50);
end;
wait(randomrange(1000,1700));
end;
2: begin
bankScreen.withdraw(MAT1_ISINSLOT, 14);
wait(randomrange(1000,1700));
bankScreen.withdraw(MAT2_ISINSLOT, 14);
wait(randomrange(1000,1700));
end;
end;
end;
end;
bankScreen.close();
end;
procedure clickBank();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
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 startCraft();
begin
mouseSpeed := randomRange(10, 30);
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();
end;
end;
procedure mainLoop();
begin
clickBank();
case (NO_OF_MATS) of
1: craftOneMats();
2: craftTwoMats();
end;
startCraft();
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;
repeat
begin
smartImage.clearArea(mainScreen.getBounds());
mainLoop();
inc(loadsDone);
progressReport();
actAFK();
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.