Simba Code:
program Eldevin_Farmer;
//{$I SRL-OSR/SRL.simba}
//{$i SRL-6\lib\core\mouse.simba}
{$i SRL-6/srl.simba}
//{$i SRL-OSR\SRL\misc\AL_functions.simba}
// By MaxGreden
// ======= INSTRUCTIONS ===========
//Move Camera as far up you can, so the angle is top-down
//Camera Facing Directly North
//Character in the middle of a crop field
//Set Resolution 1024-600
// Move your window in proper resolution, to left-top of the screen
//ZOOM IN to the limit, but keep camera angle looking from top
//Have iventory Open and keep it on the right side of the screen
//Target Eldevin client
//Chat Visible
//Chat on 'General chat'
//Only things required in Inventory is: Watercan(with water) and Seeds
//Compost,Scarecrow, Dust is not required, but will use if found
// ================= OPTIONS ================== //
const
numberOfPlots = 1; //How many plots to be managed
//==============================================//
const
CenterX = 510;
CenterY = 296;
InvX1 = 620;
InvY1 = 0;
InvX2 = 1020;
InvY2 = 596;
BasilAvrgExp = 90;
JuteAvrgExp = 120;
GarlicAvrgExp = 190;
PotatoAvrgExp = 190;
var
attempt,randomWait,IRx,IRy,JuteSeed,PotatoSeed,GarlicSeed,WaitTime,Compost,Dust,Scarecrow,BasilSeed,WaterCan,x,y:Integer;
pruned:Boolean;
Procedure FreeTheDTMs;
begin
freeDTM(Compost);
freeDTM(Scarecrow);
freeDTM(Watercan);
freeDTM(Dust);
freeDTM(PotatoSeed);
freeDTM(GarlicSeed);
//freeDTM(JuteSeed);
//freeDTM(BasilSeed);
end;
Procedure LoadDTMs;
begin
Compost := DTMFromString('mlwAAAHicY2dgYGBhZmD4z8TA8BeKQXx2IOYB4gBGBoZoIA4FYh8gdgRidyD2BuIiP2sGK215hgD/AIbw8HCGskgXhl0ndjCUFJcwAI3BiRnxYCgAAAmlDYQ=');
Scarecrow := DTMFromString('m6wAAAHic42ZgYLjKzMBwCYhvAPEVID4PxCeBeDcQPwLiD1C5y0Asx8jAwAnEXEAsBMSSQCwDxFJQGoTVgdgMiEOd1BgqU90ZqkqdGSrSQxn0TRUZypNdGTzCtRg681wZMmKDGNwsVRkcvTQZYICRyhgJAABwKRT2');
Watercan := DTMFromString('mrAAAAHic42BgYHBnZmCwBmJzIHYGYh8gDgRiDyjtxwjBnkDsAsSuQOwFZfsCcWZxOcPKFSsZ2Nm5GNyi0hjSq9sZgoKCwOzk5GQGoBKKMAwAAKadDa0=');
Dust := DTMFromString('mrAAAAHic42BgYHjKxMDwAIjvA/ErJggfJvYGiI8zMjBcBOJDQHwQiPcA8Q5GiPgxIN40z5yhNkmWISM9g+HMoX0MLS2tDGWRLgxLm6QYJk2cxEAIMBLAMAAAUhYZBQ==');
PotatoSeed := DTMFromString('mrAAAAHic42BgYOAHYikgFgNiHiBmB2JmBgjggGJuqDgDVI4Lqk8AiJe1OTOk+ykxNGcaM0wts2bwMBMF47YsCJ8QYCSAYQAARAwI7g==');
GarlicSeed := DTMFromString('mrAAAAHic42BgYOAEYiEg5gNifiDmAmJGBghghopzQ/ksUHkBIBYGYgkg3rFmBUNqVCrD1O6pDK/fvGbo6OhgKPYKYiiJCmFozUpjIAQYCWAYAADhOw1+');
JuteSeed := DTMFromString('m1gAAAHic42JgYOAFYlEg5gdibiBmBWImIGZmgAAQnwuI2aFsEGAEYjYg5gRiHqheASAWBOKWlgQGLy9jhrlzqxl27JjKcPHiWobi4lCGsrIIsDiIzspyYyAWMBKJEQAAkL8Ong==');
BasilSeed := DTMFromString('mrAAAAHic42BgYHjKxMBwH4hvAPEtIL4DxI+B+BUQfwDijYwMDDuBeBsQrwfiVUC8HIhXA/EmIE6KimLwdHZm8HRyYgj29mZIjY4G84szMxmCvLwYgEoowjAAAJy6FG0=');
Wheat seeds := DTMFromString('mbQAAAHicY2VgYPjCxMDwGYh/A/FHIH4LxCmMDAx5QBwLxHFAnAbElXGmDL4eZgx9nSkMiQGeDBUJPgzYACMWDAYAm2AMPQ==');
AddOnTerminate('FreeTheDTMs');
wait(500);
end;
Procedure RandomWaiter(min,max: Integer);
begin
randomWait := randomRange(min,max);
wait(randomWait);
end;
Procedure CenterClick(DoubleClick: Boolean);
begin
Mouse(CenterX,CenterY,1,1,1);
wait(20);
if(DoubleClick)
then begin
fastClick(1);
end;
end;
Procedure clickObject(item: String; DoubleClick: Boolean);
begin
writeln('Found ' +item);
Mouse(x,y,1,1,1);
wait(20);
if(DoubleClick)
then begin
fastClick(1);
end;
wait(100);
end;
Procedure E_Rake;
begin
writeln('Started program - Raking...');
wait(100);
CenterClick(true);
RandomWaiter(7000,9000);
end;
Procedure E_Compost;
begin
if FindDTM(Compost, x, y, InvX1, InvY1, InvX2, InvY2) then begin
clickObject('Compost', false);
RandomWaiter(1000,1500);
CenterClick(false);
writeln('Applying Compost...');
RandomWaiter(5000,9000);
end;
end;
Procedure E_Dust;
begin
if FindDTM(Dust, x, y, InvX1, InvY1, InvX2, InvY2) then begin
clickObject('Dust', false);
RandomWaiter(1000,1500);
CenterClick(false);
writeln('Applying Dust...');
RandomWaiter(3000,6000); //7000-9000
end;
end;
Procedure E_Scarecrow;
begin
if FindDTM(Scarecrow, x, y, InvX1, InvY1, InvX2, InvY2) then begin
clickObject('Scarecrow', false);
RandomWaiter(1000,1500);
CenterClick(false);
writeln('Applying Scarecrow...');
RandomWaiter(3000,6000);
end;
end;
Procedure E_Seeds(seedDMT:Integer);
begin
if FindDTM(seedDMT, x, y, InvX1, InvY1, InvX2, InvY2) then begin
clickObject('Seeds', false);
RandomWaiter(1000,1500);
CenterClick(false);
writeln('Planting Seeds...');
RandomWaiter(4000,6000);
end else begin
if FindDTM(seedDMT, x, y, InvX1, InvY1, InvX2, InvY2) then
writeln('Could not find Seeds - Stopping program...');
TerminateScript;
Exit;
end;
end;
Procedure E_Water;
begin
if FindDTM(Watercan, x, y, InvX1, InvY1, InvX2, InvY2) then begin
clickObject('Watercan', false);
RandomWaiter(1000,1500);
CenterClick(false);
writeln('Watering Seeds...');
RandomWaiter(5000,7000);
end else
begin
writeln('Could not find Watercan - Stopping program...');
TerminateScript;
Exit;
end;
end;
Procedure E_Spam;
begin
writeln('Spamming leftClick');
repeat
RandomWaiter(500,1000);
//CenterClick(true);
fastClick(1);
wait(20);
fastClick(1);
If FindColorTolerance(IRx,IRy,1074175,24,456,290,521, 1) Then Begin //finds color organge in Chat box / Looks for "Farming +X experience [x/]." / Finished Harvesting
WaitTime := 100;
writeln('Harvested successfully');
end;
until(WaitTime = 100);
end;
Procedure E_Prune;
begin
pruned := false;
attempt := 0;
writeln('Looking for disease')
repeat
RandomWaiter(500,1000);
attempt := attempt +1
If FindColorTolerance(x,y,2447435,434,30,591,502, 1) Then Begin //finds color of Prune
pruned := true;
writeln('Found disease... pruning');
clickObject('Disease',true);
RandomWaiter(5000,6000);
end;
until(pruned OR attempt = 13);
writeln('Stopped pruning')
end;
Procedure E_MoveToPlot(plot: Integer);
begin
wait(1000);
if(plot = 1) Then begin
Mouse(CenterX,(CenterY-235),1,1,1);
wait(20);
fastClick(1);
RandomWaiter(7000,9000);
end;
if(plot = 0) Then begin
Mouse(CenterX,(CenterY+125),1,1,1);
wait(20);
fastClick(1);
RandomWaiter(7000,9000);
end;
end;
//Main program
begin
activateclient();
LoadDTMs;
if(numberOfPlots = 1) Then Begin
repeat
WaitTime := 0;
RandomWaiter(900,1200);
E_Rake;
E_Compost;
E_Dust;
E_Scarecrow;
E_Seeds(PotatoSeed);
E_Water;
E_Spam;
writeln('Restarting program')
until(false);
end;
//////////////////////////////////////////////////////////////
if(numberOfPlots = 2) Then Begin
repeat
WaitTime := 0;
RandomWaiter(900,1200);
E_Rake;
E_Compost;
E_Dust;
E_Scarecrow;
E_Seeds(PotatoSeed);
E_MoveToPlot(1); //Move to next plot
//E_Rake; (*) The move procedure rakes automatically (*)
E_Compost;
E_Dust;
E_Scarecrow;
E_Seeds(PotatoSeed);
E_Water;
E_Prune; //Find disease -- If found... Progress... If not found in 3-6 seconds... Progress ... Find later on...
E_MoveToPlot(0); //Move to previous plot
E_Water;
E_Prune;
E_MoveToPlot(1);
E_Spam;
E_MoveToPlot(0);
E_Spam;
writeln('Restarting program');
until(false);
end;
End.