white_boy8869
Member
- Joined
- Feb 27, 2012
- Messages
- 255
- Reaction score
- 3
Respect and appreciation! Thanks for sharing and contributing to this community again!
got it to work TY!!!
Could you post the code for the Cherry Sapling? I can't seem to get mine to work.
I don't think that is needed. I could be wrong but I don't even see any Azalea item IDs in the code given, so where would I input that Cherry Sapling ID into? I have used Archeage Database 1.2 previously for item IDs but I don't think one is needed in this case.
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.3";
}
public static string GetPluginDescription()
{
return "World Farmer";
}
//----------------SETINGS----------------------
///////////////////////////////////////////////////////////////////////////////////////////////
// NAME OF THE SEED YOU WANT TO PLANT. THIS MUST BE EXACTLY AS YOU SE IT IN GAME. //
///////////////////////////////////////////////////////////////////////////////////////////////
public string seedchoice = "Carrot Seed";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NAME OF THE PLANT WHEN ITS READY FOR HARVEST. //
// TIPP: PLANT ONE SEED IN THE CLIMATE YOU WILL USE IT IN. WAIT UNTIL READY AND YOU WILL SE THE CORRECT NAME //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public string readyplant = "Carrot";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// THE EXACT DESCRIPTION YOU'LL SE WHEN YOU MOUSE OVER THE SKILL BUTTON IN GAME OF THE SKILL YOU WANT TO USE //
// TIPP: PLANT ONE SEED IN THE CLIMATE YOU WILL USE IT IN. WAIT UNTIL READY AND YOU WILL SE THE CORRECT NAME //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public string description = "Gathering: Spend 1 Labor to gather materials.";
//"Farming: Spend 1 Labor to harvest crops.";
public int Garea = 20; // size of Gathering area
public int Parea = 10; // size of planting area
//---------------DONT CHANGE ANYTHING BELOW THIS LINE-----------------------------------------------------------------------------
//Try to find Doodad in farm zone.
public DoodadObject GetBestNearestdood(Gzone)
{
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)
{
if (Obj.uniqOwnerId == me.uniqId)
{
dood = Obj;
dist = me.dist(Obj);
}
}
}
return dood;
}
public void PluginRun()
{
RoundZone Gzone = new RoundZone(me.X, me.Y, Gzone); //Make new gather zone.
RoundZone Pzone = new RoundZone(me.X, me.Y, Gzone); //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"))
{
Log("Checkbox Farm is enabled in widget");
DoodadObject bestdood = null;
bestdood = GetBestNearestdood(Gzone);
if (bestdood != null)
{
Log("Found: " + bestdood.name + " to harvest.");
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(Carrot, 7998, Gzone);
bestdood = GetBestNearestdood(Gzone);
}
}
catch {}
}
else
{
if (GetGroupStatus("Plant"))
{
Log("Checkbox Plant is enabled in widget");
bestdood = GetBestNearestdood(Gzone);
try
{
while (GetGroupStatus("Plant"))
{
PlantItemsInZone("Carrot Seed", Pzone);
bestdood = GetBestNearestdood(Pzone);
Log("bestdood: " +bestdood.name);
}
}
catch {}
}
}
Log("Waiting 10 seconds before checking For New plants to harvest");
Thread.Sleep(10000);
}
// Processor delay
Thread.Sleep(10);
}
}
}
}
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.3";
}
public static string GetPluginDescription()
{
return "World Farmer";
}
//----------------SETINGS----------------------
///////////////////////////////////////////////////////////////////////////////////////////////
// NAME OF THE SEED YOU WANT TO PLANT. THIS MUST BE EXACTLY AS YOU SE IT IN GAME. //
///////////////////////////////////////////////////////////////////////////////////////////////
public string seedchoice = "Cherry Sapling";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NAME OF THE PLANT WHEN ITS READY FOR HARVEST. //
// TIPP: PLANT ONE SEED IN THE CLIMATE YOU WILL USE IT IN. WAIT UNTIL READY AND YOU WILL SE THE CORRECT NAME //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public string readyplant = "Young Cherry Tree";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// THE EXACT DESCRIPTION YOU'LL SE WHEN YOU MOUSE OVER THE SKILL BUTTON IN GAME OF THE SKILL YOU WANT TO USE //
// TIPP: PLANT ONE SEED IN THE CLIMATE YOU WILL USE IT IN. WAIT UNTIL READY AND YOU WILL SE THE CORRECT NAME //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public string description = "Uproot: Spend 10 Labor to uproot a target.";
//"Farming: Spend 1 Labor to harvest crops.";
public int Garea = 100; // size of Gathering area
public int Parea = 100; // size of planting area
//---------------DONT CHANGE ANYTHING BELOW THIS LINE-----------------------------------------------------------------------------
//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 == readyplant)
{
if (Obj.uniqOwnerId == me.uniqId)
{
dood = Obj;
dist = me.dist(Obj);
}
}
}
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
SetGroupStatus("Plant", false); //Add checkbox to our character widget
while (true)
{
//If Farm checkbox is enabled
if (GetGroupStatus("Farm"))
{
Log("Checkbox Farm is enabled in widget");
DoodadObject bestdood = null;
bestdood = GetBestNearestdood(Gzone);
if (bestdood != null)
{
Log("Found: " + bestdood.name + " to harvest.");
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(readyplant, description, Gzone);
bestdood = GetBestNearestdood(Gzone);
}
}
catch {}
}
else
{
if (GetGroupStatus("Plant"))
{
Log("Checkbox Plant is enabled in widget");
bestdood = GetBestNearestdood(Gzone);
try
{
while (GetGroupStatus("Plant"))
{
PlantItemsInZone(seedchoice, Pzone);
bestdood = GetBestNearestdood(Gzone);
Log("bestdood: " +bestdood.name);
}
}
catch {}
}
}
Log("Waiting 10 seconds before checking For New plants to harvest");
Thread.Sleep(10000);
}
// Processor delay
Thread.Sleep(10);
}
}
}
}
Follow this:How do i run this plugin?
I dont know how to install, someone help plz.
You can use build-in editor to make simple plugins.
For this - open build-in editor (Its called Plugin editor), from tray menu or Logs window Menu.
Create new file and save him to new sub folder in Archebuddy Plugins folder (for example - D:\Games\Archebuddy\Plugins\MyFirstPlugin\1.cs).
Write your code.
Click "Compile" button. Below in log window you will see result of compilation, is there error or no.
If all good - compiled plugin (.dll) you can find in Plugin Manager when you game account ingame.
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);
}
}
}
Can anyone try my new code and comment. Its made for seeds.
I have not tried it with saplings.
It checks for everything im the owner of in the zone, then uses the first available skill on that doodad.
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); } } }