Don't worry guy, Once I am done leveling Crafting/Mining and Smithing with my personnal script, I will share it.
Here some codes from my personnal scripts that could help people for mining
My loop for mining
Code:
//Mine Silver until inventory full
repeat
//Looking for Silver rock
repeat
GeneralAntiban(150);
Wait(Randomrange(200,400));
until(FindTPAsOnScreen(10592942,12,100,TopLeftScreen,BotRightScreen,
NormalSizeTPA,SilverUpText, False));
//Wait for player to stop walking
Wait(Randomrange(3000, 3500));
while (isPlayerWalking()) do
Wait(Randomrange(250, 300));
//Detecting if we are mining
repeat
GeneralAntiban(1500);
Wait(Randomrange(20,40));
//Trying to find Mining pick on screen
if (FindDtmOnScreen(MiningPickDTMs,TopLeftScreen,BotRightScreen)) then
begin
failsCounter := 0;
end else
failsCounter := failsCounter + 1
until (failsCounter > failsLimit);
Wait(Randomrange(250, 300));
until (isInvFull());
General fonction I made for Detecting and clicking TPA on the screen
Code:
{**********************************************************************
* - This function will try to find TPAs on specific location and click it
* - Col -> Color we are searching
* - Tol -> Tolerance
* - Filter -> Minimum length TPA (This will be used, so we can filter bad TPA)
* - LocTopLeft, LocBotRight -> Where we will search on the screen
* - SizeTPA -> Desired size for our TPAs(width,height)
* - textUpText -> UpText we are looking for
* - Furnace -> Determine if we need to move mouse further on the x axis(Special need for this script)
***********************************************************************}
Function FindTPAsOnScreen(Col, Tol, Filter : Integer; LocTopLeft, LocBotRight,
SizeTPA : TPoint; textUpText : TStringArray; Furnace : Boolean) : Boolean
var
tPointGang: TPointArray;
ATPA : T2DPointArray;
i : Integer;
begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.54);
//Try to find the color at the location
if FindColorsTolerance(tPointGang, Col, LocTopLeft.x, LocTopLeft.y,
LocBotRight.x, LocBotRight.y, Tol) then
begin
//Forming TPAs with the points we found
ATPA := TPAtoATPAEx(tPointGang, SizeTPA.x, SizeTPA.y);
for i:= 0 to high(ATPA) do
begin
//Filter bad TPAs
if (GetArrayLength(ATPA[i]) > Filter) then
begin
//Move our mouse on the TPA
if (Furnace) then
begin
customMouse(Point(MiddleTPA(ATPA[i]).x - 45 - random(10), MiddleTPA(ATPA[i]).y));
end else
customMouse(Point(MiddleTPA(ATPA[i]).x, MiddleTPA(ATPA[i]).y));
//Look if UpText match
if (waitUpTextMulti(textUpText, 150 + random(100))) then
begin
//Click
fastClick(MOUSE_LEFT);
Wait(Randomrange(30,120));
//Detect if we miss clicked
if (didYellowClick()) then
begin
while (isLoggedIn() and isPlayerWalking()) do
sleep(random(250, 300));
FindTPAsOnScreen(Col,Tol,Filter,LocTopLeft,LocBotRight,SizeTPA,
textUpText, Furnace);
end;
//Return true and quit if we didn't miss click
Result := True;
Exit;
end;
end;
end;
end;
end;
Function I use to detect if I am mining. You will need to look at my mining loop to understand what it does
Code:
{**********************************************************************
* Try to find DTMs at mentionned location.
* - YourDTMs -> Container containing all the DTM we want to search
* - LocTopLeft, LocBotRight -> Where we will search on the screen
* - Return true if DTM was found
* - Position of the DTM saved in variables -> mouseX,mouseY
******************************************************************}
Function FindDtmOnScreen(YourDTMs : TIntegerArray; LocTopLeft, LocBotRight :
TPoint) : Boolean;
var
I : Integer;
begin
for I := 0 to high(YourDTMs) do
if (FindDTM (YourDTMs[I], mouseX, mouseY, LocTopLeft.x, LocTopLeft.y,
LocBotRight.x, LocBotRight.y)) then
begin
Result := True;
Exit;
end;
end;
Some variables to help you
Code:
DTM_MiningPickHori, DTM_MiningPickVerti : Integer
MiningPickDTMs : TIntegerArray
DTM_MiningPickHori := DTMFromString('mWAAAAHicY2FgYLBnZGCwAmI3IPYGYl00LMqHwEYORgysQD3ImAkNgwAAr24C9A==');
DTM_MiningPickVerti := DTMFromString('mWAAAAHicY2FgYIhiRMV6QKwOxCZAbAHEIrwMDEpiEFrNWJ2BFagHGTOhYRAAAMzvA0w=');
MiningPickDTMs := [DTM_MiningPickHori, DTM_MiningPickVerti];
You are good to go with these 2 function and my Mining Loop.