WORLD FARMER - AN OPEN WORLD FARM PLUGIN
I did this plugin as an learn by doing project.
INFO:
My Patron has run out and I don't feel this game is worth the money. Not right now anyway.
My friends play other games and I will be looking for new titles.
If anyone is interested to keep this World Farmer plugin alive PM me.
Its open code so I guess anyone could just copy it but I feel its better if I give the "rights" to one person,
else there could be more than one plugin on the forum with the same codebase.
Please PM me with some information about your coding knowledge if you are interested.
I want to make it very clear that I don't do this with the intention to make money and I will newer ask for donations, but for you who asked for a donation button I have added one in the bottom of this post.
Now you can buy me a cup of coffee
I have added a setting section to the top of the code that I hope will make it easier for everyone to change crops.
What this plugin does:
This is for open world farming, not scarecrow farms.
Find yourself a quiet place anywhere out in the world and start the plugin.
It plants crops and collects them, again and again and again until you run out of seeds or labor points.
Things to change:
The seeds is set to Azalea Seeds - Change this to whatever you want.
The harvestable crop is Azalea since im farming in Temperate climate if your not in temperate you would change this to "Mature Azalea" - Change this to suit your crop.
The planting zone is set to 10 - Change to what you want.
The farming zone is set to 20 - Change to what you want.
Release Log:
Version 0.4 = Redone code. It works better for seeds. since they are 1 skill doodas. For trees and animals it uses the first skill. I will soon post a test version with skill priorities. (Now to be found in post #84)
Verision 0.3 = Found a few mistakes in the code. I have corrected them but still having an issue in the loop. Make sure you match everything in the Settings to names in game.
Version: 0.2 = Added a checkbox [Plant]
If its checked it will plant crops. Its good to have the options to just gather or if you want to close the bot after all crops is gathered.
Version: 0.1 = Release
If you want to buy me a cup of coffee:
Or something to keep my wife away from the computer
I did this plugin as an learn by doing project.
INFO:
My Patron has run out and I don't feel this game is worth the money. Not right now anyway.
My friends play other games and I will be looking for new titles.
If anyone is interested to keep this World Farmer plugin alive PM me.
Its open code so I guess anyone could just copy it but I feel its better if I give the "rights" to one person,
else there could be more than one plugin on the forum with the same codebase.
Please PM me with some information about your coding knowledge if you are interested.
I want to make it very clear that I don't do this with the intention to make money and I will newer ask for donations, but for you who asked for a donation button I have added one in the bottom of this post.
Now you can buy me a cup of coffee
I have added a setting section to the top of the code that I hope will make it easier for everyone to change crops.
What this plugin does:
This is for open world farming, not scarecrow farms.
Find yourself a quiet place anywhere out in the world and start the plugin.
It plants crops and collects them, again and again and again until you run out of seeds or labor points.
Things to change:
The seeds is set to Azalea Seeds - Change this to whatever you want.
The harvestable crop is Azalea since im farming in Temperate climate if your not in temperate you would change this to "Mature Azalea" - Change this to suit your crop.
The planting zone is set to 10 - Change to what you want.
The farming zone is set to 20 - Change to what you want.
Release Log:
Version 0.4 = Redone code. It works better for seeds. since they are 1 skill doodas. For trees and animals it uses the first skill. I will soon post a test version with skill priorities. (Now to be found in post #84)
Verision 0.3 = Found a few mistakes in the code. I have corrected them but still having an issue in the loop. Make sure you match everything in the Settings to names in game.
Version: 0.2 = Added a checkbox [Plant]
If its checked it will plant crops. Its good to have the options to just gather or if you want to close the bot after all crops is gathered.
Version: 0.1 = Release
Code:
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.4";
}
public static string GetPluginDescription()
{
return "World Farmer";
}
//----------------SETTINGS------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////////////////////
// NAME OF THE SEED YOU WANT TO PLANT. THIS MUST BE EXACTLY AS YOU SE IT IN GAME. //
///////////////////////////////////////////////////////////////////////////////////////////////
public string seedchoice = "Azalea Seed";
public int Garea = 25; // size of Gathering area
public int Parea = 6; // size of planting area
//---------------DONT CHANGE ANYTHING BELOW THIS LINE---------------------------------------------
public uint skill;
public int gtime;
public string descr;
public string name;
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.uniqOwnerId == me.uniqId)
{
if (Obj.growthTime < 1)
{
dood = Obj;
dist = me.dist(Obj);
gtime = Obj.growthTime;
}
}
}
return dood;
}
public void PluginRun()
{
RoundZone Gzone = new RoundZone(me.X, me.Y, Garea); //Make new gather zone.
RoundZone Pzone = new RoundZone(me.X, me.Y, Parea); //Make new plant zone.
SetGroupStatus("Farm", false); //Add checkbox to our character widget
while (true)
{
if (GetGroupStatus("Farm"))
{
DoodadObject bestdood = null;
bestdood = GetBestNearestdood(Gzone);
if (bestdood != null)
{
while (GetGroupStatus("Farm") && bestdood != null)
{
var skills = bestdood.getUseSkills();
if (skills.Count > 0)
{
skill = skills[0].id;
descr = skills[0].desc;
name = skills[0].name;
CollectItemsInZone(bestdood.name, skill, Gzone);
bestdood = GetBestNearestdood(Gzone);
}
Thread.Sleep(50);
}
Thread.Sleep(50);
}
PlantItemsInZone(seedchoice, Pzone);
Thread.Sleep(50);
}
Thread.Sleep(50);
}
Thread.Sleep(50);
}
}
}
If you want to buy me a cup of coffee:

Last edited: