From: Clarity
Hai im new cn you plaz maek Aio ruenskape?
it b rly gud cuz it do da lvls and da geepee and da bass fites an da kuests.
Awlso for da challgenge u cant use any inclods.
Cant use ashay man skriptwriter skript either.
Tanks mayor
Good luck with the knife fighter script, it's a great method and will be a nice addition to the thieving section!
AIO runescape? haha. Happy Little Runescape/Happe Little Lumbridge/Ratz came close
Done some more in lunch break today:
program MayorMonkeyPilferer;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$I SPS/LIB/SPS-RS3.simba}
const
REVISION = '1';
{
Fancy Title
Completed: xxth June 2014
}
{- 1. Player Info -}
NICKNAME = ''; { Nickname of player entered into the Rafiki player manager }
PLAYER_FILE = ''; { The name of your player file that you made in Rafiki }
{- 2. Theiving Settings -}
ALCH_SCIMMYS = True; { True if alching rune & dragon scimmys }
DROP_LOBSTERS = True; { Drop some lobsters if backpackfull }
{- 3. Break Settings -}
ENABLE_BREAKS = True; { Enable breaks? }
MIN_PLAY_TIME = 45; { Minimum play time before taking a break }
MAX_PLAY_TIME = 180; { Max play time before taking a break }
MIN_BREAK_TIME = 5; { Minimum break duration }
MAX_BREAK_TIME = 45; { Max break duration }
{- 4. Paint & Debug Settings -}
PAINT_ON_SMART = True; { Paint status in chatbox? }
STATUS_COLOUR = 255; { What colour do you want the paint to be (choose with color picker) }
ENABLE_DEBUG = False; { Show text debug output in the debug box? }
(* -------------------------------------------------------------------------- *)
{* EASY UPDATE - Update colours yourself! *}
(* -------------------------------------------------------------------------- *)
{ If future RS updates change the colours, then you can easily update them
yourself by changing the values below. Look at the AIO tutorial in my
signature if you don't know how to pick colours using ACA.
}
{ Monkey Knife Fighters }
MKF_COLOUR = 2242428;
MKF_TOL = 8;
MKF_HUE = 0.09;
MKF_SAT = 0.33;
(* -------------------------------------------------------------------------- *)
{* DON'T TOUCH ANYTHING BELOW *}
{* (unless you know what you're doing) *}
(* -------------------------------------------------------------------------- *)
{ Global Variables }
var
PathToMonkeys: TPointArray;
BreakTime, Breaked: integer;
TotalBreakTime: TTimeMarker;
AlchsCast, Pickpockets, Stuns: integer;
GreeGreeDTM: integer;
ScimmyDTMs: array [0..3] of integer;
DoAlching: boolean;
procedure autoUpdateMe();
begin
//code
end;
procedure freeTheDTMs();
begin
//freeDTMs(); scimmys, nats, staff
end;
procedure findRandoms();
begin
exitTreasure();
claimTicket();
end;
procedure paintStatus(status: string);
begin
if PAINT_ON_SMART then
begin
smartImage.clear();
smartImage.drawText('Status: ' + status, point(chatbox.X2-320,chatbox.Y2-19), SmallChars, false, STATUS_COLOUR);
end;
end;
procedure resetBreakTimer();
begin
BreakTime := getSystemTime() + gaussRangeInt(MIN_PLAY_TIME * 60000, MAX_PLAY_TIME * 60000);
end;
function timeUntilBreak(): string;
var
breakFromNow, H, M, S: integer;
begin
if ENABLE_BREAKS then
begin
breakFromNow := BreakTime - getSystemTime();
convertTime(breakFromNow, H, M, S);
result := (toStr(H)+ 'h ' + toStr(M)+ 'm ' + toStr(S)+ 's');
end else
result := ('Breaking disabled');
end;
procedure takeBreak();
var
H, M, S, HH, MM, SS, breakFor, timeLeft: integer;
breakStartTimer: TTimeMarker;
begin
if not ENABLE_BREAKS then
exit;
if (getSystemTime() >= BreakTime) then
begin
TotalBreakTime.start();
paintStatus('Taking a break');
if random(2) = 0 then
players[currentPlayer].logout()
else
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
breakFor := gaussRangeInt(MIN_BREAK_TIME * 60000, MAX_BREAK_TIME * 60000);
convertTime(breakFor, H, M, S);
writeLn('You are breaking for: ' + toStr(H)+ 'h ' + toStr(M)+ 'm ' + toStr(S)+ 's');
breakStartTimer.start();
repeat
timeLeft := breakFor - breakStartTimer.getTime();
convertTime(timeLeft, HH, MM, SS);
writeLn('Ending break in: ' + toStr(HH)+ 'h ' + toStr(MM)+ 'm ' + toStr(SS)+ 's');
wait(25000 + random(4000));
until breakFor < breakStartTimer.getTime();
inc(Breaked);
resetBreakTimer();
TotalBreakTime.pause();
players[currentPlayer].login();
wait(gaussRangeInt(1500, 3500));
findRandoms();
minimap.clickCompass();
end;
end;
procedure checkForImages(path, link, item: string);
var
progFile: longInt;
picName: string;
begin
picName := AppPath + path;
try
if not fileExists(picName) then
begin
writeLn('NOTIFICATION: ' + item + ' does not exist - Downloading it now!');
progFile := createFile(picName);
end else
begin
writeLn('NOTIFICATION: ' + item + ' already exists!');
exit;
end;
closeFile(progFile);
progFile := rewriteFile(picName, false);
writeFileString(progFile, getPage(link));
writeLn('NOTIFICATION: ' + item + ' has been download to Simba folder!');
writeLn('');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
procedure progressReport();
var
i, theivingXP, xpPerHour, profit, profitPerHour, PAD: integer;
totalBreaks: extended;
begin
//theivingXP := ashaman chatbox xp - StartXP
xpPerHour := round(theivingXP * (3600.0 / (GetTimeRunning / 1000.0)));
//profit := rune alch + dragon alch
profitPerHour := round(profit * (3600.0 / (GetTimeRunning / 1000.0)));
totalBreaks := (TotalBreakTime.getTime()/3600000);
PAD := 39;
clearDebug();
writeLn('||-------------------------------------||');
writeLn(padR('|| Mayor Monkey Pilferer (Rev. ' + REVISION + ')', PAD) + '||') ;
writeLn(padR('||', PAD) + '||');
writeLn(padR('|| Time running: ' + msToTime(getTimeRunning(), TIME_SHORT), PAD) + '||') ;
writeLn(padR('|| Pickpockets | Stuns: ' + toStr(PickPockets) + ' | ' + toStr(Stuns), PAD) + '||');
writeLn(padR('|| Theiving XP: ' + toStr(theivingXP) + ' (' + toStr(xpPerHour) + ' PH)', PAD) + '||');
writeLn(padR('|| Alchs cast: ' + toStr(AlchsCast), PAD) + '||') ;
writeLn(padR('|| Profit made: ' + toStr(profit) + ' (' + toStr(profitPerHour) + ' PH)', PAD) + '||');
writeln(padR('|| Time until break: ' + timeUntilBreak(), PAD) + '||');
writeln(padR('|| Breaks taken: ' + toStr(Breaked)+ ' (' + toStr(trunc(totalBreaks)) + ' h & ' + toStr(trunc(totalBreaks * 60) mod(60)) + ' m)', PAD) + '||');
writeLn('||-------------------------------------||');
end;
procedure endScript(reason: string);
begin
wait(randomRange(4000, 3000));
players[currentPlayer].exitToLobby();
progressReport();
writeLn('Terminated because: ' + reason);
writeLn('');
terminateScript();
end;
function mayorObjectFinder(colour, tolerance: integer; hue, sat: extended; width, height, clickType: integer; mouseOverText, chooseOptions: array of string; excludeSmall: boolean): boolean;
// mayorObjectFinder(colour, tol, hue, sat, width, height, clickType, mouseOverText, chooseOptions, excludeSmall)
var
i, x, y: integer;
p: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));
mainScreen.filterPointsPlayer(TPA);
if (Length(TPA) < 1) then exit;
ATPA := TPA.toATPA(width, height);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
if PAINT_ON_SMART then
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
if excludeSmall then
if length(ATPA[i]) < width then
continue;
if random(3) = 1 then
missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(mouseOverText, 500) then
begin
fastClick(ClickType);
if clickType = MOUSE_LEFT then
begin
if PAINT_ON_SMART then
smartImage.clearArea(mainscreen.getBounds());
exit(true);
end;
if chooseOption.select(chooseOptions) then
begin
if PAINT_ON_SMART then
smartImage.clearArea(mainscreen.getBounds());
exit(true);
end else
begin
gaussBox(p, mainscreen.getBounds());
mouse(p, MOUSE_MOVE);
end;
end;
end;
end;
procedure antiBan();
begin
//antiban stuff
end;
procedure walkToMonkeys();
var
walkTimer: TTimeMarker;
x, y: integer;
begin
walkTimer.start();
paintStatus('Walking to the monkey room');
repeat
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
SPS.walkPath(PathToMonkeys);
minimap.waitPlayerMoving();
//white floor tiles?
if countColorTolerance(123445, intToBox(1, 2, 3, 4), 123) then
exit;
until walkTimer.getTime() > 180000;
endScript('failed to walk to the monkeys within 3 minutes');
end;
procedure packManagement(); // just puts all scimmys at bottom of inv
var
x, y, i, ii, scimmySlot, freeSlot: integer;
begin
for i := 28 downto 1 do
if not tabBackPack.isItemInSlot(i) then
begin
freeSlot := i;
break;
end;
for i := 0 to high(ScimmyDTMs) do
for ii := 1 to 28 do
if findDTM(ScimmyDTMs[i], x, y, tabBackPack.getSlotBox(ii)) then
begin
scimmySlot := ii;
break;
end;
if scimmySlot < freeSlot then
tabBackPack.dragSlot(scimmySlot, freeSlot);
end;
function isGreeGreeEquipped(): boolean
begin
//finds and clicks GreeGree
//returns true if equipped
end;
function isStaffEquipped(): boolean
begin
//finds and clicks staff
//returns true if equipped
end;
function countNatures(): integer;
begin
//counts nature runes (for alching)
//if none sets DoAlching bool to false
end;
procedure highAlch();
begin
//unequip GreeGree
//equip fire staff
//alch rune scimmy
//alch dragon scimmy
// equip GreeGree
end;
procedure manageJunk();
begin
//drop mithril + addy scimmys
//drop lobsters if necessary
//call high alch when enough scimmys
end;
procedure eatFood();
begin
//eats lobsters if HP low
end;
procedure checkHP();
begin
//checks actionBar HP
//calls eatFood if necessary
end;
function isPlayerStunned(): boolean;
begin
//true if player is stunned (health bar appears)
end;
function isInJail(): boolean;
begin
//true is in jail (MM colour check?)
end;
procedure pickJailDoor();
begin
//lockpick the door
end;
function stunMonkey():boolean;
begin
//find and punch money
//returns true if chooseOption selected
end;
procedure pickPocketMonkey();
begin
//pickpocket money after it's stun
//repeat twice + random chance of 3rd time?
end;
procedure mainLoop();
var
stunTimer: TTimeMarker;
begin
if tabBackpack.count() >= randomRange(20, 28) then
manageJunk();
if stunMonkey() then
begin
stunTimer.start();
if isPlayerStunned() then
repeat
wait(randomRange(239, 659));
checkHP();
antiBan();
until (not isPlayerStunned()) or (stunTimer.getTime() > randomRange(2000, 3000));
pickPocketMonkey();
end;
checkHP();
packManagement();
if isInJail() then
begin
pickJailDoor();
walkToMonkeys();
end;
end;
procedure setup();
begin
smartEnableDrawing := true;
disableSRLDebug := not ENABLE_DEBUG;
setupSRL();
players.Setup([NICKNAME], PLAYER_FILE);
currentPlayer := 0;
{ SPS maps and paths setup }
//download map
//PathToMonkeys := [];
//sps.setup('MKF_ATOLL', RUNESCAPE_OTHER, 4, 600.0, 0.40);
//spsAnyAngle := true;
{ Load the DTMs }
//ScimmyDTMs := [];
//GreeGreeDTM := DTMFromString('');
{ Initialise breaking variables }
resetBreakTimer();
TotalBreakTime.start();
TotalBreakTime.pause();
end;
begin
clearDebug();
autoUpdateMe();
addonTerminate('freeTheDtms');
setup();
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;
mainLoop();
until false;
end.
EDIT: Might as well turn this in to a sort of progress thread for those of you who wanted the script. I'm nearly at the point where I'll actually need to login to the game to finish off some parts. If anyone wants to lend me an account it would be much appreciated.
program MayorMonkeyPilferer;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$I SPS/LIB/SPS-RS3.simba}
const
REVISION = '1';
{
Fancy Title
Completed: xxth June 2014
}
{- 1. Player Info -}
NICKNAME = ''; { Nickname of player entered into the Rafiki player manager }
PLAYER_FILE = ''; { The name of your player file that you made in Rafiki }
{- 2. Theiving Settings -}
ALCH_SCIMMYS = True; { True if alching rune & dragon scimmys }
ALCH_KEY_BIND = '4'; { High alch action bar key bind }
DROP_LOBSTERS = True; { Drop some lobsters if backpackfull }
EAT_AT_PERCENT = 70; { Eat when HP is below what percent
{- 3. Break Settings -}
ENABLE_BREAKS = True; { Enable breaks? }
MIN_PLAY_TIME = 45; { Minimum play time before taking a break }
MAX_PLAY_TIME = 180; { Max play time before taking a break }
MIN_BREAK_TIME = 5; { Minimum break duration }
MAX_BREAK_TIME = 45; { Max break duration }
{- 4. Paint & Debug Settings -}
PAINT_ON_SMART = True; { Paint status in chatbox? }
STATUS_COLOUR = 255; { What colour do you want the paint to be (choose with color picker) }
ENABLE_DEBUG = False; { Show text debug output in the debug box? }
(* -------------------------------------------------------------------------- *)
{* EASY UPDATE - Update colours yourself! *}
(* -------------------------------------------------------------------------- *)
{ If future RS updates change the colours, then you can easily update them
yourself by changing the values below. Look at the AIO tutorial in my
signature if you don't know how to pick colours using ACA.
}
{ Monkey Knife Fighters }
MKF_COLOUR = 2242428;
MKF_TOL = 8;
MKF_HUE = 0.09;
MKF_SAT = 0.33;
(* -------------------------------------------------------------------------- *)
{* DON'T TOUCH ANYTHING BELOW *}
{* (unless you know what you're doing) *}
(* -------------------------------------------------------------------------- *)
{ Global Variables }
var
PathToMonkeys: TPointArray;
BreakTime, Breaked: integer;
TotalBreakTime: TTimeMarker;
AlchsCast, Pickpockets, Stuns: integer;
GreeGreeDTM, FireStaffDTM, NatureDTM: integer;
LobsterDTM: integer;
ScimmyDTMs: array [0..3] of integer;
DoAlching: boolean;
procedure autoUpdateMe();
begin
//code
end;
procedure freeTheDTMs();
begin
//freeDTMs(); scimmys, nats, staff
end;
procedure findRandoms();
begin
exitTreasure();
claimTicket();
end;
procedure paintStatus(status: string);
begin
if PAINT_ON_SMART then
begin
smartImage.clear();
smartImage.drawText('Status: ' + status, point(chatbox.X2-320,chatbox.Y2-19), SmallChars, false, STATUS_COLOUR);
end;
end;
procedure resetBreakTimer();
begin
BreakTime := getSystemTime() + gaussRangeInt(MIN_PLAY_TIME * 60000, MAX_PLAY_TIME * 60000);
end;
function timeUntilBreak(): string;
var
breakFromNow, H, M, S: integer;
begin
if ENABLE_BREAKS then
begin
breakFromNow := BreakTime - getSystemTime();
convertTime(breakFromNow, H, M, S);
result := (toStr(H)+ 'h ' + toStr(M)+ 'm ' + toStr(S)+ 's');
end else
result := ('Breaking disabled');
end;
procedure takeBreak();
var
H, M, S, HH, MM, SS, breakFor, timeLeft: integer;
breakStartTimer: TTimeMarker;
begin
if not ENABLE_BREAKS then
exit;
if (getSystemTime() >= BreakTime) then
begin
TotalBreakTime.start();
paintStatus('Taking a break');
if random(2) = 0 then
players[currentPlayer].logout()
else
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
breakFor := gaussRangeInt(MIN_BREAK_TIME * 60000, MAX_BREAK_TIME * 60000);
convertTime(breakFor, H, M, S);
writeLn('You are breaking for: ' + toStr(H)+ 'h ' + toStr(M)+ 'm ' + toStr(S)+ 's');
breakStartTimer.start();
repeat
timeLeft := breakFor - breakStartTimer.getTime();
convertTime(timeLeft, HH, MM, SS);
writeLn('Ending break in: ' + toStr(HH)+ 'h ' + toStr(MM)+ 'm ' + toStr(SS)+ 's');
wait(25000 + random(4000));
until breakFor < breakStartTimer.getTime();
inc(Breaked);
resetBreakTimer();
TotalBreakTime.pause();
players[currentPlayer].login();
wait(gaussRangeInt(1500, 3500));
findRandoms();
minimap.clickCompass();
end;
end;
procedure checkForImages(path, link, item: string);
var
progFile: longInt;
picName: string;
begin
picName := AppPath + path;
try
if not fileExists(picName) then
begin
writeLn('NOTIFICATION: ' + item + ' does not exist - Downloading it now!');
progFile := createFile(picName);
end else
begin
writeLn('NOTIFICATION: ' + item + ' already exists!');
exit;
end;
closeFile(progFile);
progFile := rewriteFile(picName, false);
writeFileString(progFile, getPage(link));
writeLn('NOTIFICATION: ' + item + ' has been download to Simba folder!');
writeLn('');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
procedure progressReport();
var
i, theivingXP, xpPerHour, profit, profitPerHour, PAD: integer;
totalBreaks: extended;
begin
//theivingXP := ashaman chatbox xp - StartXP
xpPerHour := round(theivingXP * (3600.0 / (GetTimeRunning / 1000.0)));
//profit := rune alch + dragon alch
profitPerHour := round(profit * (3600.0 / (GetTimeRunning / 1000.0)));
totalBreaks := (TotalBreakTime.getTime()/3600000);
PAD := 39;
clearDebug();
writeLn('||-------------------------------------||');
writeLn(padR('|| Mayor Monkey Pilferer (Rev. ' + REVISION + ')', PAD) + '||') ;
writeLn(padR('||', PAD) + '||');
writeLn(padR('|| Time running: ' + msToTime(getTimeRunning(), TIME_SHORT), PAD) + '||') ;
writeLn(padR('|| Pickpockets | Stuns: ' + toStr(PickPockets) + ' | ' + toStr(Stuns), PAD) + '||');
writeLn(padR('|| Theiving XP: ' + toStr(theivingXP) + ' (' + toStr(xpPerHour) + ' PH)', PAD) + '||');
writeLn(padR('|| Alchs cast: ' + toStr(AlchsCast), PAD) + '||') ;
writeLn(padR('|| Profit made: ' + toStr(profit) + ' (' + toStr(profitPerHour) + ' PH)', PAD) + '||');
writeln(padR('|| Time until break: ' + timeUntilBreak(), PAD) + '||');
writeln(padR('|| Breaks taken: ' + toStr(Breaked)+ ' (' + toStr(trunc(totalBreaks)) + ' h & ' + toStr(trunc(totalBreaks * 60) mod(60)) + ' m)', PAD) + '||');
writeLn('||-------------------------------------||');
end;
procedure endScript(reason: string);
begin
wait(randomRange(4000, 3000));
players[currentPlayer].exitToLobby();
progressReport();
writeLn('Terminated because: ' + reason);
writeLn('');
terminateScript();
end;
function mayorObjectFinder(colour, tolerance: integer; hue, sat: extended; width, height, clickType: integer; mouseOverText, chooseOptions: array of string; excludeSmall: boolean): boolean;
// mayorObjectFinder(colour, tol, hue, sat, width, height, clickType, mouseOverText, chooseOptions, excludeSmall)
var
i, x, y: integer;
p: TPoint;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not isLoggedIn() then
exit;
findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat));
mainScreen.filterPointsPlayer(TPA);
if (Length(TPA) < 1) then exit;
ATPA := TPA.toATPA(width, height);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
if PAINT_ON_SMART then
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
if excludeSmall then
if length(ATPA[i]) < width then
continue;
if random(3) = 1 then
missMouse(middleTPA(ATPA[i]), true)
else
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(mouseOverText, 500) then
begin
fastClick(ClickType);
if clickType = MOUSE_LEFT then
begin
if PAINT_ON_SMART then
smartImage.clearArea(mainscreen.getBounds());
exit(true);
end;
if chooseOption.select(chooseOptions) then
begin
if PAINT_ON_SMART then
smartImage.clearArea(mainscreen.getBounds());
exit(true);
end else
begin
gaussBox(p, mainscreen.getBounds());
mouse(p, MOUSE_MOVE);
end;
end;
end;
end;
procedure antiBan();
begin
//antiban stuff
end;
procedure walkToMonkeys();
var
walkTimer: TTimeMarker;
x, y: integer;
begin
walkTimer.start();
paintStatus('Walking to the monkey room');
repeat
if not isLoggedIn() then
exit;
minimap.setAngle(MM_DIRECTION_NORTH);
SPS.walkPath(PathToMonkeys);
minimap.waitPlayerMoving();
//white floor tiles?
if countColorTolerance(123445, intToBox(1, 2, 3, 4), 123) then
exit;
until walkTimer.getTime() > 180000;
endScript('failed to walk to the monkeys within 3 minutes');
end;
procedure packManagement(); // just puts all scimmys at bottom of inv
var
x, y, i, ii, scimmySlot, freeSlot: integer;
begin
for i := 28 downto 1 do
if not tabBackPack.isItemInSlot(i) then
begin
freeSlot := i;
break;
end;
for i := 0 to high(ScimmyDTMs) do
begin
for ii := 1 to 28 do
if findDTM(ScimmyDTMs[i], x, y, tabBackPack.getSlotBox(ii)) then
begin
scimmySlot := ii;
break;
end;
if scimmySlot <> 0 then
break;
end;
if scimmySlot < freeSlot then
tabBackPack.dragSlot(scimmySlot, freeSlot);
end;
function isGreeGreeEquipped(): boolean
var
x, y, GGslot: integer;
begin
if findDTM(GreeGreeDTM, x, y, tabBackPack.getBounds()) then
begin
GGslot := tabBackpack.pointToSlot(point(x, y));
tabBackpack.mouseSlot(GGslot, MOUSE_LEFT);
wait(randomRange(1234, 3210));
end;
result := not findDTM(GreeGreeDTM, x, y, tabBackPack.getSlotBox(GGslot));
if not result then
begin
gameTabs.openTab(TAB_EQUIPMENT);
result := findDTM(GreeGreeDTM, x, y, tabBackPack.getBounds());
gameTabs.openTab(TAB_BACKPACK);
end;
if not result then
endScript('Couldn''t find Gorilla Greegree');
end;
function isStaffEquipped(): boolean;
var
x, y, staffSlot:integer;
begin
gameTabs.openTab(TAB_BACKPACK);
if findDTM(FireStaffDTM, x, y, tabBackPack.getBounds()) then
begin
staffSlot := tabBackpack.pointToSlot(point(x, y));
tabBackpack.mouseSlot(staffSlot, MOUSE_LEFT);
wait(randomRange(1234, 3210));
end;
result := not findDTM(FireStaffDTM, x, y, tabBackPack.getSlotBox(staffSlot));
if not result then
begin
gameTabs.openTab(TAB_EQUIPMENT);
result := findDTM(FireStaffDTM, x, y, tabBackPack.getBounds());
gameTabs.openTab(TAB_BACKPACK);
end;
if not result then
DoAlching := false;
end;
function countNatures(): integer;
var
x, y, natSlot: integer;
begin
if findDTM(NatureDTM, x, y, tabBackpack.getBounds()) then
begin
natSlot := tabBackpack.pointToSlot(point(x, y));
result := getItemAmount(tabBackpack.getSlotBox(natSlot))
end else
begin
writeLn('Couldn''t find nature runes in backpack - setting alching to false');
DoAlching := false;
end;
end;
procedure alchScimmys();
var
x, y, i, ii: integer;
begin
if countNatures() < 2 then
exit;
if not isStaffEquipped() then
exit;
for i := 2 to high(ScimmyDTMs) do // rune/dragon only
begin
for ii := 1 to 28 do
if findDTM(ScimmyDTMs[i], x, y, tabBackPack.getSlotBox(ii)) then
begin
tabBackpack.mouseSlot(ii, MOUSE_MOVE);
wait(gaussRangeInt(600, 750));
sendKeys(ALCH_KEY_BIND, 250, 55);
wait(gaussRangeInt(275,425));
if isMouseOverText(['ast', 'igh'], 500) then
begin
fastClick(MOUSE_LEFT);
wait(gaussRangeInt(678, 1165));
end;
end;
end;
if not isGreeGreeEquipped() then
endScript('Couldn''t re-equip the Gorilla GreeGree');
end;
procedure dropScimmys();
begin
//code
end;
procedure dropLobsters();
begin
//code
end;
procedure manageJunk();
var
x, y, i, totalScimmys, scimmyToDrop, scimmyToAlch: integer;
begin
for i := 0 to 1 do
scimmyToDrop := scimmyToDrop + tabBackpack.countDTM(ScimmyDTMs[i]); // mith + addy
for i := 2 to 3 do
scimmyToAlch := scimmyToAlch + tabBackpack.countDTM(ScimmyDTMs[i]);
if (tabBackpack.count() > 26) and ((scimmyToDrop + scimmyToAlch) <= 5) then
dropLobsters();
if scimmyToDrop > randomRange(1, 5) then
dropScimmys();
if scimmyToAlch > randomRange(4, 7) then
alchScimmys();
end;
function eatFood(): boolean;
var
x, y, lobSlot: integer;
begin
if findDTM(LobsterDTM, x, y, tabBackpack.getBounds()) then
begin
lobSlot := tabBackpack.pointToSlot(point(x, y));
tabBackpack.mouseSlot(lobSlot, MOUSE_LEFT);
wait(randomRange(2351, 3213));
result := not tabBackPack.isItemInSlot(lobSlot);
end;
end;
procedure checkHP();
begin
if actionBar.getHPPercent() < EAT_AT_PERCENT then
repeat
if not eatFood() then
break;
until actionBar.getHPPercent() >= EAT_AT_PERCENT;
end;
function isPlayerStunned(): boolean;
var
p: TPoint := mainscreen.playerPoint;
greenTPA, redTPA: TPointArray;
begin
findColorsTolerance(greenTPA, 51306, intToBox(p.x - 10, p.y - 40, p.x + 20, p.y + 20), 66);
findColorsTolerance(redTPA, 331429 , intToBox(p.x - 20, p.y - 40, p.x + 20, p.y + 20), 58);
greenTPA.combine(redTPA);
result := (length(greenTPA) > 30);
end;
function isInJail(): boolean;
var
pos: TPoint;
jailBox: TBox;
begin
pos := SPS.getPlayerPos();
jailBox := intToBox(100, 100, 300, 300);
result := pointInBox(pos, jailBox);
end;
procedure pickJailDoor();
begin
//lockpick the door
end;
function stunMonkey():boolean;
begin
//find and punch money
//returns true if chooseOption selected
end;
procedure pickPocketMonkey();
begin
//pickpocket money after it's stun
//repeat twice + random chance of 3rd time?
end;
procedure mainLoop();
var
stunTimer: TTimeMarker;
begin
if tabBackpack.count() >= randomRange(20, 28) then
manageJunk();
if stunMonkey() then
begin
stunTimer.start();
if isPlayerStunned() then
repeat
wait(randomRange(239, 659));
checkHP();
antiBan();
until (not isPlayerStunned()) or (stunTimer.getTime() > randomRange(2000, 3000));
pickPocketMonkey();
end;
checkHP();
packManagement();
if isInJail() then
begin
pickJailDoor();
walkToMonkeys();
end;
end;
procedure setup();
begin
smartEnableDrawing := true;
disableSRLDebug := not ENABLE_DEBUG;
setupSRL();
players.Setup([NICKNAME], PLAYER_FILE);
currentPlayer := 0;
{ SPS maps and paths setup }
//download map
//PathToMonkeys := [];
//sps.setup('MKF_ATOLL', RUNESCAPE_OTHER, 4, 600.0, 0.40);
//spsAnyAngle := true;
{ Load the DTMs }
//ScimmyDTMs := [];
//GreeGreeDTM := DTMFromString('');
{ Initialise breaking variables }
resetBreakTimer();
TotalBreakTime.start();
TotalBreakTime.pause();
DoAlching := ALCH_SCIMMYS;
end;
begin
clearDebug();
autoUpdateMe();
addonTerminate('freeTheDtms');
setup();
repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;
mainLoop();
until false;
end.