Simba Code:
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.