using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;
namespace AutoFarmer {
public class AutoFarmer: Core {
public static string GetPluginAuthor()
{
return "JoeBobJr";
}
public static string GetPluginVersion()
{
return "1.0.0.4";
}
public static string GetPluginDescription()
{
return "Auto Farmer";
}
public void PluginRun() {
while (true)
{
int laborPoints = me.laborPoints;
//====== This part of the code just chooses a random number and sets the amount of time the plugin will wait ==============
Random random = new Random();
var ms = random.Next(24, 107) * 1000; // Choose random number between 24 and 107 seconds
var s = ms / 1000; // Converts Milliseconds to Seconds. Every 1 second is 1000 milliseconds.
if (laborPoints > 2000) // Sets a loop to check your laborPoints if they are under 2000 it waits for regen
{
//===== Count the seeds and items in bag =============================================================
var itemStart = itemCount("Azalea");
var itemSeedStart = itemCount("Azalea Seed");
// ======== This is the only part of the code you really need to edit or change.===================================
// ======== The last number in this code is the farmID code you can get it by running =============================
// ======== Scarecrow plugin and looking at the number to the right of the scarecrow you want to use ==============
CollectItemsAtFarm("Azalea", "Gathering: Spend 1 Labor to gather materials.", 26346);
PlantItemsAtFarm("Azalea Seed", 26346);
// ===========================================================================================
//===== Find out how many seeds and items we have ====================================================
var itemEnd = itemCount("Azalea");
var itemSeedEnd = itemCount("Azalea Seed");
//====== Just some log stuff don't need to mess with this part of the code =====================================
Log("\n[color=#87AFC7]========================[/color]", "[Auto Farmer]");
Log("[color=#737CA1]Total Seeds Left: [/color][color=#FFFF00]" + itemSeedEnd + "[/color]", "[Auto Farmer]");
Log("[color=#737CA1]Total Items: [/color][color=#FFFF00]" + itemEnd + "[/color]", "[Auto Farmer]");
Log("[color=#87AFC7]========================[/color]", "[Auto Farmer]");
//===========================================================================================
} else {
//===== Always plant seeds in bag even if labor is not 2000. Since it doesn't require labor to plant. ====================
PlantItemsAtFarm("Azalea Seed", 26346);
Log("Labor under 2000, waiting to regen");
}
//====== Anti-AFK code makes sure you never get auto disconnected by the server ================================
UpdateNoAfkState();
Turn(0.05, true);
Thread.Sleep(200);
//====== End of Anti-AFK code ======================================================================
// ===== Just some log stuff don't need to mess with this part of the code ========================================
//Log("\n[color=#87AFC7]=====================================[/color]", "[Auto Farmer]");
Log("[color=#FF3300]Nothing to do...[/color]", "[Auto Farmer]");
Log("[color=#00FF00]Waiting for " + s.ToString() + " seconds[/color]", "[Auto Farmer]");
Log("[color=#87AFC7]========================/color]", "[Auto Farmer]");
// ============================================================================================
Thread.Sleep(ms);
}
}
}
}