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

[Plugin] Scarecrow Alternative

AtomicBomb

Member
Joined
Jul 31, 2011
Messages
112
Reaction score
4
The scarecrow plugin is pretty good but if you are like me and have multiple farm and you grew tired of using the interface every time you want to gather/plant then you need something that require less maintenance. Especially if you farm stuff that mature in 1hour or so.

So I came up with a little plugins of my own that allow me to easily and quickly change what I'm planting and collecting. Once it's setup the way you want you just start it and it will start working right away.

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

namespace ScarecrowAlternative {
    public class ScarecrowAlternative : Core {

        public void PluginRun() {

        	InitItemsList();

			// SetPlantAlgoritm(PlantAlgoritm.Randomized;
			SetPlantAlgoritm(PlantAlgoritm.MaxPerfomance);

			// Activate an infinite loop (true: activate, false: desactivate)
			bool UseLoop = false;
			// How long to wait after each loop in MS (milliseconds)
			int  LoopTime = 3600000;

			//  Create one or multiple group of farm
			//  Just replace the "11111" with your Farm ID
			//  Use the Scarecrow plugin to quickly find your Farm ID
			//  Example:
			List<uint> FarmGroup1 = new List<uint>();
			FarmGroup1.Add(11111);
			FarmGroup1.Add(11111);
			FarmGroup1.Add(11111);

			List<uint> FarmGroup2 = new List<uint>();
			FarmGroup2.Add(11111);
			FarmGroup2.Add(11111);

			// Create one or multiple group of item to collect/plant
			// Just enter the name of the item that are added at the bottom of this file
			// Take notice that you can't mix Plant/Tree with Animals so use seperate group.
			// Also, the first item you add will be the first item that will get processed.
			// Example:
			List<object> ItemGroup1 = new List<object>();
			ItemGroup1.Add(Pine);
			ItemGroup1.Add(Lavender);

			List<object> ItemGroup2 = new List<object>();
			ItemGroup2.Add(Sheep);
			ItemGroup2.Add(Hen);

			bool StopLoop = false;
			while (!StopLoop) {

				//  This is where you set which item to collect using which Farm Group and Item Group
				//  Use CollectItems for Plants/Tree and CollectAnimals for Animals
				//  Example:
				CollectItems(FarmGroup1, ItemGroup1);
				PlantItems(FarmGroup1, ItemGroup1);

				CollectItems(FarmGroup2, ItemGroup1);
				PlantItems(FarmGroup2, ItemGroup1);
				CollectAnimals(FarmGroup2, ItemGroup2);				

				if (UseLoop) {
					Thread.Sleep(LoopTime);
				} else {
					StopLoop = true;
				}

			}

		}

		//  If you want to add new item to gather/plant first create a new List<string> here
		//  Example if you want to add Aspen you would add this line:
		//  public List<string> Aspen = new List<string>();
		//  Then you would add to Aspen the corresponding string in the next block.
		 
		public List<string> Pine = new List<string>();
		public List<string> Cedar = new List<string>();
		public List<string> MapleWoodlot = new List<string>();

		public List<string> Mushroom = new List<string>();
		public List<string> Lavender = new List<string>();
		public List<string> Thistle = new List<string>();
		public List<string> Quinoa = new List<string>();

		public List<object> Sheep = new List<object>();
		public List<object> Hen = new List<object>();

		// This is where you add the string to a specific item
		// Example for Aspen:
		//  Aspen.Add("Aspen Tree"); (that's the name of the fully mature item)
		//  Aspen.Add("Logging: Spend up to 20 Labor to chop down a tree."); (that's the action required to use the fully mature item)
		//  Aspen.Add("Aspen Sapling") (that's the name of item that is used to plant it)
		//  Aspen.Add("Standart") (that's the motion type you want to use for this item)
		//  
		//  For animal it's a bit different but you should be able to figure it out by following how I did it for Sheep and Hen
		public void InitItemsList() {
			// Saplings
			Pine.Add("Pine Tree");
			Pine.Add("Logging: Spend up to 20 Labor to chop down a tree.");
			Pine.Add("Pine Sapling");
			Pine.Add("Standart");

			Cedar.Add("Cedar Tree");
			Cedar.Add("Logging: Spend up to 10 Labor to chop down a tree.");
			Cedar.Add("Cedar Sapling");
			Cedar.Add("Standart");

			// Woodlot
			MapleWoodlot.Add("Maple Woodlot");
			MapleWoodlot.Add("Logging: Spend up to 200 Labor to chop down a tree.");
			MapleWoodlot.Add("Maple Woodlot");
			MapleWoodlot.Add("SnakeFromBorder");

			// Seed
			Mushroom.Add("Mushroom");
			Mushroom.Add("Gathering: Spend 1 Labor to gather materials.");
			Mushroom.Add("Mushroom Spore");
			Mushroom.Add("Standart");

			Lavender.Add("Lavender");
			Lavender.Add("Gathering: Spend 1 Labor to gather materials.");
			Lavender.Add("Lavender Seed");
			Lavender.Add("Standart");

			Thistle.Add("Thistle");
			Thistle.Add("Gathering: Spend 1 Labor to gather materials.");
			Thistle.Add("Thistle Seed");
			Thistle.Add("Standart");

			Quinoa.Add("Quinoa");
			Quinoa.Add("Farming: Spend up to 3 Labor to harvest crops.");
			Quinoa.Add("Quinoa Seed");
			Quinoa.Add("Standart");

			// Livestock
			List<string> DiseasedSheep = new List<string>();
			List<string> HungrySheep = new List<string>();
			List<string> DyingSheep = new List<string>();
			List<string> NormalSheep = new List<string>();
			List<string> ThrivingSheep = new List<string>();
			DiseasedSheep.Add("Diseased Sheep");
			DiseasedSheep.Add("Husbandry: Spend 3 Labor and 1 Livestock Supplement to treat sick livestock.");
			HungrySheep.Add("Hungry Sheep");
			HungrySheep.Add("Husbandry: Spend 2 Labor and 1 Combined Feed to feed livestock.");
			NormalSheep.Add("Sheep");
			NormalSheep.Add("Husbandry: Spend 2 Labor and 1 Combined Feed to feed livestock.");
			ThrivingSheep.Add("Thriving Sheep");
			ThrivingSheep.Add("Husbandry: Spend up to 10 Labor to shear livestock.");
			DyingSheep.Add("Dying Sheep");
			DyingSheep.Add("Husbandry: Spend up to 10 Labor to shear livestock.");
			Sheep.Add(DiseasedSheep);
			Sheep.Add(HungrySheep);
			Sheep.Add(DyingSheep);
			Sheep.Add(NormalSheep);
			Sheep.Add(ThrivingSheep);

			List<string> NormalHen = new List<string>();
			List<string> ThrivingHen = new List<string>();
			NormalHen.Add("Hen");
			NormalHen.Add("Husbandry: Spend 1 Labor and 1 Ground Grain to feed livestock.");
			ThrivingHen.Add("Thriving Hen");
			ThrivingHen.Add("Husbandry: Spend up to 5 Labor to gather eggs.");
			Hen.Add(NormalHen);
			Hen.Add(ThrivingHen);
        }

		public void CollectItems(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<string> s in Items) {
					Log("-> Collect " + s[0]);
					CollectItemsAtFarm(s[0], s[1], f);
				}
			}
		}

		public void CollectAnimals(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<object> o in Items) {
					foreach(List<string> s in o) {
						Log("-> Collect " + s[0]);
						CollectItemsAtFarm(s[0], s[1], f);
					}
				}
			}
		}

		public void PlantItems(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<string> s in Items) {
					if (s[3] == "SnakeFromBorder") {
						SetPlantMotionType(PlantMotionType.SnakeFromBorder);
					} else if (s[3] == "Standart"){
						SetPlantMotionType(PlantMotionType.Standart);
					}
					Log("-> Plant " + s[2]);
					PlantItemsAtFarm(s[2], f);
				}
			}
		}
    }
}

All the information needed to figure out how it work is written in comment block. It shouldn't be too hard to figure it out. And of course you need to compile this to get it working.

Also, there's only a small sample of item that are added in the profile as it is so you will most likely have to add the one you need.
Feel free to share any item you are adding so I can add them in the profile for everyone else usage.
 
Last edited:
Hello,

thanx for that plugin. Unfortunately I cant compile it because it says
"(46,13) error CS0103:The name "ItemGroup3" is not part of the actual content."

ItemGroup3.Add(Hen);

any idea?
 
Last edited:
Hello,

thanx for that plugin. Unfortunately I cant compile it because it says
"(46,13) error CS0103:The name "ItemGroup3" is not part of the actual content."

ItemGroup3.Add(Hen);

any idea?

Code:
			List<object> ItemGroup2 = new List<object>();
			ItemGroup3.Add(Sheep);
			ItemGroup3.Add(Hen);

ItemGroup3's should of been ItemGroup2

or...

ItemGroup2 should of been ItemGroup3 depending on how you see it. :eek:
 
When I change your code to:

List<object> ItemGroup2 = new List<object>();
ItemGroup2.Add(Sheep);
ItemGroup2.Add(Hen);

compile is ok. When I start i get this list in the MainWindow but nothing happens......................

Farm ID: 11111
-> Collect Pine Tree
-> Collect Lavender
Farm ID: 11111
-> Collect Pine Tree
-> Collect Lavender
Farm ID: 11111
-> Collect Pine Tree
-> Collect Lavender
Farm ID: 11111
-> Plant Pine Sapling
-> Plant Lavender Seed
Farm ID: 11111
-> Plant Pine Sapling
-> Plant Lavender Seed
Farm ID: 11111
-> Plant Pine Sapling
-> Plant Lavender Seed
Farm ID: 11111
-> Collect Pine Tree
-> Collect Lavender
Farm ID: 11111
-> Collect Pine Tree
-> Collect Lavender
Farm ID: 11111
-> Plant Pine Sapling
-> Plant Lavender Seed
Farm ID: 11111
-> Plant Pine Sapling
-> Plant Lavender Seed
Farm ID: 11111
-> Collect Diseased Sheep
-> Collect Hungry Sheep
-> Collect Dying Sheep
-> Collect Sheep
-> Collect Thriving Sheep
-> Collect Hen
-> Collect Thriving Hen
Farm ID: 11111
-> Collect Diseased Sheep
-> Collect Hungry Sheep
-> Collect Dying Sheep
-> Collect Sheep
-> Collect Thriving Sheep
-> Collect Hen
-> Collect Thriving Hen
 
You didn't read the commented block... you need to customize it for your need. It should not be too hard to figure out even for someone with really basic coding knowledge.
 
Ok sorry ....for some reason i did not read the bottom ...........
thanx for your comment
 
Thanks for the plugin! Got it configured and its much easier to use with 8 farms than the scarecrow plugin, especially since the official one wont farm multiple farms under the same name.

Currently I'm looking into implementing a GPS pathing between farms so I can stop running into buildings.
 
Hi how do i make this collect apples and collect egg from sheep, i only have one farm (8x8) and for some reason i dont know how to work this. And I don't know how to make it run constantly without me monitoring it because everytime i click the green arrow it would work for 1/2 second and then turn off again. please help.

my farm id is 28010

EDIT: NVM fixed the hen problem..but i cant get it to harvest apples from my apple tree.
 
Last edited:
Can somebody post a example of a customized set up so I can see what I need to do here
 
I'm attempting to get this to work with 4 farms, and a bunch of potatoes. I want to get it to plant all 4 farms, wait 7 minutes, and then gather all 4 farms, then plant all 4 again and wait. All on an infinite loop. I will post it when I get it working for others to see. I pretty much want a 100 percent afk version of scarecrow plugin, and it will be amazing if I can get to work. Right now I use out scarecrow plugin and it makes me lot of gold but is annoying having to push a button to start the planting process each time...
 
This works awsome, i have set mine up for yata and it works flawlessly
however i cant get it to "plant" the yata it looks like the script is only coded for planting plants.

anyone know how to modify this code so it will "plant" yata


Code:
public void PlantItems(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<string> s in Items) {
					if (s[3] == "SnakeFromBorder") {
						SetPlantMotionType(PlantMotionType.SnakeFromBorder);
					} else if (s[3] == "Standart"){
						SetPlantMotionType(PlantMotionType.Standart);
					}
					Log("-> Plant " + s[2]);
					PlantItemsAtFarm(s[2], f);
 
This works awsome, i have set mine up for yata and it works flawlessly
however i cant get it to "plant" the yata it looks like the script is only coded for planting plants.

anyone know how to modify this code so it will "plant" yata


Code:
public void PlantItems(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<string> s in Items) {
					if (s[3] == "SnakeFromBorder") {
						SetPlantMotionType(PlantMotionType.SnakeFromBorder);
					} else if (s[3] == "Standart"){
						SetPlantMotionType(PlantMotionType.Standart);
					}
					Log("-> Plant " + s[2]);
					PlantItemsAtFarm(s[2], f);

just bumping to try to get solution to this question
 
any advice on how to get it to "plant" animals?

Hi, you can try this..

I cannot test it but it should work or at the least guide you in the right direction. You can adapt this to any other animal you want to plant.

Please read the commented line.

EDIT: CollectAnimals needed some change too.

Code:
		PlantAnimals(FarmGroup2, ItemGroup3);

                // Make sure all your Animal Object have a "Plant" List<string>, even if you don't need to plant that animal. Otherwise it will break the collect and plant function.
		// create new List<String> to hold the planting information
		List<string> PlantHen = new List<string>();
		List<string> NormalHen = new List<string>();
		List<string> ThrivingHen = new List<string>();
		// add the item name your planting FIRST (yes the order is important)
		PlantHen.Add("Chick")
		// add planting algorithm SECOND (yes the order is important)
		PlantHen.Add("Standart")
		NormalHen.Add("Hen");
		NormalHen.Add("Husbandry: Spend 1 Labor and 1 Ground Grain to feed livestock.");
		ThrivingHen.Add("Thriving Hen");
		ThrivingHen.Add("Husbandry: Spend up to 5 Labor to gather eggs.");
		// always add the "Plant" List<string> first or the PlantAnimals/CollectAnimals function won't work
		Hen.Add(PlantHen)
		Hen.Add(NormalHen);
		Hen.Add(ThrivingHen);

		public void CollectAnimals(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<object> o in Items) {
					foreach(List<string> s in o) {
                                               //  Skip the "Plant" List<string>
                                               if (s != o[0]) {
   				                     Log("-> Collect " + s[0]);
   						     CollectItemsAtFarm(s[0], s[1], f);
                                               }
					}
				}
			}
		}

		public void PlantAnimals(List<uint> Scarecrow, List<object> Items) {
			foreach (uint f in Scarecrow) {
				Log("Farm ID: " + f);
				foreach (List<object> o in Items) {
					foreach(List<string> s in o) {
						/ It will only process the first List<string> in the List<object> and ignore the others hence why it's important to add the "Plant" List<string> first.
						if (s == o[0]) {
							if (s[1] == "SnakeFromBorder") {
								SetPlantMotionType(PlantMotionType.SnakeFromBorder);
							} else if (s[1] == "Standart") {
								SetPlantMotionType(PlantMotionType.Standart);
							} else if (s[1] == "SnakeFromCenter") {
								SetPlantMotionType(PlantMotionType.SnakeFromCenter);
							} else if (s[1] == "SecondStandart") {
								SetPlantMotionType(PlantMotionType.SecondStandart);
							}
							Log("-> Plant " + s[0]);
							PlantItemsAtFarm(s[0], f);
						}
					}
				}
			}
		}
 	}
}
 
Last edited:
Here's my take, thank you AtomicBomb!

So, I've been a lurker for a little while, as seen by my post count, but, I wanted to contribute in some small way, so I modified this Plugin's code to allow for:

  • Anti-AFK (4-5mins)
  • Purely Random Restart Loop Time (4-5mins)
  • Animal Gathering and Planting Support
  • Animal Pen Gathering and Planting Support
  • Fruit Tree Planting and Gathering Support
  • More Seeds/Animals Added for use
  • A Clear Log Function for Ease of Troubleshooting/Set-up/Cleanliness
  • List of Seeds Used and Items Gathered

NOTE: In no way do I overtake or claim this is my own work. Most of the code is copy paste from AtomicBomb, just with some corrections and additions here and there. (SYNTAX! :D) Also, some of my added comments are very lazy, and if/when I get time after Christmas I will update them. :p


[HIDE]Haha! No code here! No, but seriously, I get yelled at for trying to post over 30,000 characters. :p Here ScareCrow Alternative Mod - Pastebin.com is a link for the program data that used to could be here! :D If this creates any issues for people copy/paste wise, or is against the rules, or whatever else have you, I can and will help you get a hold of the code or remove this link, respectively. [/HIDE]



Also, this will go into my next code revision, but I needed to add it here really quick because I just thought of it...

Under the groups section, you can simply comment out the things you do not want to collect/plant. For example.

[HIDE]
Code:
            NoTreeItemGroup.Add(Azalea);
            NoTreeItemGroup.Add(Clover);
            NoTreeItemGroup.Add(Cornflower);
            NoTreeItemGroup.Add(Cotton);
            NoTreeItemGroup.Add(Iris);
            NoTreeItemGroup.Add(Lavender);
            NoTreeItemGroup.Add(Lily);
            NoTreeItemGroup.Add(Lotus);            
            NoTreeItemGroup.Add(Mushroom);
            NoTreeItemGroup.Add(Narcissus);
            NoTreeItemGroup.Add(Rose);
            NoTreeItemGroup.Add(Rosemary);
            NoTreeItemGroup.Add(Sunflower);
            NoTreeItemGroup.Add(Thistle);

[/HIDE]

Gathers/Plants ALL of the above, but,

[HIDE]
Code:
            NoTreeItemGroup.Add(Azalea);
            //NoTreeItemGroup.Add(Clover);
            //NoTreeItemGroup.Add(Cornflower);
            //NoTreeItemGroup.Add(Cotton);
            //NoTreeItemGroup.Add(Iris);
            //NoTreeItemGroup.Add(Lavender);
            NoTreeItemGroup.Add(Lily);
            //NoTreeItemGroup.Add(Lotus);            
            NoTreeItemGroup.Add(Mushroom);
            //NoTreeItemGroup.Add(Narcissus);
            //NoTreeItemGroup.Add(Rose);
            //NoTreeItemGroup.Add(Rosemary);
            //NoTreeItemGroup.Add(Sunflower);
            //NoTreeItemGroup.Add(Thistle);

[/HIDE]

Only plants/gathers Azalea, Lily, and Mushrooms. I hope this helps!


Update 1: Added Item Use/Gather counts and Turkeys. Also, fixed Sheep.
Update 2 - 26 DECEMBER: Merry Christmas! I have updated the majority of the comments to hopefully make everything more clear. I also added all seeds under 5 hours, both planting and gathering. Seeds over 24 hours will be added later. I also re-wrote almost everything to put everything into some sort of order. Still a work in progress. :D Also, 35K characters! Whaaaaaat?!? Added a link to the code.
 
Last edited:
Thx, but i have small problem with compilation of a plugin, i have error:
6:04:06: c:\Users\Hack\Desktop\AA\FT\FT.cs(15,13) : error CS0246: The type or namespace name 'Random' could not be found (are you missing a using directive or an assembly reference?)
6:04:06: c:\Users\Hack\Desktop\AA\FT\FT.cs(15,33) : error CS0246: The type or namespace name 'Random' could not be found (are you missing a using directive or an assembly reference?)
How i can correct this error?
 
Back
Top