What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Need some help with WorldFarmer

Status
Not open for further replies.

TheEnd

Member
Joined
Oct 21, 2014
Messages
121
Reaction score
0
Hi,

I'm using WorldFarmer (here) to plant and harvest from illegal farms. I have multiple accounts & characters I'm using to gather/plant a single farm for my own gains.

I want to use WorldFarmer to gather (for example) carrots from character A. Character A plants 500 carrots. The maturing time passes (25 minutes) and then the carrots are ready for harvest. I set character B to gather those carrots. My issue is that character B is not gathering from character A's crops. How come? Any way to fix this?

I'm using the following code (from post #84 on the WorldFarmer thread):
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 WorldFarmer
{
    public class WorldFarmer : Core
    {
        public static string GetPluginAuthor()
        {
            return "Biocide";
        }
        public static string GetPluginVersion()
        {
            return "0.5";
        }
        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 = "Barley Seed";
 
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////      
        //    PRIORITIZE SKILLS TO USE . FOR EXAMPLE IF YOU WANT TO PICK CHERRY:                                          //
        //    PRIO1 = FIND FRUIT IF YOU WANT TO CUT DOWN THE TREE AFTER YOU SET PRIO2 = Chop Tree                         //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
       
        //------------LIST OF SKILLS-------------//  [I NEED MORE INFO ABOUT THE SKILLS THATS AVAILABLE]
        // Gather = Plants like Azalea
        // Harvest
        // Find Fruit = Cherry Trees, Appel Trees
        // Feed = Feed animals
        // Water Plant = Water plants
        // Gather Eggs from Livestock = Gather Eggs from Hens
        public string SkillPrio1 = "Gather";
        public string SkillPrio2 = "Harvest";
        public string SkillPrio3 = "Find Fruit";
        
        
        public int Garea = 20; // size of Gathering area
        public int Parea = 6;  // size of planting area
//---------------DONT CHANGE ANYTHING BELOW THIS LINE-----------------------------------------------------------------------------
        
 
 

        public uint Sid;
        public string Sdesc;
        public string Sname;
        public int Scount;
        public string Sprio;
        public int AFKcount;
        

        public DoodadObject GetBestNearestdood(Zone zone)
        {
            DoodadObject dood = null;
            foreach (var Obj in getDoodads())
            {
                var skills = Obj.getUseSkills();
                if (Obj.uniqOwnerId == me.uniqId && skills.Count > 0)
                {
                    //Log(Obj.name);
                    if (skills.Count > 2)
                    {
                        Scount = 3;
                        if (skills[0].name == SkillPrio1 || skills[1].name == SkillPrio1 || skills[2].name == SkillPrio1)
                        {
                            Sprio = SkillPrio1;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio2 || skills[1].name == SkillPrio2 || skills[2].name == SkillPrio2)
                        {
                            Sprio = SkillPrio2;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio3 || skills[1].name == SkillPrio3 || skills[2].name == SkillPrio3)
                        {
                            Sprio = SkillPrio3;
                            dood = Obj;
                        }
                    }
                    else if (skills.Count == 2)
                    {
                        Scount = 2;
                        if (skills[0].name == SkillPrio1 || skills[1].name == SkillPrio1)
                        {
                            Sprio = SkillPrio1;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio2 || skills[1].name == SkillPrio2)
                        {
                            Sprio = SkillPrio2;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio3 || skills[1].name == SkillPrio3)
                        {
                            Sprio = SkillPrio3;
                            dood = Obj;
                        }
                    }
                    else if (skills.Count == 1)
                    {
                        Scount = 1;
                        if (skills[0].name == SkillPrio1)
                        {
                            Sprio = SkillPrio1;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio2)
                        {
                            Sprio = SkillPrio2;
                            dood = Obj;
                        }
                        else if (skills[0].name == SkillPrio3)
                        {
                            Sprio = SkillPrio3;
                            dood = Obj;
                        }
                    }
                }
                Thread.Sleep(50);
            }
            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("Gather", true); //Add checkbox to our character widget
            SetGroupStatus("Plant", true); //Add checkbox to our character widget
            
            while (true)
            {
                DoodadObject bestdood = null;
                bestdood = GetBestNearestdood(Gzone);
                if (bestdood != null && GetGroupStatus("Gather"))
                {
                    var skills = bestdood.getUseSkills();
                    if (Scount > 2)
                    {
                        if (skills[0].name == Sprio)
                        {
                            while (skills[0].name == Sprio && bestdood != null && GetGroupStatus("Gather"))  
                            {
                                CollectItemsInZone(bestdood.name, skills[0].desc, Gzone);
                                Thread.Sleep(50);
                            }
                        }
                        else if (skills[1].name == Sprio)
                        {
                            while (skills[1].name == Sprio && bestdood != null && GetGroupStatus("Gather"))
                            {
                                CollectItemsInZone(bestdood.name, skills[1].desc, Gzone);
                                Thread.Sleep(50);
                            }
                        }
                        else if (skills[2].name == Sprio)
                        {
                            while (skills[2].name == Sprio && bestdood != null && GetGroupStatus("Gather"))
                            {
                                CollectItemsInZone(bestdood.name, skills[2].desc, Gzone);
                                Thread.Sleep(50);
                            }
                        }
                    }
                    if (Scount == 2)
                    {
                        if (skills[0].name == Sprio)
                        {
                            while (skills[0].name == Sprio && bestdood != null && GetGroupStatus("Gather"))
                            {
                                CollectItemsInZone(bestdood.name, skills[0].desc, Gzone);
                                Thread.Sleep(50);
                            }
                        }
                        else if (skills[1].name == Sprio)
                        {
                            while (skills[1].name == Sprio && bestdood != null && GetGroupStatus("Gather"))
                            {
                                CollectItemsInZone(bestdood.name, skills[1].desc, Gzone);
                                Thread.Sleep(50);
                            }
                        }
                    }
                    
                    if (Scount == 1)
                    {
                        if (skills[0].name == Sprio)
                        {   
                            while (skills[0].name == Sprio && bestdood != null && GetGroupStatus("Gather"))
                            {
                                CollectItemsInZone(bestdood.name, skills[0].desc, Gzone);
                                bestdood = GetBestNearestdood(Gzone);
                                Thread.Sleep(50);
                            }
                        }
                    }
                }
                else if (GetGroupStatus("Plant"))
                {
                    while (GetGroupStatus("Plant"))
                    {
                        bestdood = GetBestNearestdood(Gzone);
                        if (bestdood != null)
                        {
                            break;
                        }
                        PlantItemsInZone(seedchoice, Pzone);
                        Thread.Sleep(10);
                        if (bestdood == null && AFKcount == 100)
                        {
                            Jump(true);
                            Thread.Sleep(50);
                            Jump(false);
                            AFKcount = 0;
                        }
                        AFKcount = AFKcount + 1; 
                    }
                }
                Thread.Sleep(50);
                if (bestdood == null && AFKcount == 100)
                {
                    Jump(true);
                    Thread.Sleep(50);
                    Jump(false);
                    AFKcount = 0;
                }
                AFKcount = AFKcount + 1;   
        }
        }
    }
}

I believe this might have something to do with the plugin checking for ownership of said crops. Is there anyway to disable or bypass that?

Most of the crops I am harvesting from have exceeded the "ownership" period (since they are planted on public land) and are considered "public" crops (no ownership -> no warning message when attempting to harvest). So, technically there are no owners of these crops, and the plugin should gather from them, correct?
 
Last edited:
Status
Not open for further replies.
Back
Top