using System;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace YourNamespace
{
public class YourClass : Core
{
public static string GetPluginAuthor()
{
return "Biocide";
}
public static string GetPluginVersion()
{
return "0.2";
}
public static string GetPluginDescription()
{
return "World Farmer";
}
//Try to find Doodad in farm zone.
public DoodadObject GetBestNearestdood(Zone zone)
{
DoodadObject dood = null;
double dist = 999999;
foreach (var Obj in getDoodads())
{
//If there is any Doodads that we looking for in this zone
if (Obj.name == "Carrot") <--- changed
{
dood = Obj;
dist = me.dist(Obj);
}
}
return dood;
}
public void PluginRun()
{
RoundZone Gzone = new RoundZone(me.X, me.Y, 20); //Make new gather zone.
RoundZone Pzone = new RoundZone(me.X, me.Y, 7); //Make new plant zone.
SetGroupStatus("Farm", false); //Add checkbox to our character widget
SetGroupStatus("Plant", false); //Add checkbox to our character widget
while (true)
{
//If Farm checkbox is enabled
if (GetGroupStatus("Farm"))
{
DoodadObject bestdood = null;
bestdood = GetBestNearestdood(Gzone);
if (bestdood != null)
{
try
{
//while there is any desired Doodads in zone and checkbox in widget enabled
while (bestdood != null && GetGroupStatus("Farm"))
{
// Log("Distance: " +me.dist(bestdood)+ "m"); // Just for debuging
//CollectItemsInZone("Azalea", "Gathering: Spend 1 Labor to gather materials.", Gzone); <--- added the //
CollectItemsInZone("Carrot", "Farming: Spend 1 Labor to harvest crops.", Gzone); <----changed
}
}
catch {}
}
else
{
if (GetGroupStatus("Plant"))
{
PlantItemsInZone("Carrot Seed", Pzone); <---changed this
}
}
}
// Processor delay
Thread.Sleep(10);
}
}
}
}
first time its worked then nothing. I have around 500 labor and 150 seed. I would use the same spot as before, and the char is just stand there and nothing.