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

[Plugin] FarmMonkey: Continuous Multi Farm Harvest & Planting Plugin

Hi Im new here and about this plugin thing.. If its ok for you to help me.Just a quick question is this plugin capable of planting only not harvesting?like manually moving it to farm then plant?and if so how? coz im kinda lost.and also if its capable of going to own farm?i own 21 gazebo in seperate place but same housing area.thanks a bunch in advance!


My plugin works best with farms right next to each other. anything past 100 meters gets lost. This plugin supports properties farther away than that.
https://www.thebuddyforum.com/arche...to-farming-plugin-farmid-auto-assignment.html

I am working on it, but it's taking longer than planned due to the nature of my employment.
 
Ok thanks.But i only need auto planting how to set it up?i can manually move the character on the farm?and how to get the farmID?and also do i need to place the charcter on what part of the land?like lower left?upper right ? upper left or lower right?im sorry if i got lots of question im not that techie.thanks in advance.
 
Hi,

I having some problems with the FarmMonkey planting and harvesting garlic in Mahadevi. Is there a Problem if it is not the ideal planting area to use the FarmMonkey?
 
Hi,

I having some problems with the FarmMonkey planting and harvesting garlic in Mahadevi. Is there a Problem if it is not the ideal planting area to use the FarmMonkey?
Area shouldn't matter, make sure all strings are exactly as they appear in-game.
 
hello guys i just format my pc and now i cant use the monkey farm i cant compile any ideas it say the the file im trying to compile ther s no pluging for it can u guys help me pls
 
hello guys i just format my pc and now i cant use the monkey farm i cant compile any ideas it say the the file im trying to compile ther s no pluging for it can u guys help me pls

you can't get it to compile can you get any plugin to compile ?

do you have all the dotnet packagges installed ?
 
you can't get it to compile can you get any plugin to compile ?

do you have all the dotnet packagges installed ?


ummm i dont think so in my other computer its working fine but this 1 i copy the defult dll from my other comp but still it keep saying the massage
 
Is it possible to change the code to work with saplings? trees for logging?
 
yayaya yes you can change what it will plant and harvest.

Sidwickness the problem with bundles as far as i know is an api thing mostly although some people say it works in old scarecrow if you set settings for type etc a certain way. Never works for me though so hard to say if you can set it in this plugin you can try it and see.
 
I havn't been on here for a long time but was asked about my latest version of this. I pulled this from my dev folder. As for support this community is amazing, but odds are i will not be around often and prolly gone for months at a time.


Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;

///
//
// Special Thanks to Voyager92 for a really Epic Non-Stop Farm/Gathering Base from which I am building this on. 
// Thread:  [Plugin] Non-Stop Farm/Gathering for multiple toons/farms and with restart support
//
///

namespace ArcheAgeFarmMonkey
{
    public class FarmMonkey : Core
    {
        public static string GetPluginAuthor()
        { return "Defectuous"; }
        public static string GetPluginVersion()
        { return "1.1.10.13"; }
        public static string GetPluginDescription()
        { return "FarmMonkey: Continuous Multi Farm Harvest & Planting Plugin"; }
        
        // START Universal Config
        
        string _seed     = "Aloe Seed"; // Seeds to plant
        string _plant    = "Aloe"; // Make sure plant ends up Mature or just the plant name
        string _seedling = "Aloe Seedling";
        uint[] _farms = { 12345, 54321 }; // Gather Farm ID's wtih scarecrow { 12345, 54321 }
        private bool _oldtimer = false; // To enable the older timer rather than plant timers
        
        // Tweak as necessary 
        int _minlabor = 200;  // Minimum Labor for harvesting.

        // Note: You may need to update the Amount of labor needed for Gathering & Harvesting.
        string _gather  = "Gathering: Spend up to 3 Labor to gather materials.";
        string _harvest = "Farming: Spend up to 3 Labor to harvest crops.";
        
        // to enable only Planting or Harvesting. Both enabled by default.
        private bool _enableharvest = false;
        private bool _enableplant = true;
        
        // Buy Section
        private bool _enablebuyseed = false; // To buy Seeds you need a gps point called Seed
        string _buyvendor = "Vendor Name"; //Buy Vendor Name
        int _mingold      = 50000;   // 50000 = 5Gold 00Silver 00Copper
        int _minseed      = 50; // Minimum Seed Count before purchasing more
        int _maxseed      = 1000; // Maximum number of seeds to have at a time        
        
        
        // Enable Doors
        private bool _enabledoor = false; // Set to true if youe safe Zone requires you to go through a door & you have door0 & door1 set in the gps file
        
        // Rest Section
        private bool _enablerest = false; // Enable to sit in chair or lay in bed
        string _restitem = "Chair"; // Name of Chair or bed 
        string _resttext = "Sit in a chair or lay on a bed.";
        
        // Mail Functions ( Will not send money )
        private bool _enablemail = false; // Enable to send mail
        public bool _fastmail = true; // To send with fast mail rather then slow
        string _mailto   = "Null"; // Name to who your mail will go to
        string _mailsub  = "For Processing"; // Subject of that mail
        string _mailtext = "From Farming"; // Mail Body Required
        int _amtmail     = 1000; // When your inventory reaches this amount it will mail at the end of the harvest.
        
        // This gps file needs the following points Safe, Farm, Seed, Mail
        string _gpsfile = "\\plugins\\FarmMonkey\\Path\\file.db3";
        
        // Set to true if you have a gps file for moveing to and from the safe, mail, buy, farm.
        private bool _enablegps = false;
        private bool _deathcheck = false;
        
        // do not change this unless you plan to lower it
        int _buyseedamt = 100; // Do not raise this above 100
        // END Universal Config 
        // ( Do Not Edit anything past this line unless you are confident you know what your doing !!! )
        
        // Universal Application Information

        private Gps gps;
        Random random = new Random();
        
        //Call on plugin start
        public void PluginRun()
        {
            ClearLogs();
            Log(Time() + "[ FarmMonkey: Plugin Started ]");
            Log(Time() + "How to Read Farm Monkey logging.");
            Log(Time() + "[INFO] Equals relivant information ");
            Log(Time() + "[WARN] Needs to be Looked into, not bot threatening. ");
            Log(Time() + "[ERROR] Bada Bad, post error message forums tob e resolved. ");
            
            while (true) {
                if (gameState == GameState.Ingame){
                    // Start Threads here ( farming & movement )
                    Log(Time() + "Lets Start Farming");

                    // Death Check ( Am i really dead ? )
                    if ( _enablegps == true && _deathcheck == true && !me.isAlive()){ 
                        Log(Time() + "[WARN] We have died, there must be a reason for this check into that would you ]");
                        
                        // Res timer is Buggy due to continued deaths raises the time
                        Log(Time() + "[INFO] Waiting 18 Seconds to resurection");
                        
                        Thread.Sleep(18000);
                        
                        ResToRespoint();
                        Log(Time() +  "[INFO] Time to Ressurect");
                        while (!me.isAlive()){
                            Log(Time() + "[INFO] Waiting 8 seconds to try again");
                            Thread.Sleep(8000);
                            ResToRespoint();
                         }
                        MoveToSafe();
                    }  
                    // Lets get back to the Farms
                    if (_enablegps == true && me.isAlive()){ MoveToFarm(); }else{Log(Time() + "[INFO] GPS DISABLED MoveToFarm"); }
                    
                    // Time to Harvest plants
                    if (_enableharvest == true){ Harvesting(); }else{Log(Time() + "[INFO] _enableharvest Set to False"); }
                    
                    // Mail Function
                    if (_enablemail == true && _enablegps == true){ Mailer(); }else{Log(Time() + "[INFO] _enablemail Set to False"); }
                    
                    // Buy Seeds before planting
                    if (_enablebuyseed == true && _enablegps == true){ BuySeeds(); }else{Log(Time() + "[INFO] _enablebuyseed Set to False"); }
                    
                    // Lets fill that field with seeds
                    if (_enableplant == true){ Planting(); }else{Log(Time() + "[INFO] _enableplant Set to False"); }
                    
                    // Time to head back to the safe spot
                    if (_enablegps == true){ MoveToSafe(); }else{Log(Time() + "[INFO] GPS DISABLED MoveToSafe"); }
                    
                    Stock();
                    Timer();
                }
            }
        }

        // Moving Routines
        public void MoveToFarm()        
        {         
           gps = new Gps(this);
           Log(Time() + "Loading GPS File"); 
           gps.LoadDataBase(Application.StartupPath + _gpsfile); 
           //
           if (_enabledoor == true){
            Log(Time() + "We need to Open / Close the Door");
            gps.GpsMove("Door1");
            // Time to Open the Door
            DoodadObject doors = getNearestDoodad("Door");
            Log(Time() + "[ INFO: " + string.Format("Name: {0} - ID: {1}", doors.name, doors.phaseId) + " ]");
            if (doors != null && ComeTo(doors, 2))
                {
                    if (doors.phaseId == 11163)
                        {
                            UseDoodadSkill(16828, doors);
                            Thread.Sleep(1000);
                            gps.GpsMove("Door0");
                        } else { gps.GpsMove("Door0"); }
                        // Time to Close the Door
                        if (doors.phaseId == 11165)
                    {
                        UseDoodadSkill(16828, doors);
                        Thread.Sleep(1000);
                    }
                }
        }
           //
           Log(Time() +  "Moving to Farm");
           gps.GpsMove("Farm");                
        }
        
        public void MoveToSafe()        
        {         
            gps = new Gps(this); 
            Log(Time() + "Loading GPS File"); 
            gps.LoadDataBase(Application.StartupPath + _gpsfile);
            if (_enabledoor == true){
            Log(Time() + "We need to Open / Close the Door");
            gps.GpsMove("Door0");
            // Time to Open the Door
            DoodadObject doors = getNearestDoodad("Door");
            Log(Time() + "INFO: " +  string.Format("Name: {0} - ID: {1}", doors.name, doors.phaseId));
            if (doors != null && ComeTo(doors, 2))
                {
                    if (doors.phaseId == 11163)
                        {
                            UseDoodadSkill(16828, doors);
                            Thread.Sleep(1000);
                            gps.GpsMove("Door1");
                        } else { gps.GpsMove("Door1"); }
                    // Time to Close the Door
                    if (doors.phaseId == 11165)
                    {
                        UseDoodadSkill(16828, doors);
                        Thread.Sleep(1000);
                    }
            }
            //
            Log(Time() + "Moving to Safe");
            gps.GpsMove("Safe");
            Log(Time() +  "Safe Spot has been Reached");           
            if (_enablerest == true){ 
                Relax();
                Log(Time() +  "Rest Time");
            }
            }else{Log(Time() + "INFO: _enabledoor Set to False");}  
        }
       
       // Farming Routines
        public void Harvesting()
        {
            var _labor = me.laborPoints;
            if (_labor > _minlabor){
                Log(Time() + "Current Labor:" + _labor);
                foreach (uint farm in _farms){
                    Log(Time() + "Harvesting " + _plant + "(s) on FarmID: " + farm);
                    CollectItemsAtFarm(_plant, _gather, farm);
                    CollectItemsAtFarm(_plant, _harvest, farm);
                    } 
                }else{ Log(Time() + "INFO: Your Labor is under " + _minlabor); }
        }

        public void Planting()
        {
            var seedcount = itemCount(_seed);
            if ( seedcount == 0){
                Log(Time() + "INFO: You have no seeds!");
                } else{
                    foreach (uint farm in _farms)
                    {
                        
                        var seedcount2 = itemCount(_seed);
                        Log(Time() + _seed + " Count: " + seedcount2);
                        Log(Time() +  "Planting " + _seed + "(s) on FarmID: " + farm);
                        SetPlantMotionType(PlantMotionType.Standart);
                        PlantItemsAtFarm(_seed, farm);
                        //MoveToFarm();
                    }
                }
        }
        
        // Utility Stuff
        public void BuySeeds()
        {
            while (true){
                
                var _mygold   = me.goldCount;
                var seedcount = itemCount(_seed);
                if (_mygold <= _mingold){ 
                    Log(Time() + "INFO: Unable to Purchase due to lack of funds"); 
                    break;
                    } else {
                        Log(Time() + "Lets go buy seeds");
                        gps = new Gps(this); 
                        gps.LoadDataBase(Application.StartupPath + _gpsfile); 
                        gps.GpsMove("Seed");
                        SetTarget(_buyvendor);
                        Log(Time() + "Seed Stock: " + seedcount);
                        if ( seedcount <= _minseed && seedcount <= _maxseed){
                            BuyItems(_seed, _buyseedamt);
                            var seedcount2 = itemCount(_seed);
                            Log(Time() + "Updated Seed Cound: " + seedcount2);
                            
                            var mseconds = random.Next(2000, 5000);
                            var seconds  = mseconds / 1000;
                            Log(Time() +  "Checking seed stock");
                            Thread.Sleep(mseconds);
                        
                        } else {
                            Log(Time() + "[ Seed Purchase Completed ]");
                            break;
                    }
                }
            }
        }
        
        public void Mailer()
        {
            Log(Time() + "[ Starting the Mail Process ]");
            gps = new Gps(this); 
            gps.LoadDataBase(Application.StartupPath + _gpsfile); 
            Log(Time() + "INFO: Moving to Mailbox");
            gps.GpsMove("Mail");
            List<Item> mailitems = new List<Item>();
                {
                    List<Item> Inventory = getInvItems(_plant);
                    foreach (Item item in Inventory)
                    {
                        if (mailitems.Count <= 8)
                        break;
                        mailitems.Add(item);
                        
                    }
                }
                var mailcount = itemCount(_plant);
            
            if (mailcount >= _amtmail){
                Log(Time() + "INFO: Sending " + _plant + " to " + _mailto);
                    SendMail( _mailto, _mailsub, _mailtext, _fastmail, 0, mailitems);

                }else{
                    Log(Time() + "[ Mail Processes Finished ]");
                }
        }
            
        public void Relax()
        {
            DoodadObject restspot;
            restspot = getNearestDoodad(_restitem);
            UseDoodadSkill(_resttext, restspot, true, 0);
        }
        
        public void Timer()
        {
            if ( _oldtimer == true ){
                //  Temporary Sleep to prevent to many checks
                var mseconds = random.Next(240, 300) * 1000;        
                var seconds  = mseconds / 1000;     
                Log(Time() +  "INFO: Waiting " + seconds.ToString() + " seconds to check seeds");     
                Thread.Sleep(mseconds); 
                }else{
                    var plants      = getNearestDoodad(_seedling);    
                    var seconds     = (plants.growthTime); // Gives time in seconds
                    var minutes     = (seconds / 60); // Turns it into Minutes
                    var mseconds    = (seconds * 1000); // Turns it into Miliseconds 
                    var addmseconds = random.Next(60,180) * 1000; // Adding in some random time to look more human
                    var finaltime   = (mseconds + addmseconds); // It's the Final Countdown ( Insert Music !!!!)
                    var logtime     = (finaltime / 1000);
                    
                    Log(Time() + "INFO: Plant Growth Time: " + minutes + " Minutes");
                    Log(Time() + "INFO: Resting " + (logtime / 60) + " Minutes");
                    Thread.Sleep(finaltime);
                }
        }

        public string Time()
        {
            string A = DateTime.Now.ToString("[hh:mm:ss] ");
            return A;
        }
    
        public void Stock()
            {
            var seedcount  = itemCount(_seed);
            var plantcount = itemCount(_plant);
        
            Log(Time() + "[ Farm Markey Inventory Update ]");
            Log(Time() + "INFO: " + _seed + " Count: " + seedcount);
            Log(Time() + "INFO: " + _plant + " Count: " + plantcount);


        }    
            
        //Call on plugin stop
        public void PluginStop()
        {
            Log(Time() + "[ FarmMonkey: Plugin Stopped ]");
        }
    }
}
 
Back
Top