Bobzilla69
2011-04-28 17:47:53
Hey all,
if you to know what my next script release is (if you even care :P ) then the wait is over.
say hello to Ernie The UrnCrafter { Ernie the fastest UrnCrafter in the west }
Ernie will mine clay, wet it and craft urn for you all in one neat (i hope) script.
you can even ask Ernie to simply only mine or to mine and only wet the clay is you so please.
Ernie also like to only do things by colour, so he may be a bit clumsy at times but when he works he sure is a thing of beauty.
Please note this script is a work in progress, the only section i have not done is urn crafting, the rest is done but needs testing :)
if you to know what my next script release is (if you even care :P ) then the wait is over.
say hello to Ernie The UrnCrafter { Ernie the fastest UrnCrafter in the west }
Ernie will mine clay, wet it and craft urn for you all in one neat (i hope) script.
you can even ask Ernie to simply only mine or to mine and only wet the clay is you so please.
Ernie also like to only do things by colour, so he may be a bit clumsy at times but when he works he sure is a thing of beauty.
Please note this script is a work in progress, the only section i have not done is urn crafting, the rest is done but needs testing :)
program ErnieUrnCrafter;
//{$i SRL\SRL\misc\smart.scar} //smart dont play well on computer
{$i SRL\SRL.scar}
{$i SRL\SRL\misc\Debug.scar}
{ Ernie the fastest UrnCrafter in the west }
var
DebugTheTPA:Boolean;
procedure DeclarePlayers;
var
I: integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
DebugTheTPA := False; //True if you want to see TPA debug (color only)
with Players[0] do
begin
Name := ''; //Username
Pass := ''; //Password
Nick := ''; //3-4 non uppercase, number, or space characters on your username
Pin := ''; //Bank Pin (Blank if none) not currently used, but might be later
Active := True; //Player Active?
WorldInfo := [False, -1, False]; //members, world (-1 is random), pvp
Booleans[10] := True; //want to mine clay
Booleans[11] := True; //want to wet clay
Booleans[12] := True; //want to make urns
Integers[10] := 1; //trips to mine
Integers[11] := 1; //trips to well
Integers[12] := 1; //trips to pottery shed
end;
for I := 0 to HowManyPlayers - 1 do
with Players[I] do
begin
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
end;
type
Colour = record
Col, Tol: Integer;
HMod, SMod : Extended;
UpText : TStringArray;
Colour: string;
end;
var
ColourSetup : Colour; //allows to set specific colors for trees
procedure SetupColour(what:string);
begin
case Lowercase(what) of
'clayrock': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 8570605; //color of what we cutting
Tol := 6; // tolerance for finding tree
HMod := 0.02; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 3.11; //30
UpText := [ 'ine Rock', 'ine'] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Clay Rock'; //tree name
end;
end;
'furnace': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 1524090; //color of what we cutting
Tol := 3; // tolerance for finding tree
HMod := 0.15; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 0.56; //30
UpText := [ 'Pottery Oven', 'Oven', 'ven'] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Pottery Oven'; //tree name
end;
end;
'potterwheel': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 3101036; //color of what we cutting
Tol := 1; // tolerance for finding tree
HMod := 0.13; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 0.40; //30
UpText := [ 'Potter', 'Wheel', 'heel', 'otter'] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Pottery Wheel'; //tree name
end;
end;
'potteryhouse': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 1984857; //color of what we cutting
Tol := 0; // tolerance for finding tree
HMod := 0.00; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 0.00; //30
UpText := [ 'alk here', 'alk' ] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Pottery House'; //tree name
end;
end;
'door': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 2449020; //color of what we cutting
Tol := 1; // tolerance for finding tree
HMod := 0.07; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 0.67; //30
UpText := [ 'pen Door', 'pen'] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Door'; //tree name
end;
end;
'well': begin
with ColourSetup do //loads recoard to store tree specific infomation for script
begin
Col := 3032403; //color of what we cutting
Tol := 3; // tolerance for finding tree
HMod := 0.15; //4 //used for colortolerancespeed, changes how accurate it is
SMod := 0.21; //30
UpText := [ 'Well', 'ell'] //uptext of tree for cutting, needs most of uptext to insure it trains only selected treeS
Colour := 'Well'; //tree name
end;
end;
end;
try wait(5);
SetColorSpeed2Modifiers(ColourSetup.HMod, ColourSetup.SMod);
finally //Players[CurrentPlayer].Strings[1] := Players[CurrentPlayer].Strings[1] + '//Failed to Find Tree to make TPA Logging Out//\';
SetColorSpeed2Modifiers(0.2, 0.2); // Sets the modifiers back to default, (0.2, 0.2).
ColorToleranceSpeed(1); // Sets the CTS back to the default, 1.
end;
end;
Function MyFindColor(what:String; MM:Boolean):Integer; //on minimap(true) or main screen (false)
var
i, ii, Tcolor, Red, Green, Blue, color,
bL, bH, gL, gH, rL, rH, colTol:integer;
colorArray : Tpointarray;
begin
case what of
'bankbooth': begin
color := 4018267;
bL := 58;
bH := 63;
gL := 77;
gH := 82;
rL := 88;
rH := 94;
colTol:= 4; //use to alter tollerance
end;
'bank': begin
color := 988754;
bL := 11;
bH := 19;
gL := 17;
gH := 26;
rL := 71;
rH := 92;
colTol:= 12; //use to alter tollerance
end;
'road': begin
color := 4219502;
bL := 59;
bH := 68;
gL := 93;
gH := 103;
rL := 103;
rH := 116;
colTol:= 9;
end;
end;
Result := 0;
if MM then
begin
FindColorsTolerance(colorArray, color, MMX1, MMY1, MMX2, MMY2, colTol);
end else FindColorsTolerance(colorArray, color, MSX1, MSY1, MSX2, MSY2, colTol);
ii := High(colorArray);
for i := 0 to ii do
if rs_OnMinimap(colorArray[i].x,colorArray[i].y)or not MM then
begin
TColor := GetColor(colorArray[i].x,colorArray[i].y);
colortoRGB(Tcolor, Red, Green, Blue);
if (Blue>=bL) and (Blue<=bH) then
if (Green>=gL) and (Green<=gH) then
if (Red>=rL) and (Red<=rH) then
begin
Result := Tcolor
Writeln(what +' Color Found :'+ IntToStr(Tcolor));
Exit;
end;
end;
end;
procedure LogoutWhy(Why:string); //idea from BobboHobbo script
begin
WriteLn(Why);
Players[CurrentPlayer].Active := False; //stes player to inactive
Logout;
end;
procedure AntiBan;
var
MousePos: TPoint;
begin
if (not (LoggedIn)) then Exit;
GetMousePos(MousePos.x, MousePos.y);
case random(100) of
0..4: PickupMouse;
20..24: Wait(200+Random(2500));
40..42: GameTab(RandomRange(tab_Combat, tab_Notes));
60..64: Wait(500 + Random(1500));
80..82: RandomAngle(1);
95..97: MakeCompass(RandomRange(0, 340));
end;
MakeCompass('n');
GameTab(Tab_Inv);
MMouse(MousePos.x, MousePos.y, 0, 0);
end;
procedure WalkToMine;
var
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
fern1, fern2, threeferns, ferncluster, lastfern, minespot, x, y:Integer;
begin
if not LoggedIn then Exit;
try wait(5)
MakeCompass('n');
Wait(200);
fern1 := DTMFromString('mQwAAAHicY2ZgYBABYnEoFgJiPiAWBuIsJwEGn2IzMOYH8mGYCQkDAQB3igNS');
fern2 := DTMFromString('mLgAAAHicY2JgYKhkYmCoBWEguwKIW335GHyLrRj4gWwQZoZiBgYAczQD8A==');
threeferns := DTMFromString('mbQAAAHicY2VgYBABYg4glgFiOSBmB2IpIOYDYl4oHyTf4ssFxz7FZmDMDxRHx0xImBmKwQAAQesFeQ==');
ferncluster := DTMFromString('mbQAAAHicY2VgYOADYlYg5oXSXEAsDOWzQ8WYgDjLSYChxZcLTIOwT7EZAz9QHB0zoWFmBigAAA/GBL0=');
lastFern := DTMFromString('mWAAAAHicY2FgYChkYmAoheIcIO4BijUDcTkQZwJxgzcXg72eCEOagwCDR6EZAz9QDBmzADEzEgYBAJWhBwc=');//DTMFromString('mggAAAHicY2NgYChgYmAoBeISKM4G4nog7gXKtQNxAxBXAHEmEFcBcbqDAEOovTSDQrgQmO1ZaAbG/EA5bJgJB4YAAI+RCqU=');
minespot:= DTMFromString('mQwAAAHicY2ZgYKhlYmBoBeKJQDwTyJ8AxP1AbKrJCcf8QD4MMyNhIAAA3eUEwA==');
if FindDTM(fern1, x, y, MMX1, MMCY, MMCX, MMY2) then
begin
Mouse(x , y , 0, 0, true);
Writeln('Walking to Mine from : Bank step 1 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 1 complete');
if FindDTM(fern2, x, y, MMCX - 20, MMCY + 20, MMX2, MMY2) then
begin
Mouse(x + 12, y + 25, 2, 2, true);
Writeln('Walking to Mine from : Bank step 2 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 2 complete');
if FindDTM(threeferns, x, y, MMCX , MMCY , MMX2, MMY2) then
begin
Mouse(x - 8, y + 10, 2, 2, true);
Writeln('Walking to Mine from : Bank step 3 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 3 complete');
if FindDTM(ferncluster, x, y, MMX1, MMCY , MMX2, MMY2) then
begin
Mouse(x - 18, y , 2, 2, true);
Writeln('Walking to Mine from : Bank step 4 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 4 complete');
if FindDTM(lastfern, x, y, MMX1, MMCY , MMX2, MMY2) then
begin
Mouse(x - 5, y , 2, 2, true);
Writeln('Walking to Mine from : Bank step 5 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 5 complete');
if FindColorsPie(TPA, MyFindColor('road', True), 15, 190, 210, 40, 70,MMX1, MMCY, MMCX, MMY2, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x - 5 , MiddleOfTPA.y + 14, 2, 2, true);
Flag;
Writeln('Walking to Mine from : Bank step 6 complete');
end else
LogoutWhy('walking failed Mine from : Bank step 6 complete');
if FindDTM(minespot, x, y, MMX1, MMCY , MMX2, MMY2) then
begin
Mouse(x - 18, y , 2, 2, true);
Writeln('Walking to Mine from : Bank step 7 complete');
Flag;
end else
LogoutWhy('Walking failed Mine from : Bank step 7 complete');
finally
FreeDTM(fern1);
FreeDTM(fern2);
FreeDTM(threeferns);
FreeDTM(ferncluster);
FreeDTM(lastfern);
FreeDTM(minespot);
end;
end;
procedure WalkToBankFromMine;
var
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
Tree, Tree2, Tree3, Tree4, TreeSpin, x, y:Integer;
begin
if not LoggedIn then Exit;
try wait(5)
MakeCompass('n');
Wait(200);
Tree:= DTMFromString('mbQAAAHicY2VgYGhhYmDogeIOIK4HYkuguDMQ+wNxOBDrAnGzOztDpg0vg1IwP5j2zjVm4AeKo2NmLBgMAEN/CAA=');
Tree2:= DTMFromString('mWAAAAHicY2FgYChgYmBIAeISIM4AYj2gmA4QuwGxIxCn2Qgx2GuJgWmPXAsGfqAYMgZqYWBGwiAAAEO4Bbk=');
Tree3 := DTMFromString('mLgAAAHicY2JgYAhmYmAIB2IlIFseiJt9uRi8i80Y+IFsEAZKMbAwgAAAT7wC5A==');
Tree4:= DTMFromString('mQwAAAHicY2ZgYKhlYmBoAOIqIDYG8nWAWA+Im325GLyLzcCYH8iHYaAyBmYoBgIA1TYFBQ==');
TreeSpin:= DTMFromString('mQwAAAHicY2ZgYOhhYmCYCMS9QKwM5EsBsQQQp9kIMdhriTHIB4sw8AP5MAxUxsAMxUAAALSKA/c=');
Writeln('Walking to Bank from : Mine');
if FindColorsPie(TPA, MyFindColor('road', True), 15, 390, 350, 40, 72,MMCX - 20, MMY1, MMX2, MMCY, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y - 10, 5, 5, true);
Writeln('Walking to Bank from : Mine step 1 complete');
Flag;
end else
LogoutWhy('walking failed Bank from : Mine step 1 complete');
if FindDTM(TreeSpin, x, y, MMCX, MMY1, MMX2, MMY2) or
FindSymbol(x, y, 'spin') then
begin
Mouse(x - 5, y , 2, 2, true);
Writeln('Walking to Bank from : Mine step 2 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Mine step 2 complete');
if FindDTM(Tree, x, y, MMCX, MMY1, MMX2, MMY2) then
begin
Mouse(x + 5, y - 15, 2, 2, true);
Writeln('Walking to Bank from : Mine step 3 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Mine step 3 complete');
if FindDTM(Tree2, x, y, MMCX - 25, MMY1, MMX2, MMY2) then
begin
Mouse(x - 5, y - 8, 2, 2, true);
Writeln('Walking to Bank from : Mine step 4 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Mine step 4 complete');
if FindDTM(Tree3, x, y, MMX1, MMY1, MMCX, MMCY) then
begin
Mouse(x - 8, y + 8, 2, 2, true);
Writeln('Walking to Bank from : Mine step 5 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Mine step 5 complete');
if FindDTM(Tree4, x, y, MMCX - 15 , MMY1, MMX2, MMY2) then
begin
Mouse(x - 6, y - 8, 2, 2, true);
Writeln('Walking to Bank from : Mine step 6 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Mine step 6 complete');
if FindColorsPie(TPA, MyFindColor('bank', True), 15, 30, 90, 40, 72,MMCX , MMY1, MMX2, MMCY, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y , 2, 2, true);
Writeln('Walking to Bank from : Mine step 7 complete');
Flag;
end else
LogoutWhy('walking failed Bank from : Mine step 7 complete');
finally
FreeDTM(Tree);
FreeDTM(Tree2);
FreeDTM(Tree3);
FreeDTM(Tree4);
FreeDTM(TreeSpin);
end;
end;
Procedure WalkToPottery;
var
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
fern1, fern2, threeferns, ferncluster, lastfern, minespot, x, y:Integer;
begin
if not LoggedIn then Exit;
try wait(5)
MakeCompass('n');
Wait(200);
fern1 := DTMFromString('mQwAAAHicY2ZgYBABYnEoFgJiPiAWBuIsJwEGn2IzMOYH8mGYCQkDAQB3igNS');
fern2 := DTMFromString('mLgAAAHicY2JgYKhkYmCoBWEguwKIW335GHyLrRj4gWwQZoZiBgYAczQD8A==');
threeferns := DTMFromString('mbQAAAHicY2VgYBABYg4glgFiOSBmB2IpIOYDYl4oHyTf4ssFxz7FZmDMDxRHx0xImBmKwQAAQesFeQ==');
ferncluster := DTMFromString('mbQAAAHicY2VgYOADYlYg5oXSXEAsDOWzQ8WYgDjLSYChxZcLTIOwT7EZAz9QHB0zoWFmBigAAA/GBL0=');
lastFern := DTMFromString('mWAAAAHicY2FgYChkYmAoheIcIO4BijUDcTkQZwJxgzcXg72eCEOagwCDR6EZAz9QDBmzADEzEgYBAJWhBwc=');//DTMFromString('mggAAAHicY2NgYChgYmAoBeISKM4G4nog7gXKtQNxAxBXAHEmEFcBcbqDAEOovTSDQrgQmO1ZaAbG/EA5bJgJB4YAAI+RCqU=');
minespot:= DTMFromString('mQwAAAHicY2ZgYKhlYmBoBeKJQDwTyJ8AxP1AbKrJCcf8QD4MMyNhIAAA3eUEwA==');
if FindDTM(fern1, x, y, MMX1, MMCY, MMCX, MMY2) then
begin
Mouse(x , y , 0, 0, true);
Writeln('Walking to Pottery from : Bank step 1 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 1 complete');
if FindDTM(fern2, x, y, MMCX - 15, MMCY + 20, MMX2, MMY2) then
begin
Mouse(x + 12, y + 25, 2, 2, true);
Writeln('Walking to Pottery from : Bank step 2 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 2 complete');
if FindDTM(threeferns, x, y, MMCX , MMCY , MMX2, MMY2) then
begin
Mouse(x - 8, y + 8, 2, 2, true);
Writeln('Walking to Pottery from : Bank step 3 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 3 complete');
if FindDTM(ferncluster, x, y, MMX1, MMCY , MMX2, MMY2) then
begin
Mouse(x - 18, y , 2, 2, true);
Writeln('Walking to Pottery from : Bank step 4 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 4 complete');
if FindDTM(lastfern, x, y, MMX1, MMCY , MMX2, MMY2) then
begin
Mouse(x - 5, y , 2, 2, true);
Writeln('Walking to Pottery from : Bank step 5 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 5 complete');
if FindColorsPie(TPA, MyFindColor('road', True), 15, 190, 210, 40, 70,MMX1, MMCY, MMCX, MMY2, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x - 5 , MiddleOfTPA.y + 14, 2, 2, true);
Flag;
Writeln('Walking to Pottery from : Bank step 6 complete');
end else
LogoutWhy('walking failed Pottery from : Bank step 6 complete');
if FindSymbol(x, y, 'pot') then
begin
Mouse(x , y , 2, 2, true);
Writeln('Walking to Pottery from : Bank step 7 complete');
Flag;
end else
LogoutWhy('Walking failed Pottery from : Bank step 7 complete');
finally
FreeDTM(fern1);
FreeDTM(fern2);
FreeDTM(threeferns);
FreeDTM(ferncluster);
FreeDTM(lastfern);
FreeDTM(minespot);
end;
end;
Procedure WalkToBankFromPottery;
var
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
Tree, Tree2, Tree3, Tree4, TreeSpin, x, y:Integer;
begin
if not LoggedIn then Exit;
try wait(5)
MakeCompass('n');
Wait(200);
Tree:= DTMFromString('mbQAAAHicY2VgYGhhYmDogeIOIK4HYkuguDMQ+wNxOBDrAnGzOztDpg0vg1IwP5j2zjVm4AeKo2NmLBgMAEN/CAA=');
Tree2:= DTMFromString('mWAAAAHicY2FgYChgYmBIAeISIM4AYj2gmA4QuwGxIxCn2Qgx2GuJgWmPXAsGfqAYMgZqYWBGwiAAAEO4Bbk=');
Tree3 := DTMFromString('mLgAAAHicY2JgYAhmYmAIB2IlIFseiJt9uRi8i80Y+IFsEAZKMbAwgAAAT7wC5A==');
Tree4:= DTMFromString('mQwAAAHicY2ZgYKhlYmBoAOIqIDYG8nWAWA+Im325GLyLzcCYH8iHYaAyBmYoBgIA1TYFBQ==');
TreeSpin:= DTMFromString('mQwAAAHicY2ZgYOhhYmCYCMS9QKwM5EsBsQQQp9kIMdhriTHIB4sw8AP5MAxUxsAMxUAAALSKA/c=');
Writeln('Walking to Bank from : Pottery');
if FindColorsPie(TPA, MyFindColor('road', True), 15, 0, 30, 30, 60,MMCX - 5, MMY1, MMX2, MMCY, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y - 10, 5, 5, true);
Writeln('Walking to Bank from : Pottery step 1 complete');
Flag;
end else
LogoutWhy('walking failed Bank from : Pottery step 1 complete');
if FindDTM(TreeSpin, x, y, MMCX, MMY1, MMX2, MMY2) or
FindSymbol(x, y, 'spin') then
begin
Mouse(x - 5, y , 2, 2, true);
Writeln('Walking to Bank from : Pottery step 2 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Pottery step 2 complete');
if FindDTM(Tree, x, y, MMCX, MMY1, MMX2, MMY2) then
begin
Mouse(x + 5, y - 15, 2, 2, true);
Writeln('Walking to Bank from : Pottery step 3 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Pottery step 3 complete');
if FindDTM(Tree2, x, y, MMCX - 25, MMY1, MMX2, MMY2) then
begin
Mouse(x - 5, y - 8, 2, 2, true);
Writeln('Walking to Bank from : Pottery step 4 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Pottery step 4 complete');
if FindDTM(Tree3, x, y, MMX1, MMY1, MMCX, MMCY) then
begin
Mouse(x - 8, y + 8, 2, 2, true);
Writeln('Walking to Bank from : Pottery step 5 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Pottery step 5 complete');
if FindDTM(Tree4, x, y, MMCX - 15 , MMY1, MMX2, MMY2) then
begin
Mouse(x - 6, y - 8, 2, 2, true);
Writeln('Walking to Bank from : Pottery step 6 complete');
Flag;
end else
LogoutWhy('Walking Failed Bank from : Pottery step 6 complete');
if FindColorsPie(TPA, MyFindColor('bank', True), 15, 30, 90, 40, 72,MMCX , MMY1, MMX2, MMCY, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y , 2, 2, true);
Writeln('Walking to Bank from : Pottery step 7 complete');
Flag;
end else
LogoutWhy('walking failed Bank from : Pottery step 7 complete');
finally
FreeDTM(Tree);
FreeDTM(Tree2);
FreeDTM(Tree3);
FreeDTM(Tree4);
FreeDTM(TreeSpin);
end;
end;
Procedure WalkToWater;
var
x, y:integer;
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
MakeCompass('n');
Wait(200);
if FindSymbolin(x, y, 'water', 564, 19, 607, 55 ) then
begin
Mouse(x + 10, y + 10, 2, 2, true);
Flag;
Writeln('Walking to Water from : Bank step 1 complete');
end else
begin
if FindColorsPie(TPA, MyFindColor('road2', True), 15, 290, 320, 50, 70,MMX1, MMCY, MMCX, MMY2, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y , 2, 2, true);
Flag;
Writeln('Walking to Water from : Bank step 1 complete');
end else
LogoutWhy('walking failed Water from : Bank step 1 complete');
end;
end;
Procedure WalkToBankFromWater;
var
MiddleOfTPA: TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
MakeCompass('n');
Wait(200);
if FindColorsPie(TPA, MyFindColor('bank', True), 15, 120, 150, 40, 72,MMCX , MMCY, MMX2, MMY2, mmcx, mmcy)then
begin
MiddleOfTPA:= MiddleTPA(TPA);
if DebugTheTPA then DebugTPA(TPA, '');
Mouse(MiddleOfTPA.x , MiddleOfTPA.y + 10, 2, 2, true);
Writeln('Walking to Bank from : Mine step 7 complete');
Flag;
end else
LogoutWhy('walking failed Bank from : Mine step 7 complete');
end;
function WeStillMining: boolean;
var
T, MineTime, count: integer;
begin
count:= InvCount;
Flag;
Wait(200 +Random(200));
if not LoggedIn or (Invfull) then exit;
T := GetSystemTime; //used to get mine time
MineTime := 5000 + random(5000); //how long to mine a rock for
Writeln('Mining started');
repeat
if FindBlackChatMessage('no ore') then break;
if not (FindBlackChatMessage('swing your pick')) then
begin
if FindBlackChatMessage('manage') then break;
end;
if InvCount > count then break;
Wait(500 + random(200));
if Invfull then Break;
Antiban;
Result := True; //true if we are still chopping
until ((GetSystemTime - T > MineTime) or (not LoggedIn)) //exit repeat if we reach mine time
FindNormalRandoms;
if (GetSystemTime - T > MineTime) then
Writeln('Took longer then ' + IntToStr(MineTime) + ' to Mine the clay.');
if not LoggedIn then
Writeln('Player not logged in');
if Invfull then
writeln('Invfull starting banking');
Result := False;
end;
function FindObjectTPA(what:String):Boolean;
var
x, y, i, ii: Integer;
ObjectTPA: TPointArray;
ObjectATPA: T2dPointArray;
begin
if not LoggedIn then Exit; //if not logged in exit
try Wait(1);
ColorToleranceSpeed(2);
SetupColour(what);
SetColorSpeed2Modifiers(ColourSetup.HMod, ColourSetup.SMod);
Writeln('Attempting to Find ' +ColourSetup.Colour );
FindColorsSpiralTolerance(MSCX, MSCY, ObjectTPA, ColourSetup.Col, MSX1, MSY1, MSX2, MSY2, ColourSetup.Tol);
ObjectATPA := SplitTPAEx(ObjectTPA, 12, 12); //TPAtoATPAex( 20, 20)
if DebugTheTPA then
begin
DebugATPABounds(ObjectATPA);
//Wait(2000);
end;
if Length(ObjectATPA) = 0 then Exit; //if the split returns nothing TreeATPA will be empty so
SortATPAFromFirstPoint(ObjectATPA, Point(MSCX, MSCY)); //sort TPA acording to main screen center point
if DebugTheTPA then
begin
Writeln('ATPA After Sort');
DebugATPA(ObjectATPA, '');
end;
ii := High(ObjectATPA);
for i := 0 to ii do //from 0 first entry in array to ii highest entry
begin
MiddleTPAEx(ObjectATPA[i], x, y);//find middle of array entry
MMouse(x, y, 3, 3);
Wait(300);
if WaitUpTextMulti(ColourSetup.UpText , 400) then
begin
Mouse(x, y, 0, 0, True);
Flag;
Result:=True;
Exit;
Wait(500 + Random(1500));
end;
end;
FindNormalRandoms;
finally //Players[CurrentPlayer].Strings[1] := Players[CurrentPlayer].Strings[1] + '//Failed to Find Tree to make TPA Logging Out//\';
SetColorSpeed2Modifiers(0.2, 0.2); // Sets the modifiers back to default, (0.2, 0.2).
ColorToleranceSpeed(1); // Sets the CTS back to the default, 1.
end;
end;
Procedure MineIt;
var
x, y, Fail: Integer;
begin
if not LoggedIn then Exit; //if not logged in exit
Writeln('Attempting to Mine Clay ');
repeat
if not FindObjectTPA('clayrock') then
begin
Writeln('Could not find tree Trying Failsafe Finder');
if FindObj(x, y, 'ine', ColourSetup.Col, ColourSetup.Tol) then //use normal find object function as failsafe
begin
Writeln('Found Clay using FindObj');
Mouse(x, y, 0, 0, True);
end else
begin
Writeln('Could not find Clay using Colour or FindObj ');
Inc(Fail); //failsafe so ther is no infinate loop, after 15 fails script terminates
Wait(1500 + Random(500)) //incase all trees are cut down ,otherwise its instant failsafe activation (increase if hight population of cutters)
if(Fail > 15) then
begin
Writeln('Script failed to find Clay');
Writeln('Even after 15 attempts');
Writeln('Script will Terminate');
Fail := 0; //Resetting for next player
Writeln('loging out');
end;
end;
end;
Flag;
Wait(500+Random(500))
if not WeStillMining then
begin
Continue; //restarts procedure
end;
AntiBan;
until((InvFull) or (not LoggedIn)); //if inventory is full
if InvFull then
Writeln('Inventory Full Banking');
Writeln('Mined '+inttostr(CountItemsBlackLine(62, 1)));
end;
Procedure WetClay;
var
i, b, bb, x, y:integer;
Clay, SoftClay:TBox;
begin
for i:=1 to 28 do
begin
Clay:= InvBox(i);
if CountColor(SRL_OUTLINE_BLACK, Clay.X1, Clay.Y1, Clay.X2, Clay.Y2 ) = 62 then
begin
Writeln('Clay Found, Clicking it to be wetted');
MouseBox(Clay.X1 + 5, Clay.Y1 + 5, Clay.X2 - 5, Clay.Y2 - 5, 1)
Flag;
Wait(500+Random(800));
if FindObjectTPA('well')then
begin
Flag;
Wait(1500+Random(800));
if FindText(x, y, 'Soft clay', 'StatChars', 235, 433, 283, 452 ) then
begin
Mouse(x, y, 2, 2, true);
Writeln('Clay and Water mixing');
repeat
Wait(500+Random(500));
bb:=0;
for b:=1 to 28 do
begin
SoftClay:= InvBox(b)
if (CountColor(SRL_OUTLINE_BLACK, SoftClay.X1, SoftClay.Y1, SoftClay.X2, SoftClay.Y2 ) = 67) or (CountColor(SRL_OUTLINE_BLACK, SoftClay.X1, SoftClay.Y1, SoftClay.X2, SoftClay.Y2 ) = 0 ) then
begin
inc(bb);
Writeln('Total Soft Clay so far is including spaces:'+inttostr(bb));
Wait(100+Random(100));
end;
end;
until(bb = 28)
end;
end else
begin
LogoutWhy('Could not find well Loging out');
end;
end;
end;
end;
Function MyOpenBank:Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
x, y, i, ii:Integer;
begin
Result:= False;
if BankScreen then
begin
Result:= True;
Writeln('Bank already open');
Exit;
end;
MakeCompass('e');
Wait(300); //screen settel
FindColorsSpiralTolerance(x, y, TPA, MyFindColor('bankbooth', False), MSX1, MSY1, MSX2, MSCY, 5);
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
ii := High(ATPA);
for i := 0 to ii do //from 0 first entry in array to highest entry in ATPA
begin
MiddleTPAEx(ATPA[i], x, y);//find middle of array entry
MMouse(x, y, 2, 2);
if WaitUpTextMulti(['ooth', 'ank booth'], 400) then
begin
Mouse(x, y, 0, 0, False);
Wait(200);
WaitOption('uickl', 400);
Flag;
Wait(2000 + Random(800));
if PinScreen then //if it fins pin screen, enter pin
begin
InPin(Players[CurrentPlayer].Pin);
end;
if BankScreen then
begin
Result:= True;
Writeln('Bank has been opened');
Wait(500+Random(500));
Exit;
end;
end;
end;
end;
Procedure BankIt(BL:integer);
var
i:integer;
Clay:TBox;
begin
if MyOpenBank then
begin
if Players[CurrentPlayer].Booleans[1] then
begin
DepositAll;
Wait(500+random(800));
Writeln('Banking Done');
CloseBank;
end else
begin
for i:=1 to 28 do
begin
Clay:= InvBox(i);
if CountColor(SRL_OUTLINE_BLACK, Clay.X1, Clay.Y1, Clay.X2, Clay.Y2 ) = BL then
begin
Writeln('Clay Found, Banking it');
MouseBox(Clay.X1 + 5, Clay.Y1 + 5, Clay.X2 - 5, Clay.Y2 - 5, 2)
ChooseOptionMulti(['All', 'll', 'Al']);
Wait(500+Random(800));
end;
end;
Writeln('Banking Done');
CloseBank;
end;
end else
begin
Writeln('Failed to open Bank, logging out');
LogoutWhy('Failed to bank items');
end;
MakeCompass('n');
end;
Procedure EquipmentCheck;
var
i:integer;
item:TPoint;
Items:TBox;
begin
if (not (LoggedIn)) then Exit;
Gametab(tab_Equip)
if CountColor(SRL_OUTLINE_BLACK, 568, 288, 604, 322 ) = 98 then //takes off weapon/pic
begin
Writeln('Pic Found equiped');
Players[CurrentPlayer].Booleans[0] := True; //Have Pic
Players[CurrentPlayer].Booleans[1] := True; //true if equiped
Exit;
end else
begin
Gametab(tab_Inv)
Wait(500);
for i:=1 to 28 do
begin
Items:= InvBox(i);
if CountColor(SRL_OUTLINE_BLACK, Items.X1, Items.Y1, Items.X2, Items.Y2 ) = 98 then
begin
Writeln('Pic Found in Inventory');
Players[CurrentPlayer].Booleans[0] := True; //Have Pic
Players[CurrentPlayer].Booleans[1] := False;
Exit;
end;
end;
end;
If (not Players[CurrentPlayer].Booleans[0]) then
begin
Writeln('No Pic found, checking bank');
MakeCompass('W');
if MyOpenBank then
begin
FixBankTab;
FixBank;
DepositAll; //clears inventory
for i:=1 to 40 do
begin
Items:= BankIndexToMSBox(i);
item:= BankIndexToMSPoint(i);
if CountColor(SRL_OUTLINE_BLACK, Items.X1 - 5, Items.Y1 + 11, Items.X2 + 2, Items.Y2 + 5 ) = 49 then
begin
Writeln('possible match for pic');
MouseBox(Items.X1, Items.Y1, Items.X2, Items.Y2, 3);
Wait(500);
If IsUpTextMultiCustom(['pickaxe', 'ckaxe', 'pick'])then
begin
Writeln('Pic Found, withdrawing it');
Mouse(item.x + 15, item.y + 15, 0, 0, True);
Wait(500+Random(500));
Players[CurrentPlayer].Booleans[0] := True; //Have Pic
CloseBank;
for i:=1 to 28 do
begin
Items:= InvBox(i);
if CountColor(SRL_OUTLINE_BLACK, Items.X1, Items.Y1, Items.X2, Items.Y2 ) = 98 then
begin
Writeln('Trying to equipit');
MouseBox(Items.X1, Items.Y1, Items.X2, Items.Y2, 1);
Wait(600+random(800));
for i:=1 to 28 do //might seem redundent but works
begin
Items:= InvBox(i);
if CountColor(SRL_OUTLINE_BLACK, Items.X1, Items.Y1, Items.X2, Items.Y2 ) = 98 then
begin
Writeln('Pic Found in Inventory');
Players[CurrentPlayer].Booleans[0] := True; //Have Pic
Players[CurrentPlayer].Booleans[1] := False;
Exit;
end else
begin
Writeln('Pic has been equiped');
Players[CurrentPlayer].Booleans[0] := True; //Have Pic
Players[CurrentPlayer].Booleans[1] := True;
Exit;
end;
end;
end;
end;
Exit;
end;
end;
end;
end else
begin
Writeln('Bank not found loging out');
end;
end;
Gametab(tab_Inv); // black count for pic 98 49 in bank stacked
MakeCompass('n');
end;
Procedure Main;
begin
LoginPlayer;
Wait(500+Random(800));
EquipmentCheck;
repeat
if Players[CurrentPlayer].Booleans[10] then
begin
for i:=0 to Players[CurrentPlayer].Integers[10] do
begin
WalkToMine;
MineIt;
WalkToBankFromMine;
BankIt(62);
end;
end;
if Players[CurrentPlayer].Booleans[11] then
begin
for i:=0 to Players[CurrentPlayer].Integers[11] do
begin
WalkToWater;
WetClay;
WalkToBankFromWater;
BankIt(67);
end;
end;
if Players[CurrentPlayer].Booleans[12] then
begin
for i:=0 to Players[CurrentPlayer].Integers[12] do
begin
WalkToPottery;
MineIt;
WalkToBankFromPottery;
BankIt(85);
end;
end;
//BankIt(62); //mined clay 62 soft clay 67 cracked mining 85 same afetr fired
until(not(LoggedIn))
end;
procedure ProgressReport;
begin
end;
begin //62 mined clay black count
SetUpSRL;
ActivateClient;
DeclarePlayers;
AddOnTerminate('ProgressReport'); //on script terminate do progress report
Main;
//EquipmentCheck;
//WalkToMine;
//MineIt;
//WalkToBankFromMine;
//MyOpenBank;
//WalkToWater;
//wetclay;
//WalkToBankFromWater;
//WalkToPottery;
//WalkToBankFromPottery;
end.