Wardancer
2012-12-08 23:09:45
5 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Practically none. Only learned SRL recently.
Are you a member of any other communities?
I also have accounts in other communities. Only one I'm semi-active is sythe.org. My username is the same as here.
Tell us about yourself…
From: Wardancer
I'm really not sure how to bring this up so I'll just brainstorm.
I'm a french canadian living in Quebec. I have a degree in civil law. I plan to enter the bar to finally become a lawyer either next autumn. My other option is to move to Vancouver for a while to get a common law degree. Until then, I'm working full time.
Please show us one (or multiple) of your scripts.
I'll show you two of my scripts. First one is a tanner. I don't have much to say. Have energy potions in your first bank slot and your hides in the subsequent ones. I added annotations in the scripts itself. Start the script at AK bank. program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$Include ObjectDTM\ObjDTMInclude.simba}
//Note: Have energy potions in your first bank slot and your hides in the subsequent ones (starting at the second slot).
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Member := True;
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;
procedure Antiban;
begin
FindNormalRandoms;
case Random(80) of
0: RandomRClick;
2: PickUpMouse;
//3: RandomMovement;
//4: BoredHuman;
5: ExamineInv;
7: SetAngle(SRL_ANGLE_HIGH);
8: Wait(5000)
end;
end;
type //Credits to NKN for this record. I only added the "Two" thing for the multicolor function.
MSObject = record
Col, ColTwo, Tol, TolTwo : Integer;
Hue, HueTwo, Sat, SatTwo: Extended;
Uptext: String;
end;
var
AK_Bank, Tanner, EnergyPotion : MSObject;
SmartTimeUp, numberOfFails : Integer;
procedure LoadObjectz;
begin
with AK_Bank do
begin
Col := 12102838;
Tol := 14;
Hue := 0.10;
Sat := 0.34;
ColTwo := 2242328;
TolTwo := 5;
HueTwo := 0.18;
SatTwo := 0.50;
UpText := 'Bank'
end;
with Tanner do //Credit to Topic for finding these colors. All other colours I tried weren't as accurate.
begin
Col := 2107945;
Tol := 10;
Hue := 0.4;
Sat := 0.4;
ColTwo := 12103350;
TolTwo := 22;
HueTwo := 0.2;
SatTwo := 1.05;
UpText := 'llis'
end;
with EnergyPotion do
begin
Col := 5261184;
Tol := 5;
Hue := 0.06;
Sat := 0.09;
UpText := 'nerg'
end;
end;
procedure FilterTPADistTPA(var TPA1: TPointArray; const MinDist, //Credits to beginner5 for this function.
MaxDist: Extended; TPA2 : TPointArray);
var
c,i,j,h,hh : integer;
d : extended;
mind ,maxd :extended;
begin
h := high(TPA1);
hh := high(TPA2);
c := 0;
mind := sqr(MinDist);
maxd := sqr(MaxDist);
for i := 0 to h do
begin
for j := 0 to hh do
begin
d := sqr(TPA1[i].x - TPA2[j].x) + sqr(TPA1[i].y - TPA2[j].y);
if (d >= mind) and (d <= maxd) then
begin
TPA1[c] := TPA1[i];
inc(c);
break;
end;
end;
end;
setlength(TPA1,c);
end;
function FindObject(var x, y : Integer; Obj: MSObject; X1, Y1, X2, Y2:integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
begin
if not LoggedIn then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Obj.Hue, Obj.Sat);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Obj.Col, X1, Y1, X2, Y2, Obj.Tol);
SortTPAFrom(TPA, point(MSCX, MSCY));
ATPA := TPAtoATPAEx(TPA, 15, 15);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
MMouse(MP.x, MP.y, 4, 4);
if(WaitUpText(Obj.UpText, 400))then
begin
x := MP.x; y := MP.y;
Result := True
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2,0.2);
end;
function MultiFindObject(var x, y : Integer; Obj: MSObject; X1, Y1, X2, Y2:integer) : Boolean; //Same function as above, but use 2 colours and check the distance between them. It's an application of beginner5's function.
var
CTS, A : Integer;
TPA1, TPA2 : TPointArray;
ATPA: array of TPointArray;
MP : TPoint;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Obj.Hue, Obj.Sat);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA1, Obj.Col, X1, Y1, X2, Y2, Obj.Tol) then
begin
SetColorSpeed2Modifiers(Obj.HueTwo, Obj.SatTwo);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Obj.ColTwo, X1, Y1, X2, Y2, Obj.TolTwo) then
begin
SetArrayLength(TPA1, 100);
SetArrayLength(TPA2, 100);
RAaSTPAEx(TPA1, 2, 2);
RAaSTPAEx(TPA2, 2, 2);
FilterTPADistTPA(TPA1, 0, 15, TPA2);
SplitTPAWrap(TPA1, 15, ATPA);
for A := 0 to high(ATPA) do
begin
MP := MiddleTPA(ATPA[A]);
MMouse(MP.x, MP.y, 4, 4);
if(WaitUpText(Obj.UpText, 400))then
begin
x := MP.x; y := MP.y;
Result := True;
Break;
end;
end;
end;
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2,0.2);
end;
//Same as ObjDTM_InArea, except that it checks if the designated cx and cy coordinates are in the area, not the player.
//Will show a possible use of this function later on this function (even though I gave up using it for this particular script).
function CustomObjDTM_InArea(DTMToCheck: String; cx, cy : Integer; GroundLevel: Boolean): Boolean;
var
BasesToCheck: TIntegerArray;
BaseObjects: MMObjArray;
begin
BasesToCheck := ExtractBasesFromObjDTM(DTMToCheck);
BaseObjects := GatherMiniMapObjects(BasesToCheck);
Result := ObjDTM_InAreaEx(DTMToCheck, cx, cy, GroundLevel, BaseObjects);
end;
//I use RadialWalkTolerance to find something on the map then I can click 50 pixels to the left if I want.
//The modX and modY modifies where you click, not the randomness.
function CustomRadialWalkTolerance(Color: Integer; sRadial, eRadial: Variant; r, modX, modY, Tol: Integer): Boolean;
var
TPA: TPointArray;
i, h: Integer;
begin
Result := False;
if RadialWalkEx(TPA, MMCX, MMCY, Color, Tol, sRadial, eRadial, r) then
begin
h := High(TPA);
for i := 0 to h do
if (TPA[i].x > 0) and (TPA[i].y > 0) then
begin
MMouse((TPA[i].x + modX), (TPA[i].y + modY), 1, 1); //Randomness set to 1, 1. It isn't a must as there is a lot of variance simply with walking.
Clickmouse2(true);
Result := True;
Exit;
end;
end;
end;
function ProductionTabOpen: boolean;
var
x, y : Integer;
begin
Result := FindColorTolerance(x, y, 2366993, 103, 196, 143, 209, 10);
end;
function InTannerArea: boolean; //InMultiArea seems quite buggy to me. Might have to do with the extractions of bases and injects being all together instead of for each ObjDTM? Or maybe I'm just crazy too.
begin
Result := ObjDTM_InArea('80:80:3:0:7:115:132:7:7:116:93:7:7:66:53:4:54:75:106:76:104:119:53:118', true) or ObjDTM_InArea('80:80:3:0:7:112:108:7:7:112:69:7:7:61:30:4:53:52:52:95:108:95:102:53', true) or ObjDTM_InArea('80:80:3:0:7:101:110:7:7:102:69:7:7:48:27:4:41:53:89:53:95:94:41:96', true) or ObjDTM_InArea('86:125:3:0:7:111:111:7:7:111:72:7:7:61:35:4:56:58:99:56:100:102:51:101', true) or ObjDTM_InArea('80:80:3:0:7:97:119:7:7:98:77:7:7:43:34:4:46:68:87:68:85:94:41:97', true);
end;
function InBankArea: boolean;
begin
Result := ObjDTM_InArea('80:80:4:0:7:135:71:7:7:120:84:7:7:46:73:2:7:118:128:4:57:47:105:47:105:98:58:98', true) or ObjDTM_InArea('104:23:4:0:7:134:73:7:7:118:85:7:7:48:72:7:7:65:115:4:52:62:101:61:103:109:50:106', true) or ObjDTM_InArea('106:31:4:0:7:135:74:7:7:54:73:7:7:53:101:7:7:120:85:4:70:72:102:61:102:94:71:94', true) or ObjDTM_InArea('106:26:5:0:7:133:73:2:7:115:126:7:7:118:85:7:7:49:73:7:7:66:115:4:62:63:63:102:108:104:112:63', true);
end;
function MiddleToBank: boolean;
begin
if ObjDTM_Walk('60:126:4:0:7:115:133:0:7:111:59:7:7:98:146:9:7:27:48', 2000, 1, 1, true) or ObjDTM_Walk('62:113:4:0:7:111:54:0:7:114:119:7:7:100:131:7:7:35:119', 2000, 1, 1, true) or ObjDTM_Walk('54:124:4:0:7:108:130:0:7:105:61:7:7:106:20:7:7:93:142', 2000, 1, 1, true) or ObjDTM_Walk('56:119:5:0:7:113:126:0:7:109:57:7:7:97:138:7:7:28:126:7:7:110:16', 2000, 1, 1, true) or ObjDTM_Walk('60:122:4:0:7:117:128:0:7:115:56:7:7:101:141:7:7:29:126', 2000, 1, 1, true) or ObjDTM_Walk('60:126:4:0:7:117:132:0:7:114:60:7:7:101:144:7:7:29:131', 2000, 1, 1, true) or ObjDTM_Walk('62:121:5:0:7:117:127:0:7:113:56:7:7:101:139:7:7:31:126:9:7:99:91', 2000, 1, 1, true) then
begin
WaitFunc(@InBankArea, 10, 6000);
Result := True;
end else
Result := False;
end;
function LowPlaceToBank: boolean; //Some unnecessary failsafe...I love those.
begin
if ObjDTM_Walk('86:30:5:7:7:122:102:7:7:53:27:7:7:123:40:7:7:70:70:2:7:120:82', 2000, 10, 10, true) then
begin
WaitFunc(@InBankArea, 10, 6000);
Result := True;
end else
Result := False;
end;
procedure DrinkEnergy; //Procedure to drink from energy potions while running.
var
x, y : Integer;
s : String;
begin
if GetMMLevels('run', s) < 70 then
if (FindObject(x, y, EnergyPotion, MIX1, MIY1, MIX2, MIY2)) then
begin
InvMouse(1, 1);
Wait(200 + Random(100));
end;
end;
function WalkToBank : boolean;
var
t : Integer;
begin
if not InTannerArea then
begin
Result := False;
Exit;
end;
if InBankArea then
begin
Result := True;
Exit;
end;
if CustomRadialWalkTolerance(3829066, 60, 130, 69, -35, 65, 10) then
begin
Result := True;
MarkTime(t);
//while not CustomRadialWalkTolerance(3764814, 140, 170, 69, -40, 15, 10) do
while not MiddleToBank do //Obj_DTM works flawlessly for this part while I had trouble with radial walk.
begin
DrinkEnergy;
Wait(200);
RunEnergy(30);
if TimeFromMark(t) > 15000 then
begin
//writeln('Can not find the bank');
MarkTime(t);
if MiddleToBank then //Always hesitated for this. Never know if I can just write them next to each other with "or". Let me know please.
Exit;
if WalkToBank then
Exit;
if LowPlaceToBank then
Exit;
Break;
end;
end;
WaitFunc(@InBankArea, 10, 10000);
end;
end;
procedure WalkToTanner;
var
t : Integer;
DidSecondWalk : Boolean;
begin
if CustomRadialWalkTolerance(2377588, 20, 90, 69, 0, -10, 10) then
begin
Marktime(t);
Wait(500 + Random(200));
while not CustomRadialWalkTolerance(3829066, 0, 25, 69, -30, 13, 10) do
begin
DrinkEnergy;
RunEnergy(30);
Wait(100);
if not DidSecondWalk then
if CustomRadialWalkTolerance(797785, 30, 60, 69, -8, 0, 10) then
DidSecondWalk := True;
if TimeFromMark(t) > 15000 then
begin
//writeln('Can not find the tanner');
MarkTime(t);
if MiddleToBank then
Exit;
if WalkToBank then
Exit;
if LowPlaceToBank then
Exit;
Break;
end;
end;
if not IsMoving then
if ObjDTM_Walk('84:20:4:0:7:114:132:0:7:110:60:7:7:111:17:2:7:23:75', 2000, 1, 1, true) or ObjDTM_Walk('73:29:5:0:7:109:136:0:7:106:64:7:7:107:22:7:7:93:148:9:7:91:100', 2000, 1, 1, true) or ObjDTM_Walk('80:30:4:0:7:109:64:0:7:114:134:7:7:109:22:9:7:96:99', 2000, 1, 1, true) or ObjDTM_Walk('82:26:4:7:7:112:21:7:7:98:149:9:7:15:65:9:7:96:100', 2000, 1, 1, true) or ObjDTM_Walk('82:33:4:0:7:111:130:0:7:107:65:7:7:108:27:7:7:96:142', 2000, 1, 1, true) or ObjDTM_Walk('88:26:4:0:7:123:134:0:7:117:63:7:7:117:22:7:7:37:136', 2000, 1, 1, true) or ObjDTM_Walk('81:23:4:0:7:109:59:0:7:115:131:7:7:99:144:7:7:109:16', 2000, 1, 1, true) then
Wait(50); //Have to do an "if..then" else it gives me an internal error message. If someone can tell me another way to do it, I'd be overjoyed.
WaitFunc(@InTannerArea, 100, 10000);
end;
end;
//TPA := GetMMDotsOnMS('npc'); //This is an example of a use of my custom InArea function.
//for a := 0 to high(TPA) do //I won't go into details, but it finds npc, dots, checks if it's //
// begin //in the area. Transfer the coordinates from MM to MS. Forms a box
// if TimeFromMark(t) > 15000 then //around it if it's on screen and search for a particular thing in this
// begin //box. It helped me filtering the camel out when searching before, but
// WalkToBank; //it was no more useful when I starting using Topic's colours. Feel free to
// MiddleToBank; //use.
// end;
// MP := TPA[a];
// if CustomObjDTM_InMultiArea(TSA_InTannerArea, MP.x, MP.y, true) then
// begin
// MP := MMtoMSEx(0, -30, MP);
// if (MP.x > 30) and (MP.y > 30) then
// begin
// Box := IntToBox((MP.x - 50), (MP.y - 50), (MP.x + 50), (MP.y +50));
function OpenTanner: Boolean;
var
t, w, x, y, RandomTime : Integer;
//TPA : TPointArray;
//MP : TPoint;
//Box : TBox;
begin
MarkTime(t);
MarkTime(w);
RandomTime := 5000 + Random(1000);
repeat
if not InTannerArea then
begin
//writeln('Not in the tanner area');
if MiddleToBank or WalkToBank or LowPlaceToBank then
Exit;
end;
if (MultiFindObject(x, y, Tanner, MSX1, MSY1, MSX2, MSY2)) then
begin
Clickmouse2(false);
if WaitOption('hides', 500) then
WaitFunc(@ProductionTabOpen, 10, 5000);
if ProductionTabOpen then
begin
Result := True;
Exit;
end;
end;
if RandomTime < TimeFromMark(w) then //After a bit of time, if it can't find the tanner, it checks if you're standing over it.
begin
MarkTime(w);
RandomTime := 5000 + Random(1000);
MMouse(255, 168, 4, 4);
Clickmouse2(false);
if WaitOption('hides', 500) then
WaitFunc(@ProductionTabOpen, 10, 5000);
if ProductionTabOpen then
begin
Result := True;
Exit;
end;
end;
until TimeFromMark(t) > 20000
if MiddleToBank then
Exit;
if WalkToBank then
Exit;
LowPlaceToBank;
end;
procedure Withdrawal;
var
s : String;
begin
FixBank;
if GetMMLevels('run', s) < 60 then //Only withdraws one energy potion if your energy is below 60.
begin
Withdraw(0, 0, 1);
Withdraw(1, 0, 0);
end else
begin
Withdraw(1, 0, 0);
end;
if not WaitInvMinCount(28, 5000) then
Withdrawal;
end;
procedure BankEr;
var
t, x, y : Integer;
begin
if BankScreen then
CloseBank;
if not InBankArea then
begin
//writeln('Not at the bank. Moving there.')
if MiddleToBank or WalkToBank or LowPlaceToBank then
BankEr;
end;
MarkTime(t);
repeat
if (MultiFindObject(x, y, AK_Bank, MSX1, MSY1, MSX2, MSY2)) then
begin
Clickmouse2(false);
if not WaitOption('Bank B', 500) then
BankEr;
WaitFunc(@BankScreen, 10, 5000);
end;
until BankScreen;
DepositAll;
Withdrawal;
end;
procedure Production;
var
x, y : Integer;
begin
if not LoggedIn then LoginPlayer;
if not LoggedIn then Exit;
FindNormalRandoms;
SetAngle(SRL_ANGLE_HIGH);
BankEr;
WalkToTanner;
if OpenTanner then
begin
//writeln('Opened the tanner successfully');
if (WaitFindColor(x, y, 10515465, 274, 318, 330, 321, 10, 5000)) then
begin
Mouse(x, y, 40, 5, 1);
numberOfFails := 0;
WalkToBank;
Exit;
end else
begin
//writeln('Ran out of hides to tan. Terminating script.');
Inc(numberOfFails);
if numberOfFails = 3 then //You have to get to the tanner and not be able to tan anything three times before it terminates the script. Why 3 instead of 1? It's just a failsafe from lag that could cause a messy withdrawal.
begin
WalkToBank;
TerminateScript;
end;
end;
end;
end;
procedure StartingLoop;
begin
{$IFDEF SMART}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
ClearDebug;
SetupSRL;
ObjDTM_Setup;
DeclarePlayers;
LoginPlayer;
MarkTime(SmartTimeUp);
ClickNorth(SRL_ANGLE_HIGH);
LoadObjectz;
FindNormalRandoms;
Antiban;
end;
procedure Mainloop;
begin
if not LoggedIn then LoginPlayer;
if TimeFromMark(SmartTimeUp) > 19800000 then
begin
SmartKillClient(SmartCurrentClient);
FreeSRL;
StartingLoop;
end;
Production;
FindNormalRandoms;
Antiban;
end;
begin
StartingLoop;
repeat
Mainloop;
until(allPlayersInactive);
end.The second script is a work in progress. It hasn't been fully tested yet so I expect some parts of the script to lack enough failsafe. It's a herblore script with grand exchange support and a semi-working task system incorporated (I have an issue with the task changing even if there are items left. Has to do with the bankscreen function turning true before items appear. I didn't bother tweaking the wait time yet. I'm lazy). Also, the task system only supports unfinished potions and herb cleaning at the moment. I consider myself to mostly be applying with the tanner script, but if you have any question about this one, feel free to ask.
program new;
{$DEFINE SMART}
{$i srl/srl.simba}
var
WhatToDo, WhatBank : String;
InitialGEPurchases : Boolean;
UseTasks : Boolean;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Member := True;
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
WhatToDo := 'Pot'; // Pot or Clean
WhatBank := 'GE_Bank'; // GE_Bank or Brown_Bank_Booth
InitialGEPurchases := True; // Want to make initial purchases from GE outside of the task sytem or not?
UseTasks := false; // Want to use the task system or not?
end;
type
GEInitialItems = record
slot : Integer;
What, Quantity, Price : String;
end;
type
TaskSystem = record
What : String;
NumberOfLoads : Integer;
BuyGE, SellGE : Boolean;
BuyWhat, SellWhat, BuyPrice, SellPrice, BuyQuantity, SellQuantity : Array[0..6] of String;
BuySlot, SellSlot, SellMinimumQuantity : Array[0..6] of Integer;
end;
var
Spot : array[1..6] of GEInitialItems;
Task : array[0..5] of TaskSystem;
GESpot, FirstIngredient, SecondIngredient, FinalProduct, CurrentSpot, CurrentTask, CurrentTaskItem, NumberOfLoadz, SmartTimeUp, TimeSinceLastRecover, TimeSinceLastVialRecover : Integer;
FirstIngredientTP, SecondIngredientTP, FinalProductTP : TPoint;
GEWhat, GEQuantity, GEPrice, FirstThing, SecondThing, FinalThing, ItemFailSafeOne, ItemFailSafe : String;
NewTask, NewSellTask : Boolean;
procedure LoadGEStuff;
begin
CurrentSpot := 1;
Spot[1].slot := 1;
Spot[1].What := 'clean irit';
Spot[1].Quantity := '10000';
Spot[1].Price := '1300';
Spot[2].slot := 4;
Spot[2].What := 'clean harralander';
Spot[2].Quantity := '50000';
Spot[2].Price := '300';
Spot[6].slot := 6;
end;
procedure LoadTaskStuff;
begin
Task[0].What := 'iritpotionunf';
Task[0].NumberOfLoads := 9999;
Task[0].BuyGE := False;
Task[0].BuyWhat[0] := 'clean ranarr';
Task[0].BuyPrice[0] := '1115';
Task[0].BuyQuantity[0] := '10000';
Task[0].BuySlot[0] := 1;
Task[0].SellGE := False;
Task[0].SellWhat[0] := 'irit potion (unf)'; //This is actually a trap. A built in limitation only allows to sell the final product. I might simplify the withdrawing method and simply use the searchbank function in the future.
Task[0].SellPrice[0] := '1365';
Task[0].SellMinimumQuantity[0] := 5000;
Task[0].SellQuantity[0] := 'all';
Task[0].SellSlot[0] := 2;
Task[1].What := 'iritpotionunf';
Task[1].NumberOfLoads := 9999;
Task[1].BuyGE := False;
Task[1].BuyWhat[0] := 'clean ranarr';
Task[1].BuyPrice[0] := '1115';
Task[1].BuyQuantity[0] := '10000';
Task[1].BuySlot[0] := 1;
Task[1].SellGE := False;
Task[1].SellWhat[0] := 'irit potion (unf)'; //This is actually a trap. A built in limitation only allows to sell the final product. I might simplify the withdrawing method and simply use the searchbank function in the future.
Task[1].SellPrice[0] := '1365';
Task[1].SellMinimumQuantity[0] := 5000;
Task[1].SellQuantity[0] := 'all';
Task[1].SellSlot[0] := 2;
Task[2].What := 'harralanderpotionunf';
Task[2].NumberOfLoads := 9999;
Task[2].BuyGE := False;
Task[2].SellGE := False;
Task[3].What := 'harralanderpotionunf';
Task[3].NumberOfLoads := 9999;
Task[3].BuyGE := False;
Task[3].SellGE := False;
Task[4].What := 'tarrominpotionunf';
Task[4].NumberOfLoads := 9999;
Task[4].BuyGE := False;
Task[4].SellGE := False;
Task[5].What := 'tarrominpotionunf';
Task[5].NumberOfLoads := 9999;
Task[5].BuyGE := False;
Task[5].SellGE := False;
end;
procedure Antiban;
begin
FindNormalRandoms;
case Random(80) of
0: RandomRClick;
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
5: ExamineInv;
7: SetAngle(SRL_ANGLE_HIGH);
8: Wait(5000)
end;
end;
type
MSObject = record
Col, Tol, TPADist, MinCount: Integer;
Hue, Sat: Extended;
Uptext: String;
end;
var
GE_Bank, Brown_Bank_Booth, GE, BuyButton, SellButton, CancelButton, ExitGEMenuButton : MSObject;
procedure LoadObjects;
begin
with GE_Bank do
begin
Col := 8619402;
Tol := 4;
Hue := 0.48;
Sat := 0.24;
UpText := 'Bank'
end;
with Brown_Bank_Booth do
begin
Col := 3367282;
Tol := 4;
Hue := 0.10;
Sat := 0.28;
UpText := 'Bank'
end;
with GE do
begin
Col := 2891040;
Tol := 20;
Hue := 0.18;
Sat := 0.30;
UpText := 'Exch'
end;
with BuyButton do
begin
Col := 247218;
Tol := 4;
Hue := 0.25;
Sat := 1.29;
UpText := 'Buy O'
end;
with SellButton do
begin
Col := 224454;
Tol := 50;
Hue := 0.34;
Sat := 0.03;
UpText := 'Sell O'
end;
with CancelButton do
begin
Col := 791918;
Tol := 20;
Hue := 0.04;
Sat := 0.47;
UpText := 'bort'
end;
with ExitGEMenuButton do
begin
Col := 11975110;
Tol := 10;
Hue := 0.80;
Sat := 0.31;
UpText := 'ack'
end;
end;
function FindObject(var x, y : Integer; Obj: MSObject; X1, Y1, X2, Y2:integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
if not LoggedIn then Exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Obj.Hue, Obj.Sat);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Obj.Col, X1, Y1, X2, Y2, Obj.Tol);
SortTPAFrom(TPA, point(MSCX, MSCY));
ATPA := TPAtoATPAEx(TPA, 15, 15);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
Box := IntToBox((MP.x - 20), (MP.y - 20), (MP.x + 20), (MP.y + 20));
MMouse(MP.x, MP.y, 4, 10);
if(WaitUpText(Obj.UpText, 400))then
begin
x := MP.x; y := MP.y;
Result := True
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2,0.2);
end;
procedure LoadDTMs;
begin
case Task[CurrentTask].What of
//Unfinished potions
'avantoepotionunf':
begin
FirstThing := 'avantoepotionunf';
SecondThing := 'avantoepotionunf';
FinalThing := 'avantoepotionunf';
end;
'cadantinepotionunf':
begin
FirstThing := 'cadantinepotionunf';
SecondThing := 'cadantinepotionunf';
FinalThing := 'cadantinepotionunf';
end;
'dwarfweedpotionunf':
begin
FirstThing := 'dwarfweedpotionunf';
SecondThing := 'dwarfweedpotionunf';
FinalThing := 'dwarfweedpotionunf';
end;
'fellstalkpotionunf':
begin
FirstThing := 'fellstalkpotionunf';
SecondThing := 'fellstalkpotionunf';
FinalThing := 'fellstalkpotionunf';
end;
'guampotionunf':
begin
FirstThing := 'guampotionunf';
SecondThing := 'guampotionunf';
FinalThing := 'guampotionunf';
end;
'harralanderpotionunf':
begin
FirstThing := 'harralanderpotionunf';
SecondThing := 'harralanderpotionunf';
FinalThing := 'harralanderpotionunf';
end;
'iritpotionunf':
begin
FirstThing := 'iritpotionunf';
SecondThing := 'iritpotionunf';
FinalThing := 'iritpotionunf';
end;
'kwuarmpotionunf':
begin
FirstThing := 'kwuarmpotionunf';
SecondThing := 'kwuarmpotionunf';
FinalThing := 'kwuarmpotionunf';
end;
'lantadymepotionunf':
begin
FirstThing := 'lantadymepotionunf';
SecondThing := 'lantadymepotionunf';
FinalThing := 'lantadymepotionunf';
end;
'ranarrpotionunf':
begin
FirstThing := 'ranarrpotionunf';
SecondThing := 'ranarrpotionunf';
FinalThing := 'ranarrpotionunf';
end;
'snapdragonpotionunf':
begin
FirstThing := 'snapdragonpotionunf';
SecondThing := 'snapdragonpotionunf';
FinalThing := 'snapdragonpotionunf';
end;
'spiritweedpotionunf':
begin
FirstThing := 'spiritweedpotionunf';
SecondThing := 'spiritweedpotionunf';
FinalThing := 'spiritweedpotionunf';
end;
'tarrominpotionunf':
begin
FirstThing := 'tarrominpotionunf';
SecondThing := 'tarrominpotionunf';
FinalThing := 'tarrominpotionunf';
end;
'toadflaxpotionunf':
begin
FirstThing := 'toadflaxpotionunf';
SecondThing := 'toadflaxpotionunf';
FinalThing := 'toadflaxpotionunf';
end;
'torstolpotionunf':
begin
FirstThing := 'torstolpotionunf';
SecondThing := 'torstolpotionunf';
FinalThing := 'torstolpotionunf';
end;
'wergalipotionunf':
begin
FirstThing := 'wergalipotionunf';
SecondThing := 'wergalipotionunf';
FinalThing := 'wergalipotionunf';
end;
end;
case FirstThing of
'avantoepotionunf', 'cadantinepotionunf', 'dwarfweedpotionunf', 'fellstalkpotionunf', 'guampotionunf', 'harralanderpotionunf', 'iritpotionunf', 'kwuarmpotionunf', 'lantadymepotionunf', 'ranarrpotionunf', 'snapdragonpotionunf', 'spiritweedpotionunf', 'tarrominpotionunf', 'toadflaxpotionunf', 'torstolpotionunf', 'wergalipotionunf':
begin
FirstIngredient := DTMFromString('mwQAAAHic42RgYDAGYlsgNgFiXSA2AGJLIDYCYn0gtgLi+UC8FIhXA/FKIF4FxPOAeCYQL4CK1bXuYbB3imUor9sExBvB2M0zg6Gx4yBDbctuhsi4VgYuoDpCmJEIDAcAoDwVTQ==');
ItemFailSafeOne := 'vialofwater';
end;
end;
case SecondThing of
'avantoepotionunf':
begin
SecondIngredient := DTMFromString('mwQAAAHic42RgYBAAYgkgFgdiQSDmZIAADiDmA2IpIOYGYn4gFgJiYag6kBgzVC0bEIu6KTII2ykxSPirMUiFaDCIOKowCFrKMwjZyDLwG0oD+fIMXEB1hDAjERgOAFi1BYg=');
ItemFailSafe := 'cleanavantoe';
end;
'cadantinepotionunf':
begin
SecondIngredient := DTMFromString('mFQEAAHic42VgYLBnZGCwBWInIHYHYi8g9oDy7YDYGoiNgFgfiM2B2AyIjwP17QHiQ0j4FBCfA+ILUPoEA0TdQSA+A8SxOpoMEcaGDJm21gweWhoM2fY2DMn6Ogy5DrZgdqGTPYOHkgJDqrUlQ7KVOUOmkR4DF1AfqZiRDIwCAOwXGDQ=');
ItemFailSafe := 'cleancadantine';
end;
'dwarfweedpotionunf':
begin
SecondIngredient := DTMFromString('m6wAAAHic42ZgYMhlYmDIAeICIC4B4gogLgfiIiDOAuIUII4D4jQgFmVkYOAEYn4gFgRiPiAWB2JpKAaxRYCYF4jZjTkY2PTYwTSrBhsDmzY7A4cNFwOnHReY5rDkBMuxG3IwcAHdQSxmJAEjAQANEwkK');
ItemFailSafe := 'cleandwarfweed';
end;
'fellstalkpotionunf':
begin
SecondIngredient := DTMFromString('m1gAAAHicjcjNCoAgEATg0aNPIULQTfozqVUwoi69//M0hNDVhY+ZWQPg1MBBT3XXLbTWTLQpYKCFhDIVSrTX/0ghB0wyw3YWcgliiR8f/AfQcL2DYWuhGv33AuLiCsw=');
ItemFailSafe := 'cleanfellstalk';
end;
'guampotionunf':
begin
SecondIngredient := DTMFromString('mwQAAAHic42RgYMhnYmDIBeIyIK4E4iIgzgTiJCCOA+I0IBZhZGDgAmJBIBYDYmkoBrFBcjxAzGnHxcBuxsnAbszBwGHDxcDpzA3GYDZIDijOBbSPEGYkAsMBADD8B7s=');
ItemFailSafe := 'cleanguam';
end;
'harralanderpotionunf':
begin
SecondIngredient := DTMFromString('m1gAAAHic42JgYBBiZGAQBmI+IGaD0iC+NBDLA7EMEIsB8Qmg2n1AfAiIjwPxOSA+D8SngfgYEB+Eylk6cjKY2nAwGHlxMSiosjI4eHAxuKXzMTgB+SA5bUN2Bjs3LgYuoFpiMCORGAEAlWYOLA==');
ItemFailSafe := 'cleanharralander';
end;
'iritpotionunf':
begin
SecondIngredient := DTMFromString('mrAAAAHic42BgYEgG4hwgzoSyo4A4DIjjgTgNiGcD8RwgXgDEi4F4IRDPBeJFQLwEiG1jNIEkE4NHrgGDW6Yeg0mYGoNxsCqYNotQZ+ACyuLDjAQwDAAAI6sNtQ==');
ItemFailSafe := 'cleanirit';
end;
'kwuarmpotionunf':
begin
SecondIngredient := DTMFromString('m6wAAAHic42ZgYDAHYlMgtgJiRyi2AWIzIDYAYh0g1gBiIyD+DMQvgPgdEL+F8n8C8R8o/RUqBpKzdORk0DBkZzC04QDTdm5cDE5eXAzGdpwMlkC2mjYbg5ElB4M2UI4LqJ5YzEgCRgIAUEYSTQ==');
ItemFailSafe := 'cleankwuarm';
end;
'lantadymepotionunf':
begin
SecondIngredient := DTMFromString('m6wAAAHiclcqxCoJQAIXh4yZeu88iDUVB6SxIW7Q0hPSGLtFdrikFJb2SP3KHxjzwLYffSHpEkkePIfigww0NHO540Tu06ODxxhcDnujDnx5XMoelFuet7GUnU2Wy9V5JmcteC8WbTOlpPUno/xXN8LMRyAkX/g==');
ItemFailSafe := 'cleanlantadyme';
end;
'ranarrpotionunf':
begin
SecondIngredient := DTMFromString('mwQAAAHic42RgYOgF4plAPAWIJwJxJxC3AXETEPdA5eZC6YVAvARKL4SKL4HSJq5cDGYeXAymETxg2iQMQhs5czIYOHAy6NlxMIgA1RHCjERgOAAAc0AQGA==');
ItemFailSafe := 'cleanranarr';
end;
'snapdragonpotionunf':
begin
SecondIngredient := DTMFromString('m6wAAAHic42ZgYOAHYj4gFgNiSSgWh4pzATEbAwRwQPkwNitUjRAQiwCxIBRzQ+UMbTgYXHy5GaydOcE4JJ6XwdKNiyEgipfBHMgPT+Zj8AnjAWMuqNnEYEYSMBIAAD1UCGw=');
ItemFailSafe := 'cleansnapdragon';
end;
'spiritweedpotionunf':
begin
SecondIngredient := DTMFromString('mAAEAAHic42FgYJjGxMAwE4jnAfESIJ4LxBOBeAoQTwfiPiDugtKTgVickYGBF4iFgFgCiOWgWAGKpaHiIHkBIPYpjGcw9XdiMPCwYTALdGHwK01i8MiOYvDMjWYIb85lcEkNYbCP92ewi/VlsAhxY+ACuokUzEgiRgYAb/sUZg==');
ItemFailSafe := 'cleanspiritweed';
end;
'tarrominpotionunf':
begin
SecondIngredient := DTMFromString('mAAEAAHic42FgYOBngABmIGYDYm6omDAQSwKxFBBLQ2lBIOaAYpA6PqhaQSjmgcqxAjET1Fy+RF0Gbn9VBoFiMwbeKC0GnghNBp4wDTibP9OQgS9Zj4HTWZ6By0OJgQuohxTMSCJGBgC4rAiF');
ItemFailSafe := 'cleantarromin';
end;
'toadflaxpotionunf':
begin
SecondIngredient := DTMFromString('m6wAAAHic42ZgYNgDxDuBeB8QHwbiI0B8CIh3A/FWIN4IxOuAeDMQfwLil0D8Doo/A/EvIP4NxD+hGCT2Foi5FLkY2PTYGdjNOBlYVdnAfB4NXgZuVR4w5rDhYmBRZGVgN+Zg4AKpJxIzkoCRAADNhxWC');
ItemFailSafe := 'cleantoadflax';
end;
'torstolpotionunf':
begin
SecondIngredient := DTMFromString('m1gAAAHicjc3BCkBAGATgWcXanxYHJV7AyVEOONg4KRfv/yzGUq7++pqpOfwCwAXAQivtdLy50UwDTVQqwFBBGeVUUUO1enZL8SjQvYFxCaJOQ7bE91t6WoRt5Lvw9x/qp+8uCTYHJg==');
ItemFailSafe := 'cleantorstol';
end;
'wergalipotionunf':
begin
SecondIngredient := DTMFromString('mFQEAAHic42VgYLBnZGCwBWInIHYHYi8g9oDy7YDYGoiNgFgfiM2B2AyIjwP17QHiQ0j4FBCfA+ILUPoEA0TdQSA+A8SxOpoMEcaGDJm21gweWhoM2fY2DMn6Ogy5DrZgdqGTPYOHkgJDqrUlQ7KVOUOmkR4DF1AfqZiRDIwCAOwXGDQ=');
ItemFailSafe := 'cleanwergali';
end;
end;
case FinalThing of
'avantoepotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYHBkYmBwB2IvIHYFYnsgtgJiayB2AGIZRgYGCSCWB2IVKFYCYmkgFgfitsYGhuiwMAZfLy+GzORkhq6WFoae1law+KL5ixlEgHbgw4wEMAwAALtgDvQ=');
'cadantinepotionunf':
FinalProduct := DTMFromString('mwQAAAHic42RgYMhmYmAoZoLQKUCcCsQ5QFwAxIVAnA/EcowMDIpArAKlpYFYHIglgFgWKj67v40hNTacYcHkLoaFU7oZZvW1MsycMoWhIj+DoSQrBUyLAO0jhBmJwHAAAMC5E1M=');
'dwarfweedpotionunf':
FinalProduct := DTMFromString('mrAAAAHichc0xCkAAAIXhx+QAigwkbqJsdpPVMWyykFCIlMk1/Skrr77e+FuSVlM6MKHFgBk7NviGFCJGABcOPESomklJmqlfL9Xd9vy4nMqL8mHT+GL8eHcDnG0SNQ==');
'fellstalkpotionunf':
FinalProduct := DTMFromString('mwQAAAHic42RgYNjPBMGHgfgEEG8H4t1AvAtJXI6RgUEFikFsBSBWBmJJIBaH4rjcJIaE/CQG92AvBmNrU4aY7AQwH0S39XUzFFWUMYgA7SOEGYnAcAAAZUUTCg==');
'guampotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYHBkYmBwAWJPILYDYksgtmWCiLsBsRMjA4MHELsAsTsQOwOxDRTbAnHbrNkM5Z1dDBFp6Qztc+Yy1E+eAqabpk1nyKysYhAB2oEPMxLAMAAAzyEReg==');
'harralanderpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYHBiYmBwAWIrILYHYi8gdgNiO6iYLCMDgwoQK0JpeSCWAGJJRojc9OYmhq7ycoYF3V0Ms9vbGGIC/BmqsjIZ5nV1MExtamQQAdqBDzMSwDAAABSUD8Q=');
'iritpotionunf':
FinalProduct := DTMFromString('mwQAAAHic42RgYMhlYmAoAOISKJ0JxClAnAbE2VBajpGBQYkRQksAsRgQywKxMhCrALEkEPf0TGZoaupg8PcPZigsLGeYOnUOQ3//VIYpU2YzTJs2l2Hy5FkMIkD7CGFGIjAcAADp0BP2');
'kwuarmpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYJjGxMAwA4jnAvEsIJ4OxJOAuBeIJwOxLCMDgwoQywOxJBCLArE4lA8Sn9jdzdBSV8eQFBvLUFZQwBASEsGwYe1Ghp62NoYpvb0MIkA78GFGAhgGAJgzEkw=');
'lantadymepotionunf':
FinalProduct := DTMFromString('mwQAAAHic42RgYNjPxMBwCIiPAfFRIN4HxDuBeAcQ7wHiw0Asx8jAoALEikAsBcRiQCwNxEpArAzE4kC8cEo3w4TWGoaqgkyGoswkhrkzZjDMm9TBsGR6Lxj3d3cxiADtI4QZicBwAAARRRdA');
'ranarrpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYHBhYmBwBGJXIHaHsq2h2AuI7RkZGDygGMS2htJuQOwMxDUTahg65nUyZFRkMiTkJzDMXjqfoWVmC0PXgi4G32g/BhGgHfgwIwEMAwCWyhDF');
'snapdragonpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYHBiYmBwBWJ7ILaCYpCYBxB7ArEMIwODMhQrMkL4klAM4jckqTOURCgztKVrMnRkaDJURKsw1CWoAU1mYghxkGQQAbLwYUYCGAYAV5YKmQ==');
'spiritweedpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYMhlYmBIA+I8IC4B4gIgzoKKJQOxLCMDgzIQqwCxIhBLA7EEEEsBsRwQ9/RMZpgyZTZDS0sXg5ubJ0N5eR3DpEkzGaZNm8vQ1tbDIAK0Ax9mJIBhAAD63RFw');
'tarrominpotionunf':
FinalProduct := DTMFromString('mrAAAAHic42BgYJjKxMDQB8STgXg2EM8F4llAPAmI+4FYlhGClYFYEYhlgFgSiCWAWAmIZ81qZZg6tZFh3rwOhvq6PIa42ECGmposhrlz2sFiIkA78GFGAhgGANQfEuQ=');
'toadflaxpotionunf':
FinalProduct := DTMFromString('m6wAAAHic42ZgYNjPxMCwF4gPA/FxID4ExLuBeCcUg8S2QWk5RgYGFSBWBmJZIBaHYhmomBIQywOxFBDHRPuDcWCgG4O5uT5DVVUlQ1xsIBiDxNXUFIG2M4GxCJAkFjOSgJEAAEVAEyQ=');
'torstolpotionunf':
FinalProduct := DTMFromString('mwQAAAHic42RgYHBkYmDwAmIbKHYCYncoBrFdgdiREUgDsRsQ2wGxFRDbALETELtD8YrZExmCfd0Z1i2YxrBm/hSGKRMmMBRkJDI0lRcwrJwzmWF6TxODCNA+QpiRCAwHALDkE90=');
'wergalipotionunf':
FinalProduct := DTMFromString('m6wAAAHic42ZgYMhhYmDIAuIiIC4A4nwgzgbiVCBOAeJMIC4D4nQgtmdkYHABYjdGCNsKiC2hbFcg9oDKWwPx9OlNDAsXdjOkp0Uw1NflMZSWFTMkJaUxzJrVChafO6cdaDsTw7x5HQwiQBaxmJEEjAQAjXsYHA==');
end;
//Clean herbs
case Task[CurrentTask].What of
//Unfinished potions
'cleanavantoe':
begin
FirstThing := 'cleanavantoe';
FinalThing := 'cleanavantoe';
end;
'cleancadantine':
begin
FirstThing := 'cleancadantine';
FinalThing := 'cleancadantine';
end;
'cleandwarfweed':
begin
FirstThing := 'cleandwarfweed';
FinalThing := 'cleandwarfweed';
end;
'cleanfellstalk':
begin
FirstThing := 'cleanfellstalk';
FinalThing := 'cleanfellstalk';
end;
'cleanguam':
begin
FirstThing := 'cleanguam';
FinalThing := 'cleanguam';
end;
'cleanharralander':
begin
FirstThing := 'cleanharralander';
FinalThing := 'cleanharralander';
end;
'cleanirit':
begin
FirstThing := 'cleanirit';
FinalThing := 'cleanirit';
end;
'cleankwuarm':
begin
FirstThing := 'cleankwuarm';
FinalThing := 'cleankwuarm';
end;
'cleanlantadyme':
begin
FirstThing := 'cleanlantadyme';
FinalThing := 'cleanlantadyme';
end;
'cleanranarr':
begin
FirstThing := 'cleanranarr';
FinalThing := 'cleanranarr';
end;
'cleansnapdragon':
begin
FirstThing := 'cleansnapdragon';
FinalThing := 'cleansnapdragon';
end;
'cleanspiritweed':
begin
FirstThing := 'cleanspiritweed';
FinalThing := 'cleanspiritweed';
end;
'cleantarromin':
begin
FirstThing := 'cleantarromin';
FinalThing := 'cleantarromin';
end;
'cleantoadflax':
begin
FirstThing := 'cleantoadflax';
FinalThing := 'cleantoadflax';
end;
'cleantorstol':
begin
FirstThing := 'cleantorstol';
FinalThing := 'cleantorstol';
end;
'cleanwergali':
begin
FirstThing := 'cleanwergali';
FinalThing := 'cleanwergali';
end;
end;
case FirstThing of
'cleanavantoe':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyavantoe';
end;
'cleancadantine':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimycadantine';
end;
'cleandwarfweed':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimydwarfweed';
end;
'cleanfellstalk':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyfellstalk';
end;
'cleanguam':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyguam';
end;
'cleanharralander':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyharralander';
end;
'cleanirit':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyirit';
end;
'cleankwuarm':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimykwuarm';
end;
'cleanlantadyme':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimylantadyme';
end;
'cleanranarr':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyranarr';
end;
'cleansnapdragon':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimysnapdragon';
end;
'cleanspiritweed':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimyspiritweed';
end;
'cleantarromin':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimytarromin';
end;
'cleantoadflax':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimytoadflax';
end;
'cleantorstol':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimytorstol';
end;
'cleanwergali':
begin
FirstIngredient := 1;
ItemFailSafe := 'grimywergali';
end;
end;
case FinalThing of
'cleanavantoe':
FinalProduct := DTMFromString('mwQAAAHic42RgYBAAYgkgFgdiQSDmZIAADiDmA2IpIOYGYn4gFgJiYag6kBgzVC0bEIu6KTII2ykxSPirMUiFaDCIOKowCFrKMwjZyDLwG0oD+fIMXEB1hDAjERgOAFi1BYg=');
'cleancadantine':
FinalProduct := DTMFromString('mFQEAAHic42VgYLBnZGCwBWInIHYHYi8g9oDy7YDYGoiNgFgfiM2B2AyIjwP17QHiQ0j4FBCfA+ILUPoEA0TdQSA+A8SxOpoMEcaGDJm21gweWhoM2fY2DMn6Ogy5DrZgdqGTPYOHkgJDqrUlQ7KVOUOmkR4DF1AfqZiRDIwCAOwXGDQ=');
'cleandwarfweed':
FinalProduct := DTMFromString('m6wAAAHic42ZgYMhlYmDIAeICIC4B4gogLgfiIiDOAuIUII4D4jQgFmVkYOAEYn4gFgRiPiAWB2JpKAaxRYCYF4jZjTkY2PTYwTSrBhsDmzY7A4cNFwOnHReY5rDkBMuxG3IwcAHdQSxmJAEjAQANEwkK');
'cleanfellstalk':
FinalProduct := DTMFromString('m1gAAAHicjcjNCoAgEATg0aNPIULQTfozqVUwoi69//M0hNDVhY+ZWQPg1MBBT3XXLbTWTLQpYKCFhDIVSrTX/0ghB0wyw3YWcgliiR8f/AfQcL2DYWuhGv33AuLiCsw=');
'cleanguam':
FinalProduct := DTMFromString('mwQAAAHic42RgYMhnYmDIBeIyIK4E4iIgzgTiJCCOA+I0IBZhZGDgAmJBIBYDYmkoBrFBcjxAzGnHxcBuxsnAbszBwGHDxcDpzA3GYDZIDijOBbSPEGYkAsMBADD8B7s=');
'cleanharralander':
FinalProduct := DTMFromString('m1gAAAHic42JgYBBiZGAQBmI+IGaD0iC+NBDLA7EMEIsB8Qmg2n1AfAiIjwPxOSA+D8SngfgYEB+Eylk6cjKY2nAwGHlxMSiosjI4eHAxuKXzMTgB+SA5bUN2Bjs3LgYuoFpiMCORGAEAlWYOLA==');
'cleanirit':
FinalProduct := DTMFromString('mrAAAAHic42BgYEgG4hwgzoSyo4A4DIjjgTgNiGcD8RwgXgDEi4F4IRDPBeJFQLwEiG1jNIEkE4NHrgGDW6Yeg0mYGoNxsCqYNotQZ+ACyuLDjAQwDAAAI6sNtQ==');
'cleankwuarm':
FinalProduct := DTMFromString('m6wAAAHic42ZgYDAHYlMgtgJiRyi2AWIzIDYAYh0g1gBiIyD+DMQvgPgdEL+F8n8C8R8o/RUqBpKzdORk0DBkZzC04QDTdm5cDE5eXAzGdpwMlkC2mjYbg5ElB4M2UI4LqJ5YzEgCRgIAUEYSTQ==');
'cleanlantadyme':
FinalProduct := DTMFromString('m6wAAAHiclcqxCoJQAIXh4yZeu88iDUVB6SxIW7Q0hPSGLtFdrikFJb2SP3KHxjzwLYffSHpEkkePIfigww0NHO540Tu06ODxxhcDnujDnx5XMoelFuet7GUnU2Wy9V5JmcteC8WbTOlpPUno/xXN8LMRyAkX/g==');
'cleanranarr':
FinalProduct := DTMFromString('mwQAAAHic42RgYOgF4plAPAWIJwJxJxC3AXETEPdA5eZC6YVAvARKL4SKL4HSJq5cDGYeXAymETxg2iQMQhs5czIYOHAy6NlxMIgA1RHCjERgOAAAc0AQGA==');
'cleansnapdragon':
FinalProduct := DTMFromString('m6wAAAHic42ZgYOAHYj4gFgNiSSgWh4pzATEbAwRwQPkwNitUjRAQiwCxIBRzQ+UMbTgYXHy5GaydOcE4JJ6XwdKNiyEgipfBHMgPT+Zj8AnjAWMuqNnEYEYSMBIAAD1UCGw=');
'cleanspiritweed':
FinalProduct := DTMFromString('mAAEAAHic42FgYJjGxMAwE4jnAfESIJ4LxBOBeAoQTwfiPiDugtKTgVickYGBF4iFgFgCiOWgWAGKpaHiIHkBIPYpjGcw9XdiMPCwYTALdGHwK01i8MiOYvDMjWYIb85lcEkNYbCP92ewi/VlsAhxY+ACuokUzEgiRgYAb/sUZg==');
'cleantarromin':
FinalProduct := DTMFromString('mAAEAAHic42FgYOBngABmIGYDYm6omDAQSwKxFBBLQ2lBIOaAYpA6PqhaQSjmgcqxAjET1Fy+RF0Gbn9VBoFiMwbeKC0GnghNBp4wDTibP9OQgS9Zj4HTWZ6By0OJgQuohxTMSCJGBgC4rAiF');
'cleantoadflax':
FinalProduct := DTMFromString('m6wAAAHic42ZgYNgDxDuBeB8QHwbiI0B8CIh3A/FWIN4IxOuAeDMQfwLil0D8Doo/A/EvIP4NxD+hGCT2Foi5FLkY2PTYGdjNOBlYVdnAfB4NXgZuVR4w5rDhYmBRZGVgN+Zg4AKpJxIzkoCRAADNhxWC');
'cleantorstol':
FinalProduct := DTMFromString('m1gAAAHicjc3BCkBAGATgWcXanxYHJV7AyVEOONg4KRfv/yzGUq7++pqpOfwCwAXAQivtdLy50UwDTVQqwFBBGeVUUUO1enZL8SjQvYFxCaJOQ7bE91t6WoRt5Lvw9x/qp+8uCTYHJg==');
'cleanwergali':
FinalProduct := DTMFromString('mFQEAAHic42VgYLBnZGCwBWInIHYHYi8g9oDy7YDYGoiNgFgfiM2B2AyIjwP17QHiQ0j4FBCfA+ILUPoEA0TdQSA+A8SxOpoMEcaGDJm21gweWhoM2fY2DMn6Ogy5DrZgdqGTPYOHkgJDqrUlQ7KVOUOmkR4DF1AfqZiRDIwCAOwXGDQ=');
end;
end;
function CustomFindDTMs(WhichIngredient : Integer; WhichProduct : String): Boolean;
var
a : Integer;
FailSafe : String;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
case WhichIngredient of
FirstIngredient:
FailSafe := ItemFailSafeOne;
SecondIngredient:
FailSafe := ItemFailSafe;
FinalProduct:
FailSafe := (lowercase(ExtractFromStr(Task[CurrentTask].What, Letters)));
end;
if FindDTMs(WhichIngredient, TPA, MSX1, MSY1, MSX2, MSY2) then
SortTPAFrom(TPA, point(MSCX,MSCY));
ATPA := TPAtoATPAEx(TPA, 15, 15);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
MMouse(MP.x, MP.y, 4, 4);
case WhichIngredient of
FirstIngredient:
begin
FirstIngredientTP.x := MP.x;
FirstIngredientTP.y := MP.y;
end;
SecondIngredient:
begin
SecondIngredientTP.x := MP.x;
SecondIngredientTP.y := MP.y;
end;
FinalProduct:
begin
FinalProductTP.x := MP.x;
FinalProductTP.y := MP.y;
end;
end;
(ExtractFromStr((replace((lowercase(GetTextAtExWrap(46, 7, 200, 23, 0, 10, 1, 2658536, 50, UpChars))), '.!', 'i')), Letters));
Wait(500 + Random(250));
if (ExtractFromStr((replace((lowercase(GetTextAtExWrap(46, 7, 200, 23, 0, 10, 1, 2658536, 50, UpChars))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(FailSafe, Letters))) then
begin
wait(500 + Random(250));
writeln((ExtractFromStr((replace((lowercase(GetTextAtExWrap(46, 7, 200, 23, 0, 10, 1, 2658536, 50, UpChars))), '.!', 'i')), Letters)));
Result := true;
Break;
end;
end;
end;
function InGEE: Boolean;
begin
result := findTextTPA(39116, 20, 204, 27, 248, 49, 'Grand', upCharsEx, nothing);
end;
function InGEEEx: Boolean;
begin
result := findTextTPA(39372, 20, 213, 62, 260, 80, 'summary', StatChars, nothing);
end;
function GEESellMenu: Boolean;
begin
result := findTextTPA(39116, 20, 87, 68, 155, 86, 'Sell O', upCharsEx, nothing);
end;
function GEEBuyMenu: Boolean;
begin
result := findTextTPA(39116, 20, 87, 68, 155, 86, 'Buy O', upCharsEx, nothing);
end;
function GEEBuyOrSellMenu: Boolean;
begin
result := GEEBuyMenu or GEESellMenu;
end;
function GEEIsSpotFree: Boolean;
var
a : TBox;
begin
a := GridBox(GESpot, 3, 2, 50, 30, 157, 121, point(105,95))
result := findTextTPA(39372, 20, a.x1, a.y1, a.x2, a.y2, 'Empty', upCharsEx, nothing);
end;
function GEEReadyToCollect: Boolean;
var
x, y : Integer;
begin
result := FindColorTolerance(x, y, 1048714, 175, 310, 275, 310, 50) or FindColorTolerance(x, y, 1999423, 175, 310, 275, 310, 50)
end;
function GEECanTypeAmount: Boolean;
begin
result := findTextTPA(0, 150, 125, 387, 166, 412, 'nter', upCharsEx, nothing);
end;
function GEECanTypePrice: Boolean;
begin
result := findTextTPA(0, 150, 140, 392, 182, 411, 'nter', upCharsEx, nothing);
end;
function GEECanTypeItem: Boolean;
begin
result := findTextTPA(23200, 50, 196, 355, 228, 373, 'rand', upCharsEx, nothing);
end;
procedure GEEMenuExit;
var
x, y : Integer;
begin
if not InGEE then
Exit;
if not GEESellMenu and not GEEBuyMenu then
Exit;
if(FindObject(x, y, ExitGEMenuButton, MSX1, MSY1, MSX2, MSY2)) then
begin
ClickMouse2(true);
WaitUptext('ack', 5000);
WaitFunc(@InGEEEx, 10, 6000);
end else
Exit;
end;
procedure OpenGE;
var
x,y:integer;
begin
if BankScreen then
CloseBank;
if InGEEEx then
Exit;
if GEEBuyOrSellMenu then
GEEMenuExit;
if PinScreen then
begin
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
end;
if(FindObject(x, y, GE, MSX1, MSY1, MSX2, MSY2)) then
begin
Clickmouse2(false);
WaitOption('Exchange G', 500);
WaitFunc(@InGEE, 10, 6000);
end else
Exit;
end;
procedure GEERecoverAt(abort : Boolean);
var
i, x, y : Integer;
b, c : TBox;
begin
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
begin
if not GEEIsSpotFree then
begin
b := GridBox(GESpot, 3, 2, 100, 70, 155, 120, point(100,136));
MouseTBox(b, 1);
WaitFunc(@GEEBuyOrSellMenu, 10, 6000);
if abort then
begin
if (FindObject(x, y, CancelButton, MSX1, MSY1, MSX2, MSY2)) then
ClickMouse2(true);
WaitUptext('bort', 500);
WaitFunc(@GEEReadyToCollect, 10, 6000);
Wait(500 + Random(250));
end;
for i := 1 to 2 do
begin
c := GridBox(i, 2, 1, 15, 12, 60, 0, point(417, 295));
MouseTBox(c, 3);
Wait(500 + random(100));
if IsUptext('ollect') then
begin
ClickMouse2(true);
Wait(500 + random(100));
end;
end;
end;
end;
end;
procedure GEERecoverAll(abort : Boolean);
var
i : Integer;
begin
for i := 1 to 6 do
if abort then
begin
GEERecoverAt(true);
end else
GEERecoverAt(false);
end;
function GEEIsFinishedAt : Boolean;
var
x, y : Integer;
a : TBox;
begin
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
a := GridBox(GESpot, 3, 2, 128, 123, 154, 117, point(104,172));
if FindColorTolerance(x, y, 1999423, a.x1, a.y1, a.x2, a.y2, 10) then
result := true;
end;
procedure GEERecoverFinishedAt;
begin
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
if not GEEIsFinishedAt then
begin
writeln('This spot is not finished');
Exit;
end else
GEERecoverAt(false);
end;
function GEEBuyAt: Boolean;
var
x, y : Integer;
b : TBox;
begin
Result := False;
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
Exit;
repeat
b:= GridBox(GESpot, 3, 2, 155, 120, 155, 120, point(100,136));
if not FindObject(x, y, BuyButton, b.x1, b.y1, b.x2, b.y2) then
begin
writeln('This spot is not free')
Exit;
end;
WaitUptext('Buy O', 500);
ClickMouse2(true);
Wait(1250 + Random(250));
if not GEEBuyMenu then
GEEBuyAt;
WaitFunc(@GEEBuyMenu, 10, 6000);
until GEEBuyMenu;
end;
function GEESellAt: Boolean;
var
x, y : Integer;
b: TBox;
begin
Result := False;
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
repeat
b:= GridBox(GESpot, 3, 2, 155, 120, 155, 120, point(100,136));
if not FindObject(x, y, SellButton, b.x1, b.y1, b.x2, b.y2) then
begin
writeln('This spot is not free')
Exit;
end;
WaitUptext('Sell O', 500)
ClickMouse2(true);
Wait(1250 + Random(250));
if not GEESellMenu then
GEESellAt;
WaitFunc(@GEESellMenu, 10, 6000);
until GEESellMenu;
end;
procedure GEESetQuantity;
var
x, y, numberOfFailures : integer;
searchBox: TBox;
begin
for numberofFailures := 0 to 5 do
if not InGEE then
Exit;
if not GEESellMenu and not GEEBuyMenu then
Exit;
case lowercase(GEQuantity) of
'1':
searchBox := IntToBox(56, 211, 87, 231);
'10':
searchBox := IntToBox(97, 211, 129, 231);
'100':
searchBox := IntToBox(138, 211, 170, 231);
'all':
if not GEESellMenu then
begin
writeln('Invalid parameter');
Exit;
end else
searchBox := IntToBox(180, 211, 210, 231);
else
begin
if (FindColorTolerance(x, y, 39116, 222, 211, 252, 231, 100)) then
begin
MMouse(x, y, 4, 4);
ClickMouse2(true);
WaitFunc(@GEECanTypeAmount, 10, 16000);
TypeSendEx(GEQuantity, true);
Wait(1500 + Random(250));
end;
end;
end;
case lowercase(GEQuantity) of
'1', '10', '100', 'all':
if (FindColorTolerance(x, y, 39116, searchBox.x1, searchBox.y1, searchBox.x2, searchBox.y2, 100)) then
begin
MMouse(x, y, 4, 4);
ClickMouse2(true);
Wait(1000 + Random(500));
end;
end;
if (ExtractFromStr(GetTextAtExWrap(86, 184, 227, 198, 0, 10, 1, 6400255, 50, UpCharsEx), Numbers)) = GEQuantity then
Exit;
begin
writeln('Something went wrong!')
Inc(numberOfFailures);
if numberofFailures = 5 then
begin
writeln('Failed too many times. Terminating script.');
TerminateScript;
end;
end;
end;
procedure GEESetPrice;
var
x, y, numberOfFailures : integer;
searchBox: TBox;
begin
for numberOfFailures := 0 to 5 do
if not InGEE then
Exit;
if not GEESellMenu and not GEEBuyMenu then
Exit;
case lowercase(GEPrice) of
'min':
searchBox := IntToBox(274, 211, 304, 231);
'mid':
Exit;
'max':
searchBox := IntToBox(427, 211, 460, 231);
else
begin
if (FindColorTolerance(x, y, 39167, 371, 211, 403, 231, 100)) then
begin
MMouse(x, y, 4, 4);
ClickMouse2(true);
WaitFunc(@GEECanTypePrice, 10, 6000);
TypeSendEx(GEPrice, true);
Wait(1500 + Random(250));
if (ExtractFromStr(GetTextAtExWrap(296, 184, 438, 198, 0, 10, 1, 6400255, 50, UpCharsEx), Numbers)) = GEPrice then
Exit;
begin
writeln('Something went wrong!')
Inc(numberOfFailures);
if numberOfFailures = 5 then
begin
writeln('Failed too many times. Terminating script.');
TerminateScript;
end;
end;
end;
end;
end;
end;
procedure GEEConfirmOffer;
begin
MouseBoxEx(215, 286, 310, 325, 10, 1);
Wait(1500 + Random(500));
end;
procedure GEEBuy;
var
x, y : Integer;
begin
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
GEEBuyAt;
WaitFunc(@GEECanTypeItem, 10, 6000);
TypeSendEx(GEWhat, true);
WaitFindColor(x, y, 23200, 67, 343, 119, 359, 30, 6000);
MouseBox(79, 350, 291, 352, 1);
WaitColorGone(39372, 394, 81, 40, 6000);
Wait(500 + Random(250));
if (ExtractFromStr((replace((lowercase(GetTextAtExWrap(590, 236, 705, 257, 0, 10, 1, 39423, 50, StatChars))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(GEWhat, Letters))) then
begin
GEESetQuantity;
GEESetPrice;
GEEConfirmOffer;
Exit;
end;
end;
procedure GEESell;
var
i, numberOfFails : Integer;
begin
if not InGEE then
Exit;
if GEESellMenu or GEEBuyMenu then
GEEMenuExit;
GEESellAt;
repeat
for i := 1 to 28 do
begin
MouseSpeed := randomrange(8, 15);
MouseTBox(InvBox(i), 3);
if (ExtractFromStr((replace((lowercase(GetTextAtExWrap(46, 7, 200, 23, 0, 10, 1, 2658536, 50, UpChars))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(GEWhat, Letters))) then
begin
writeln('Found the item at slot ' + IntToStr(i));
ClickMouse2(true);
Wait(2000 + Random(500));
Break;
end else
Inc(numberOfFails);
if (numberOfFails) = 100 then
begin
writeln('Item not found. Terminating script.');
TerminateScript;
end;
end;
until(ExtractFromStr((replace((lowercase(GetTextAtExWrap(46, 7, 200, 23, 0, 10, 1, 2658536, 50, UpChars))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(GEWhat, Letters)));
begin
if (ExtractFromStr((replace((lowercase(GetTextAtExWrap(212, 68, 386, 89, 0, 10, 1, 39372, 50, UpCharsEx))), '.!', 'i')), Letters)) = (lowercase(ExtractFromStr(GEWhat, Letters))) then
begin
GEESetQuantity;
GEESetPrice;
GEEConfirmOffer;
end;
end;
end;
procedure OpenGEBank;
var
x, y: Integer;
begin
if InGEE then
CloseWindow;
if BankScreen then
Exit;
if (FindObject(x, y, GE_Bank, MSX1, MSY1, MSX2, MSY2)) then
begin
Clickmouse2(false);
WaitOption('Bank B', 1000);
WaitFunc(@BankScreen, 10, 6000);
DepositAll;
end;
end;
procedure GEInitialPurchases;
begin
for CurrentSpot := 1 to 2 do
begin
GEWhat := Spot[CurrentSpot].What;
GESpot := Spot[CurrentSpot].slot;
GEQuantity := Spot[CurrentSpot].Quantity;
GEPrice := Spot[CurrentSpot].Price;
if InvCount > 0 then
OpenGEBank;
if BankScreen then
CloseBank;
OpenGE;
if not GEEIsSpotFree then
GEERecoverAt(true);
GEEBuy;
WaitFunc(@InGEEEx, 10, 6000);
Wait(500 + random(250));
if GEEIsFinishedAt then
GEERecoverAt(false);
end;
CloseWindow;
end;
procedure RecoverMoreSupply;
begin
if not InitialGEPurchases or not Task[CurrentTask].BuyGE then
Exit;
if (TimeFromMark(TimeSinceLastRecover) > 600000) then
begin
MarkTime(TimeSinceLastRecover);
CloseBank;
OpenGE;
if InitialGEPurchases then
begin
for CurrentSpot := 1 to 2 do
begin
GESpot := spot[CurrentSpot].slot;
GEERecoverAt(false);
end;
end;
if Task[CurrentTask].BuyGE then
begin
for CurrentTaskItem := CurrentTaskItem to high(task[CurrentTask].BuySlot) do
begin
GESpot := Task[CurrentTask].BuySlot[CurrentTaskItem];
GEERecoverAt(false);
end;
end;
CloseWindow;
end;
end;
procedure RecoverMoreVials; //Might want to remove this...
begin
if not InitialGEPurchases then
Exit;
if (TimeFromMark(TimeSinceLastVialRecover) > 600000) or (TimeFromMark(TimeSinceLastVialRecover) = 0) then
CloseBank;
OpenGE;
CurrentSpot := 6;
GEERecoverAt(false);
CloseWindow;
end;
function SellMinimumQuantityReached: Boolean;
var
a : Integer;
begin
if not BankScreen then
OpenGEBank;
if FinalProductTP = Point(0, 0) then
Exit;
a := (GetBankItemAmount(((FinalProductTP.x - 38) div 44), ((FinalProductTP.y - 90) div 45)));
writeln(IntToStr(a));
if (GetBankItemAmount(((FinalProductTP.x - 38) div 44), ((FinalProductTP.y - 90) div 45)) > Task[CurrentTask].SellMinimumQuantity[CurrentTaskItem]) then
begin
writeln('Minimum quantity reached. Proceeding to selling the item.');
Result := True;
end;
end;
procedure TaskGETransactions;
var
a : String;
begin
if Task[CurrentTask].BuyGE then
begin
if NewTask then
for CurrentTaskItem := 0 to (high(Task[CurrentTask].BuyWhat[CurrentTaskItem])) do
begin
GEWhat := Task[CurrentTask].BuyWhat[CurrentTaskItem];
GESpot := Task[CurrentTask].BuySlot[CurrentTaskItem];
GEQuantity := Task[CurrentTask].BuyQuantity[CurrentTaskItem]
GEPrice := Task[CurrentTask].BuyPrice[CurrentTaskItem]
if InvCount > 0 then
OpenGEBank;
if BankScreen then
CloseBank;
OpenGE;
if not GEEIsSpotFree then
GEERecoverAt(true);
GEEBuy;
WaitFunc(@InGEEEx, 10, 6000);
Wait(500 + random(250));
if GEEIsFinishedAt then
begin
GEERecoverAt(false);
end else
Break;
end;
end;
if Task[CurrentTask].SellGE then
begin
if NewSellTask then
begin
Wait(1500 + Random(250));
if not CustomFindDTMs(FinalProduct, (lowercase(ExtractFromStr(Task[CurrentTask].What, Letters)))) then
begin
writeln('Could not find the item!');
FinalProductTP := Point(0, 0);
Exit;
end;
NewSellTask := False;
end;
if SellMinimumQuantityReached then
for CurrentTaskItem := CurrentTaskItem to high(Task[CurrentTask].SellWhat[CurrentTaskItem]) do
begin
GEWhat := Task[CurrentTask].SellWhat[CurrentTaskItem];
GESpot := Task[CurrentTask].SellSlot[CurrentTaskItem];
GEQuantity := Task[CurrentTask].SellQuantity[CurrentTaskItem];
GEPrice := Task[CurrentTask].SellPrice[CurrentTaskItem];
writeln('It gets here');
if InGEE then
CloseWindow;
OpenGEBank;
Notes(true);
if Task[CurrentTask].SellQuantity[0] = 'all' then
begin
a := '0'
end else
a := Task[CurrentTask].SellQuantity[0];
Withdraw(((FinalProductTP.x - 38) div 44), ((FinalProductTP.y - 90) div 45), (StrToInt(a)));
OpenGE;
WaitFunc(@InGEEEx, 10, 6000);
if not GEEIsSpotFree then
GEERecoverAt(true);
GEESell;
NewSellTask := True;
FinalProductTP := Point(0, 0);
WaitFunc(@InGEEEx, 10, 6000);
Wait(500 + random(250));
if GEEIsFinishedAt then
begin
GEERecoverAt(false);
end else
Break;
end;
end;
NewTask := False;
end;
function TaskComplete: boolean;
begin
Writeln('We have completed task ' + IntToStr(CurrentTask) + ' Moving on to the next task.');
Inc(CurrentTask);
Writeln('We have now doing the task ' + IntToStr(CurrentTask));
NumberOfLoadz := 0;
NewTask := True;
FirstIngredientTP := Point(0, 0);
SecondIngredientTP := Point(0, 0);
FinalProductTP := Point(0, 0);
FreeDTM(FirstIngredient);
FreeDTM(SecondIngredient);
LoadDTMs;
end;
function BankEr: boolean;
var
a, b, x, y: Integer;
begin
if BankScreen then
CloseBank;
if InGEE then
CloseWindow;
case WhatBank of
'GE_Bank':
begin
if (FindObject(x, y, GE_Bank, 229, 166, 300, 185)) then
begin
Clickmouse2(false);
WaitOption('Bank B', 1000);
end else
if (FindObject(x, y, GE_Bank, MSX1, MSY1, MSX2, MSY2)) then
begin
Clickmouse2(false);
WaitOption('Bank B', 1000);
end;
end;
'Brown_Bank_Booth':
begin
if (FindObject(x, y, Brown_Bank_Booth, 229, 166, 300, 185)) or (FindObject(x, y, Brown_Bank_Booth, 254, 120, 262, 230)) then
begin
Clickmouse2(true);
end else
if (FindObject(x, y, Brown_Bank_Booth, MSX1, MSY1, MSX2, MSY2)) then
Clickmouse2(true);
if not (WaitFunc(@BankScreen,10, 6000)) then
begin
Clickmouse2(false);
WaitOption('Bank B', 1000);
end;
end;
end;
if (WaitFunc(@BankScreen, 10, 6000)) then
begin
if(InvCount > 0) then
DepositAll;
if UseTasks then //Task system
for CurrentTask := CurrentTask to high(task) do
begin
writeln('We are currently doing the task number ' + IntToStr(CurrentTask));
if NewTask or SellMinimumQuantityReached then
begin
if (Task[CurrentTask].BuyGE or Task[CurrentTask].SellGE) then
begin
TaskGETransactions;
end;
end;
Inc(NumberOfLoadz);
if Task[CurrentTask].NumberOfLoads = NumberOfLoadz then
TaskComplete;
if FirstIngredientTP.x = 0 then
begin
NumberOfLoadz := 0;
Wait(1000 + Random(250));
if not CustomFindDTMs(FirstIngredient, (lowercase(ExtractFromStr(Task[CurrentTask].What, Letters)))) then
begin
Writeln('Can not find the first ingredient. Moving to the next task.');
TaskComplete;
Exit;
end;
end;
if (WhatToDo = 'Pot') and (SecondIngredientTP.x = 0) then
begin
if not CustomFindDTMs(SecondIngredient, (lowercase(ExtractFromStr(Task[CurrentTask].What, Letters)))) then
begin
Writeln('Can not find the second ingredient. Moving to the next task.');
TaskComplete;
Exit;
end;
end;
if WhatToDo = 'Pot' then
begin
if (GetBankItemAmount(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45)) < 50) or (GetBankItemAmount(((SecondIngredientTP.x - 38) div 44), ((SecondIngredientTP.y - 90) div 45)) < 50) then
RecoverMoreSupply;
if (GetBankItemAmount(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45)) < 14) or (GetBankItemAmount(((SecondIngredientTP.x - 38) div 44), ((SecondIngredientTP.y - 90) div 45)) < 14) then
begin
a := ((GetBankItemAmount(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45))));
writeln(IntToStr(a));
b := (GetBankItemAmount(((SecondIngredientTP.x - 38) div 44), ((SecondIngredientTP.y - 90) div 45)));
writeln(IntToStr(b));
Writeln('Not enough supply. Moving on to the next task.');
TaskComplete;
Exit;
end;
Withdraw(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45), 14);
TaskGETransactions;
Withdraw(((SecondIngredientTP.x - 38) div 44), ((SecondIngredientTP.y - 90) div 45), 14);
end else
begin
if (GetBankItemAmount(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45)) < 50) then
RecoverMoreSupply;
if (GetBankItemAmount(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45)) < 28) then
begin
Writeln('Not enough supply. Moving on to the next task.');
TaskComplete;
Exit;
end;
Withdraw(((FirstIngredientTP.x - 38) div 44), ((FirstIngredientTP.y - 90) div 45), 0);
end;
CloseBank;
Exit;;
end;
begin //Normal system
if WhatToDo = 'Pot' then
begin
Withdraw(0, 0, 14);
if GetBankItemAmount(1, 0) < 2000 then
RecoverMoreSupply;
if GetBankItemAmount(0, 0) < 20 then
RecoverMoreVials;
Withdraw(1, 0, 14);
end else
begin
if GetBankItemAmount(0, 0) < 30 then
RecoverMoreSupply;
Withdraw(0, 0, 0);
end;
end;
CloseBank;
Result := True;
end;
end;
function MakeDone: boolean;
var
x, y : Integer;
begin
result := FindColorTolerance(x, y, 11896328, 210, 162, 430, 298, 10);
end;
procedure Production;
var
x, y, numberOfFails:integer;
begin
repeat
if not LoggedIn then LoginPlayer;
if not LoggedIn then Exit;
FindNormalRandoms;
BankEr;
if(not(WaitInvMinCount(28,2500))) then
Exit;
if WhatToDo = 'Pot' then
begin
InvMouse(14,1);
InvMouse(15,1);
end else
InvMouse(1, 1);
if(WaitFindColor(x, y, 13553639, 300, 300, 400, 400, 10, 5000)) then
begin
mouse(x, y, 40, 5, 1);
WaitFunc(@MakeDone, 10, 18000);
MMouse(275, 175, 20, 5);
ClickMouse2(1);
WaitColorGone(6076654, 226, 53, 10, 1000);
Wait(100 + Random(50));
end else
begin
inc(numberOfFails);
end;
until (numberOfFails = 3);
if numberOfFails = 3 then
TerminateScript;
end;
procedure StartingLoop;
begin
{$IFDEF SMART}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
MarkTime(SmartTimeUp);
ClickNorth(SRL_ANGLE_HIGH);
LoadObjects;
LoadGEStuff;
LoadTaskStuff;
LoadDTMs;
NewTask := True;
NewSellTask := True;
MarkTime(TimeSinceLastRecover);
FindNormalRandoms;
Antiban;
end;
procedure Mainloop;
begin
if not LoggedIn then LoginPlayer;
if TimeFromMark(SmartTimeUp) > 19800000 then
begin
SmartKillClient(SmartCurrentClient);
FreeSRL;
StartingLoop;
end;
Production;
FindNormalRandoms;
Antiban;
end;
begin
StartingLoop;
if InitialGEPurchases then
GEInitialPurchases;
repeat
Mainloop;
until(allPlayersInactive);
end.EDIT: There isn't really any place in the application for this, but I'd like to highlight the fact that I wouldn't be where I am without the help of many, many people. I am grateful and would like you to know it. I give up trying to list you as there are too many and I'd forget someone I'm sure, but I hope you know who you are.