Hi all,
Just purchased a 3 day trial and figured I'd try get something together to farm barley on my 2 plots. The code includes anti afk (jump every 4-5 minutes after routine complete), holds off planting anything until labor is > 1000 (I like to have some to play with when I get on), count of seed used, and I plan on adding a route to the seed merchant and back when I get some more free time.
Code below:
Thanks.
Just purchased a 3 day trial and figured I'd try get something together to farm barley on my 2 plots. The code includes anti afk (jump every 4-5 minutes after routine complete), holds off planting anything until labor is > 1000 (I like to have some to play with when I get on), count of seed used, and I plan on adding a route to the seed merchant and back when I get some more free time.
Code below:
Code:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;
namespace YourNamespace {
public class YourClass: Core {
public void PluginRun() {
while (true) {
//get Labor points
int labor = me.laborPoints;
//if Labor > 1000
if (labor > 1000) {
//get starting count of seed
var barleystart = itemCount("Barley Seed");
//Plant farm 1
PlantItemsAtFarm("Barley Seed", INSERTFARMIDHERE);
CollectItemsAtFarm("Barley", "Farming: Spend 1 Labor to harvest crops.", INSERTFARMOWNERIDHERE);
//Plant farm 2
PlantItemsAtFarm("Barley Seed", INSERTFARMIDHERE);
CollectItemsAtFarm("Barley", "Farming: Spend 1 Labor to harvest crops.", INSERTFARMOWNERIDHERE);
//get ending count of seed
var barleyend = itemCount("Barley Seed");
//get seed used and show in log
var used = barleystart - barleyend;
Log(used + " Barley used");
//if Labor < 1000 wait
} else {
Log("Labor under 1000, waiting to regen");
}
//Jump once
Jump(true);
Log("JUMP! JUMP!");
Thread.Sleep(500);
Jump(false);
//Generate random time between 4-5 minutes
Random random = new Random();
var mseconds = random.Next(240, 300) * 1000;
var seconds = mseconds / 1000;
Log("Waiting for " + seconds.ToString() + " seconds");
//sleep for random time
Thread.Sleep(mseconds);
}
}
}
}
Thanks.