Code:
program new;
{$DEFINE SMART}
{$DEFINE WALKER}
{$i AeroLib/AeroLib.Simba}
Const
SEARCH_AREA : TBox = [245, 130, 285, 195];
EXP_AREA : TBox = [395, 6, 512, 34];
//-----------USER SETUP-----------\\
USERNAME := '';
PASSWORD := '';
MEMBER := False;
//------------END USER------------\\
//-------------WORLD SETUP--------\\
WORLDS := 5;
WORLD1 := 1;
WORLD2 := 16;
WORLD3 := 35;
WORLD4 := 84;
WORLD5 := 83;
//DTMS START
silverOreDTM := DTMFromString('mJgIAAHic3c65DoAgEARQL7wSY+8fa+2P4hEPBJwNU9hY2rjJy4LCsF0UynrvFbpBr/mthNOHmkH2LUxYX6DZhZyPeV+T5OTMcDyzoK+wwQ4HyH/DHEvukZlAChkoZhacryJ5q+F8/TDy1rdazvcX73UDO8xpzQ==');
silverBarDTM := DTMFromString('mwQAAAHic42RgYOAAYl4gZmNAAFYg5gJiASAWQZJjhLK5gZgPijmhYjW1HRjY0tIOTC9avB6M5YDqCGFGIjAcAADr7g9Q');
unstrungSymbolDTM := DTMFromString('maQEAAHiczc3LCoAgEIXhMuxCFAS9jove/3GKLljZL51F0K5VA5/DwRntkrsydYsxhLDiQE6elT0qcosCBl5zcXeiL9iwP5y6N/rHSny7RI0Gg3Oa+q7nTH/gVRdAdDz3');
holyMouldDTM := DTMFromString('mUAIAAHic3ZBJCoAwFEMdUJy9gPdf6d57WUeUmtAUXLl04YdHfofkl3aBq8Nae1lXIdYbNIVmYEVfQ1uwoG+gs/YMtIJO0FLKs0KZ5yMzB6nm0Wd0l5mr4NxdeL9/F30RiEGirEy5hDNLUQm+cRx6Ob+B/xT+mLe6AaqzbnA=');
jugDTM := DTMFromString('mvQEAAHiczY05DoBADAMBcQkQVDyVlldzX8tEeDtKCiKNYiWW3QbPbM65CyL0ws7YKST6rTDrXsGINibdc/l39AmWObA93mc55jnUZ74QrDdWhmUVUKqrhgb6rpPzOxr1/53XuQG+vFWH');
potDTM := DTMFromString('mUAIAAHic3Y7JDYAwEAMBgUCcDdAILVETXXKfwRbOJw+ePFhp4s3hjWvvqcsY40NDcKJfQYI+BTN66gTNoCO0gA6O8jzXu1kzNnCYpwLcRfqvx95C/yjoXeTd5b3kZ75AGTknBjYjc/Fv5igduraR8xsqrP6PeasbAqhxiw==');
type STATE = (MINEWALK, SMELTWALK, SMELTING, CRAFTING, SHOPWALK, SELLING, LOST);
Var
prevTask :STATE;
shutDown :Boolean = False;
stateFails :Integer;
//Declarations
//Areas
mining_Area :TPointArray;
smelting_Area :TPointArray;
selling_Area :TPointArray;
//Paths
pathToMine :TPointArray;
pathToSmelt :TPointArray;
pathToSell :TPointArray;
//Tiles
tile_Silver :TPoint;
tile_Smelt :TPoint;
tile_Shop :TPoint;
//Walker
RSW :TRSWalker;
//Misc
silver_onScreen :TPoint;
XP :Extended;
silverOre, silverBar :TItem;
symbol :TItem;
silverMined :Integer; //Should let us determine the amount of crafted shit too
moneyEarned :Integer;
previousLength :Integer = 999;
//Store Mouse coords from functions
MouseX, MouseY : Integer;
HolySymbolPoint : TPoint = [339,104];
StatusText : String;
startExp : Integer;
procedure setupScript();
begin
//Data
//Locations
mining_Area := [[4967, 3352], [4961, 3253], [4988, 3188], [5007, 3168], [5024, 3179],
[5032, 3214], [5042, 3227], [5037, 3251], [5035, 3266], [5039, 3286],
[5037, 3307], [5038, 3342], [5030, 3353]];
smelting_Area := [[4900, 3696], [4909, 3695], [4916, 3694], [4922, 3695], [4925, 3696],
[4924, 3707], [4927, 3715], [4919, 3715], [4910, 3714],
[4904, 3713], [4904, 3705]];
selling_Area := [[5056, 3703], [5083, 3703], [5083, 3738], [5056, 3737]];
//Paths
pathToMine := [[5061, 3718], [5051, 3715], [5048, 3706], [5045, 3696], [5044, 3687],
[5045, 3676], [5050, 3666], [5055, 3656], [5055, 3645], [5056, 3628],
[5055, 3618], [5042, 3605], [5036, 3595], [5032, 3586],
[5030, 3577], [5024, 3572], [5016, 3560], [5012, 3546], [5012, 3531],
[5016, 3514], [5015, 3498], [5012, 3487], [5010, 3468], [5002, 3459],
[5000, 3441], [5000, 3426], [5001, 3412], [5001, 3393],
[4991, 3378], [4992, 3358], [4998, 3344], [5003, 3324], [5007, 3305],
[5002, 3293], [4998, 3278], [4992, 3265], [4989, 3255], [4991, 3238]];
pathToSmelt := [[4995, 3245], [4993, 3256], [4993, 3266], [4993, 3281], [4994, 3294],
[4995, 3307], [4994, 3324], [4993, 3336], [4992, 3350], [4988, 3363],
[4986, 3372], [4985, 3385], [4983, 3394], [4982, 3408],
[4978, 3421], [4975, 3434], [4973, 3449], [4971, 3458], [4970, 3470],
[4967, 3486], [4966, 3498], [4961, 3507], [4947, 3521], [4938, 3531],
[4930, 3543], [4926, 3557], [4923, 3575], [4920, 3589],
[4920, 3606], [4924, 3616], [4924, 3626], [4924, 3640], [4928, 3649],
[4936, 3661], [4934, 3671], [4934, 3680], [4934, 3699], [4932, 3707],
[4923, 3707], [4914, 3706]];
pathToSell := [[4921, 3708], [4934, 3711], [4948, 3712], [4961, 3713], [4970, 3715],
[4986, 3720], [4995, 3724], [5004, 3726], [5022, 3724], [5027, 3724],
[5035, 3724], [5045, 3723], [5058, 3718], [5071, 3721]];
//Tiles
tile_Silver := [4991, 3238];
tile_Smelt := [4911, 3705];
tile_Shop := [5065, 3720];
//Walkers
RSW.init('WorldMap');
RSW.minRunEnergy := 50;
RSW.walkStyle := wsSPS;
RSW.skipClose := 15;
//Misc
silver_onScreen := [204, 408];
XP := 13.7;
silverOre.DTM := silverOreDTM;
silverBar.DTM := silverBarDTM;
symbol.DTM := unstrungSymbolDTM;
silverMined := 0;
end;
Procedure customMouse(point:TPoint); //Denied Hacker, thanks for this method, although you dont know where you got it from
begin
case random(0, 6) of
0..2: brakeMMouse(point,random(5), random(5), true);
3 : brakeMMouse(point, random(4), random(6), false);
4..5: missMouse(point, random(4), random(3));
6 : humanMMouse(point, random(6), random(4));
end;
end;
//adapted from Denied Hacker
Procedure antiBan(number:Integer);
begin
case random(0, number) of
0..10 : pickUpMouse();
11..19: boredHuman();
45..50: checkMovingObjs(False);
27..44: MMouseOffClient('random');
end
end;
//Denied Hacker, thanks for the method
Function FindDTMOnScreen(DTMs:TIntegerArray; TopLeftLocation, BotRightLocation : TPoint) : Boolean;
var
i : Integer;
begin
for i:= 0 to High(DTMs) do
begin
if (FindDTM(DTMs[i], MouseX, MouseY, TopLeftLocation.X, TopLeftLocation.Y, BotRightLocation.X, BotRightLocation.Y)) then
begin
Exit(True); //We found it, return true and leave
end;
end;
Exit(False);
end;
Function GetFirstOccuranceOfDTM(itemDTM : Integer) : Integer;
var
B : Byte;
begin
Result := -1;
For B := 0 to 27 do
if FindDTMOnScreen([itemDTM], Point(MIX1, MIY1), Point(MIX2, MIY2)) then
Exit(B);
end;
Function WaitForDTMChange(itemDTM : Integer; WaitPer : UInt16 = 250; WaitFor : UInt32 = 1800) : Boolean;
var
TickCount : UInt64;
OriginalValue : Int16;
begin
Result := False;
TickCount := GetTickCount64() + WaitFor;
OriginalValue := GetFirstOccuranceOfDTM(itemDTM);
Repeat
Wait(Abs(WaitPer + Random(-25, 50)));
if (GetFirstOccuranceOfDTM(itemDTM) <> OriginalValue) then
Exit(true);
Until(GetTickCount64() > TickCount);
Exit(False);
end;
//Adapted from Denied Hacker
function ClickDTMInInventory(DTM : TIntegerArray; mouseButton : Integer; TopLeftLoc, BotRightLoc : TPoint; upText : TStringArray) : Boolean;
var
FoundDTMs : TPointArray;
ClickedDTM, i : Integer;
begin
for i:=0 to High(DTM) do
begin
if (FindDTMs(DTM[i], FoundDTMs, TopLeftLoc.X, TopLeftLoc.Y, BotRightLoc.X, BotRightLoc.Y)) then
begin
//Found it, its good lets get a random one
ClickedDTM := Random(Length(FoundDTMs));
customMouse(Point(FoundDTMs[ClickedDTM].X, FoundDTMs[ClickedDTM].Y)); //Moves mouse with a bunch of methods
if (waitUpTextMulti(upText, (randomRange(100, 350)))) then
begin
//we click a random DTM here
fastClick(mouseButton);
wait(randomRange(50, 150));
Exit(True);
end;
end;
writeln('Couldnt find the DTM specified, we didnt click anything');
Exit(False); //Couldn't locate the DTM specified, we dun goofed
end;
end;
function ClickWithOptionInput(mousePOS : TPoint; textUp: TStringArray; num : Integer; craftAll : Boolean) : Boolean;
begin
//Mouse to position
customMouse(mousePOS);
//upText
if (waitUpTextMulti(textUp, 100 + randomRange(100, 350))) then
begin
//click
fastClick(MOUSE_RIGHT);
waitEx(randomRange(50, 200)); //we aren't exactly quick, we need to wait
if (craftAll) then //'Craft All Unstrung symbol'
begin
if waitOptionMulti(['Craft All', 'All Unst', 'All Unstrung symbol'], randomRange(100, 450)) then
begin
fastClick(MOUSE_LEFT);
end;
end;
if (waitOptionMulti(['X'], (randomRange(100, 350)))) then
begin
waitChatChange();
waitEx(randomRange(500, 750)); // as humans we won't notice the chat change instantly
typeSend(IntToStr(num + randomRange(50, 64656))); //When Smithing you dont enter 28
waitEx(randomRange(100, 250)); //or something like that, you spam the
Exit(True); //numberpad :)
end;
end;
end;
//TODO
Function CheckDoor(Col, Tol : Integer; Hue, Sat : Double; TopLeft, BotRight : TPoint; ClickToOpen : Boolean) : Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray; // CheckDoorShop(1592934, 12, 0.03, 0.25, Point(MSX1, MSY1), Point(MSX2, MSY2), True);
i : Integer;
P : TPoint;
begin
SetColorToleranceSpeed(2); //1592934, Tol 12, hue 0.03, Sat 0.25 -> Shop Door
SetColorspeed2Modifiers(Hue, Sat);
Result := False;
if FindColorsTolerance(TPA, Col, TopLeft.X, TopLeft.Y, BotRight.X, BotRight.Y, Tol) then
begin
ATPA := ClusterTPA(TPA, 10);
SortATPASize(ATPA, True);
for i:=0 to Min(10, High(ATPA)) do
begin
if (Length(ATPA[i]) > 50) then
begin
customMouse(Point(MiddleTPA(ATPA[i]).X, MiddleTPA(ATPA[i]).Y));
if (isUptextMulti(['Open Door', 'pen Do', 'Open'])) then
begin
if (ClickToOpen) then
begin
wait(randomRange(50, 120)); // we arent as quick as we think
fastClick(MOUSE_LEFT);
Exit(True);
end;
end else
begin
//We dont want to click it, its open
writeln('Door is Open');
Exit(True); //FALSE MEANS DOOR IS CLOSED
end;
end;
end; //FOR END
end;
end;
Function FindTPAObjectsWithOption(Col, Tol : Integer; Hue, Sat : Double; TopLeftLoc, BotRightLoc : TPoint; upText, textOption : TStringArray) : Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
i : Integer;
P : TPoint;
begin
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(Hue, Sat);
if FindColorsTolerance(TPA, Col, TopLeftLoc.X, TopLeftLoc.Y, BotRightLoc.X, BotRightLoc.Y, Tol) then
begin
ATPA := ClusterTPA(TPA, 40);
SortATPASize(ATPA, True);
for i:=0 to Min(10, High(ATPA)) do
begin
if (Length(ATPA[i]) < 40) then Continue;
customMouse(Point(MiddleTPA(ATPA[i]).X, MiddleTPA(ATPA[i]).Y));
//Check UpText To see if we get a match
if (waitUpTextMulti(upText, randomRange(150, 250))) then
begin // Matched uptext, click it
fastClick(MOUSE_RIGHT);
wait(randomRange(50, 120));
if (waitOptionMulti(textOption, randomRange(150, 270))) then //Matched option text click it
begin
Exit(true);
end;
end;
end;
end;
end;
Function FindTPAObjects(Col, Tol : Integer; TopLeftLoc, BotRightLoc : TPoint; upText : TStringArray;
MoveMouse, Click, Furnace : Boolean) : Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
i : Integer;
P : TPoint;
begin
SetColorToleranceSpeed(2);
if FindColorsTolerance(TPA, Col, TopLeftLoc.X, TopLeftLoc.Y,
BotRightLoc.X, BotRightLoc.Y, Tol) then
begin
ATPA := ClusterTPA(TPA, 50);
SortATPASize(ATPA, True);
for i:=0 to High(ATPA) do
begin
if (MoveMouse) then
begin
if (Furnace) then
begin //adapted from Denied Hackers methods
customMouse(Point(MiddleTPA(ATPA[i]).X - 30 - random(10), MiddleTPA(ATPA[i]).Y));
end else
customMouse(Point(MiddleTPA(ATPA[i]).X, MiddleTPA(ATPA[i]).Y));
//check UPTEXT here
if (waitUpTextMulti(upText, randomRange(100, 350))) then
begin
if (Click) then
begin
fastClick(MOUSE_LEFT);
wait(randomRange(50, 150));
//didnt click failsafe
if didYellowClick() then
begin
while (isLoggedIn() and isPlayerWalking) do
WaitEx(randomRange(250, 400));
FindTPAObjects(Col, Tol, TopLeftLoc, BotRightLoc, upText, MoveMouse, Click, Furnace);
end;
//We clearly hit the target, so we return true
Exit(True);
end else//if not click
begin
mouseX := MiddleTPA(ATPA[i]).X;
mouseY := MiddleTPA(ATPA[i]).Y;
Exit(True);
end;
end; //Uptext didnt match
end else
begin //Dont move mouse
mouseX := MiddleTPA(ATPA[i]).X;
mouseY := MiddleTPA(ATPA[i]).Y;
Exit(True);
end;
end;
end;
end;
function randomsCheck() : Boolean;
begin
if not isLoggedIn() then Exit(False);
if levelUpEx(false) then Exit(True);
if continueChat(False) then Exit(True);
if getHealthPercent() <= 20 then
begin
shutDown := True;
writeln('Near death, Shutting down.');
end;
result := waitEx(50);
end;
function nearLocation (Where:String; distance:Integer) : Boolean;
var
myPos, T : TPoint;
begin
if not isLoggedIn() then Exit(false);
myPos := RSW.GetMyPos();
case Where of
'Smelt': T := tile_Smelt;
'Shop' : T := tile_Shop;
'Silver' : T := tile_Silver; //The rocks where we mine
end;
Result := pointsInDist(myPos, T, distance);
end;
function walker(Where : String) : Boolean;
var
P, mm : TPoint;
begin
if not isLoggedIn() then Exit();
randomsCheck();
setCompass('N');
setAngle(ANGLE_HIGH);
case Where of
'Smelt':
begin
writeln('Walking to Smelter');
Result := RSW.walkPath(pathToSmelt);
if not Result then
begin
RSW.blindWalk(tile_Smelt);
writeln('walkPath didnt happen, we are blind walking to smelt');
Result := True;
end;
end;
'Mine':
begin
writeln('Walking to Mine');
Result := RSW.walkPath(pathToMine);
if not Result then
begin
RSW.blindWalk(tile_Silver);
writeln('walkPath didnt happen, we are blind walking to smelt');
Result := True;
end;
end;
'Shop':
begin
writeln('walking to Shop');
Result := RSW.walkPath(pathToSell);
if not Result then
begin
RSW.blindWalk(tile_Shop);
writeln('walkPath didnt happen, we are blind walking to sell');
Result := True;
end;
end;
end;//CASE END
while isPlayerWalking() do
waitEx(50);
end;
function smeltOre() : Boolean;
var
P : TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
i,l : Integer;
//Stat tracking vars
count, smelted : Integer;
silverBarArray : TIntegerArray;
original, second: Integer;
retry : Boolean;
begin
if not isLoggedIn() then Exit;
if not nearLocation('Smelt', 15) then walker('Smelt');
while isPlayerWalking() do
waitEx(50);
Result := False;
Repeat //FindColorsTolerance(TPA, 2829367, MSX1, MSY1, MSX2, MSY2, 15)
retry := false;
wait(randomRange(350, 500));
if FindTPAObjects(2829367, 15, Point(MSX1, MSY1), Point(MSX2, MSY2),
['Smelt Furn', 'elt Furn', 'lt Furnace', 'rnace'], True, True, True) then
begin
while isPlayerWalking() do
waitEx(50);
wait(randomRange(650, 950)); // Good to wait, because sometimes can get ahead of itsself
ClickWithOptionInput(silver_onScreen, (['ilver', '1 Silver', 'Smelt 1 Silver']), 28, false);
Repeat
original := getXPBarAmount();
randomsCheck();
MMouseOffClient('Random'); //again, moving offscreen makes most sense
waitEx(randomRange(3000, 5000));
second := getXPBarAmount();
if (original = second) then retry := True;
Until ((GetFirstOccuranceOfDTM(silverOreDTM) = -1) or retry);
end;
//Fail Safe Goes here
Until(not FindDTMOnScreen([silverOreDTM], Point(MIX1, MIY1), Point(MIX2, MIY2)));
Result := True;
silverBarArray := silverBar.getSlots();
silverMined := silverMined + Length(silverBarArray);
end;
function SmeltSymbol() : Boolean;
var
counter, original, secondary : Integer;
retry : Boolean;
begin
if not isLoggedIn() then Exit(false);
if not nearLocation('Smelt', 15) then walker('Smelt');
writeln('Smelting Symbols');
Repeat
retry := false;
ClickDTMInInventory([silverBarDTM], MOUSE_LEFT, Point(MIX1, MIY1), Point(MIX2, MIY2), (['Silver bar', 'ver bar', 'ilver bar']));
wait(randomRange(500, 850));
FindTPAObjects(2829367, 15, Point(MSX1, MSY1), Point(MSX2, MSY2),
['Smelt Furn', 'elt Furn', 'lt Furnace', 'rnace'], True, True, True);
wait(randomRange(450, 600));
ClickWithOptionInput(HolySymbolPoint, ['Craft 1 Un', '1 Unstrung sym', 'rung symbol'], 26, true);
Repeat
original := getXPBarAmount();
randomsCheck();
MMouseOffClient('Random');
wait(randomRange(2000, 3000));
secondary := getXPBarAmount();
if (original = secondary) then
begin
//writeln('Same Exp amount after 2 - 3 seconds, we are not smelting, trying again.');
retry := True;
end;
Until((GetFirstOccuranceOfDTM(silverBarDTM) = -1) or retry);
Until(not FindDTMOnScreen([silverBarDTM], Point(MIX1, MIY1), Point(MIX2, MIY2)));
Result := True;
end;
Function checkWeAreMining() : Boolean;
var
Fails : Integer;
prevXP : Integer;
nowXP : Integer;
tim : Timer; //Tim the Timer :)
begin
Tim.start();
prevXP := getXPBarAmount();
MMouseOffClient('random'); //This is thebest antiban, you are doing 'somethingelse' while playing
repeat
nowXP := getXPBarAmount();
wait(randomRange(200, 300));
if (tim.timeElapsed > 5000) then
begin
writeln('Something happend, we havent mined for 5 seconds, calling false and trying again');
Exit(False);
end;
until(prevXP <> nowXP);
Exit(False);
end;
Function FindSilverRocks() : Boolean;
var
OreNotFound, NothingFound : Integer;
worldCounter : Integer;
Switched : Boolean;
begin
OreNotFound := 0;
NothingFound := 0;
worldCounter := WORLDS;
if not isLoggedIn() then Exit;
if not (nearLocation('Silver', 20)) then walker('Mine');
Repeat
writeln('Looking For silver Rock');
wait(randomRange(250, 350));
OreNotFound := OreNotFound + 1;
wait(randomRange(1000, 1350));
//Change World if there isn't any rocks
if (OreNotFound > 3) then
begin
writeln('Switching to a random world');
OreNotFound := 0;
wait(randomRange(350, 1250));
Case worldCounter of
1:
begin
writeln('Hopping to ' + IntToStr(WORLD1));
WS_switchWorlds(WORLD1);
worldCounter := worldCounter - 1;
end;
2:
begin
writeln('Hopping to ' + IntToStr(WORLD2));
WS_switchWorlds(WORLD2);
worldCounter := worldCounter - 1;
end;
3:
begin
writeln('Hopping to ' + IntToStr(WORLD3));
WS_switchWorlds(WORLD3);
worldCounter := worldCounter - 1;
end;
4:
begin
writeln('Hopping to ' + IntToStr(WORLD4));
WS_switchWorlds(WORLD4);
worldCounter := worldCounter - 1;
end;
5:
begin
writeln('Hopping to ' + IntToStr(WORLD5));
WS_switchWorlds(WORLD5);
worldCounter := worldCounter - 1;
end;
0:
begin
writeln('Base case, switching to WORLD3');
worldCounter := WORLDS;
WS_switchWorlds(WORLD3);
end;
end;
FTab(TAB_INV);
end;
//Fail Safe
if (NothingFound > 300) then
begin
writeln('We didnt find rocks for a really long time');
shutDown := True;
logoutPlayer();
end else
NothingFound := NothingFound + 1;
//FindColorsTolerance 9014166, 17 TOL, 0.15 HUE, 0.16 SAT
Until(FindTPAObjects(9013653, 18, Point(MSX1, MSY1), Point(MSX2, MSY2), ['ine', 'ock'], True, True, False));
Result := True;
end;
Function OpenTradeWindow() : Boolean;
var
failCount : Integer;
begin
failCount := 0;
if not isLoggedIn() then Exit;
if isPlayerWalking() then waitEx(50);
Repeat
writeln('Trying to open trade window');
wait(randomRange(100, 150));
randomsCheck();
if (failCount < 20) then
begin
inc(failCount);
end else
begin
writeln('Cant seem to open a trade window, Terminating');
shutDown := True;
logoutPlayer();
Exit(false); //Should add HUE and SAT into finder function, TODO
end; //Col 2967135, Tol 17, HUE 0.07, Sat 1
Until(FindTPAObjectsWithOption(2967135, 17, 0.07, 1, Point(MSX1, MSY1), Point(MSX2, MSY2), ['Shop', 'ssis'], ['rade']));
While (not FindDTMOnScreen([jugDTM, potDTM], Point(MSX1, MSY1), Point(MSX2, MSY2))) do
begin
wait(RandomRange(100, 500));
if (failCount < 20) then
begin
inc(failCount);
end else
begin
writeln('Fail Count has exceeded 20, terminating script because we couldnt open trade window');
shutDown := True;
logoutPlayer();
Exit(False);
end;
end;
Exit(true); //Found the trade window
end;
Function sellSymbols() : Boolean;
var
failCount : Integer;
begin
if not isLoggedIn() then Exit;
if isPlayerWalking() then waitEx(50);
failCount := 0;
Result := False;
if not nearLocation('Shop', 20) then walker('Shop');
writeln('Off to sell symbols');
Repeat
ClickDTMInInventory([unstrungSymbolDTM], MOUSE_RIGHT, Point(MIX1, MIY1), Point(MIX2, MIY2),
['Unstrung', 'symbol', 'rung symbol']);
if (waitOptionMulti(['50'], randomRange(150, 300))) then
begin
waitEx(randomRange(400, 750));
end else
begin //Fail Safe Starts here
if (failCount < 20) then
begin
failCount := failCount + 1;
end else
begin
writeln('We have had more than 20 fails, terminating');
shutDown := True;
logoutPlayer();
Exit(False);
end;
end;
Until(not FindDTMOnScreen([unstrungSymbolDTM], Point(MIX1, MIY1), Point(MIX2, MIY2)));
//We need to close the trade screen here
//customMouse(Point(485, 41));
wait(randomRange(50, 200));
mouse(Point(485, 41), 3, 3, MOUSE_LEFT);
Exit(True);
end
procedure Release();
begin
RSW.Free();
FreeDTM(silverOreDTM);
FreeDTM(silverBarDTM);
FreeDTM(unstrungSymbolDTM);
FreeDTM(jugDTM);
FreeDTM(potDTM);
FreeDTM(holyMouldDTM);
end
begin
initAL();
setupScript();
Repeat
Repeat
if (not FindSilverRocks()) then
Exit;
checkWeAreMining();
wait(randomRange(150, 200));
randomsCheck();
Until(isInvFull());
if not (walker('Smelt')) then exit;
if not (smeltOre()) then Exit;
if not (SmeltSymbol()) then Exit;
if not (walker('Shop')) then Exit;
if not (OpenTradeWindow()) then Exit;
if not (sellSymbols()) then Exit;
if not (walker('Mine')) then Exit;
Until(shutDown);
//CheckDoorShop(Col, Tol : Integer; Hue, Sat : Double; TopLeft, BotRight : TPoint; ClickToOpen : Boolean) : Boolean;
//CheckDoor(1592934, 12, 0.03, 0.25, Point(MSX1, MSY1), Point(MSX2, MSY2), True);
Release();
end.