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

Simple plugins example

Out

Active Member
Joined
Jun 2, 2012
Messages
2,972
Reaction score
13
Get all mails:
Code:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;

namespace DefaultNamespace{
    public class DefaultClass : Core
    {
        public void PluginRun()
        {
            RequestMailList();
            foreach (var mail in getMails())
            {
                mail.OpenMail();
                if (!mail.isSent)
                {
                    mail.ReceiveGoldFromMail();
                    foreach (var item in mail.getItems())
                        mail.ReceiveItemFromMail(item);
                    mail.DeleteMail();
                }
                Thread.Sleep(1000);
            }
        }
    }
}

Planting and gathering on your scarecrow:
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()
        {
            PlantItemsAtFarm("Cedar sapling","YourCharacterName");
            CollectItemsAtFarm("Cedar tree","Logging: Spend up to 10 Labor to chop down a tree.","YourCharacterName");

            //Same but in random zone
            RoundZone z = new RoundZone(me.X,me.Y,25);  
            PlantItemsInZone("Cedar sapling", z);
            CollectItemsInZone("Cedar tree","Logging: Spend up to 10 Labor to chop down a tree.",z);
        }
    }
}

Reaction for some events:
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 keyDown(Keys k, bool isControl, bool isShift, bool isAlt)
        {
            if (isControl && k == Keys.R)
            {
                //ctrl-R pressed
            }
        }

        public void targetChanged(Creature obj, Creature obj2)
        {
            //obj select obj2
        }

        public void PluginRun()
        {
            onTargetChanged += targetChanged;
            onKeyDown += keyDown;
            while (true)
                Thread.Sleep(1000);
        }
    }
}


All that you need to reenter game world - make plugin with code like:
Dont forget change game world name and specify character number
Code:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;

namespace RelogNamespace
{
    public class RelogClass : Core
    {                    
        public void PluginRun()
        {
			while (true)
			{
				if (gameState == GameState.ServerSelect)
				{
					//Find our game world
					var myWorld = getWorlds().Find(w => w.name == "Orchidna");
					if (myWorld == null || (myWorld != null && !myWorld.EnterGameServer()))
					{
						Log("Invalid game world name or error while we try to enter game server!");
						return;
					}
					//Wait while we enter game world
					while (gameState != GameState.CharacterSelect)
						Thread.Sleep(500);
					//Get our character (in this example first character from all that you have on this game world
					var chararcters = myWorld.getCharacters();
					if (chararcters.Count == 0 || (chararcters.Count > 0 && !chararcters[0].EnterGame()))
					{
						Log("No characters on this world or error while we try to enter game!");
						return;
					}
				}
				Thread.Sleep(1000);
			}
			
		}
	}
}
 
Last edited:
i guess planting and gathering are pretty easy and usefull at the same time, i'll try it later .
how does the bot recognize my farm ? do i have to sit on top of it or specify location ?
 
how does the bot recognize my farm
By owner name. Or you can specify "uniqId" instead, if you have 2+ scarecrows near each one.
 
ArcheBuddy bot classes? ;)
//ty, fixed :)
 
Last edited by a moderator:
By owner name. Or you can specify "uniqId" instead, if you have 2+ scarecrows near each one.
Do i need to be the owner of the farm or can i just type the name of the owner, in this case my 2nd toon, and the bot will recognize it ?
how do i see the "uniqid" of a farm ?
ps: can i do this
PlantItemsAtFarm("Aspen sapling","name1stchar","name2ndchar"); ?
 
Last edited:
Do i need to be the owner of the farm or can i just type the name of the owner, in this case my 2nd toon, and the bot will recognize it ?
No, you can specify any owner name. If you have access to this scarecrow - bot start plant this scarecrow.
how do i see the "uniqid" of a farm ?
for example: Select this scarecrow and run plugin with code: "Log(me.target.uniqId);". They use number from Log window as uniqId;
Also you can try to use plugin Scarecrow.dll, which is loaded with ArcheBuddy
 
can you give an example what code I would need to farm a world node, like iron ore in a cave? Trying to get a working plugin to farm that in a cave. currently looking into the gps stuff ;)
 
Trying to get a working plugin to farm that in a cave. currently looking into the gps stuff
Tell me place (where i can write this example) - and i do this.
 
Tell me place (where i can write this example) - and i do this.

Tigerspine Mountain, in the north you see the "North Devi River". Right above the writing on the map, there are 3 entrances.
Within that cave you have a pretty decent spawn of iron nodes. (21336, 8952 according to your aa_gps.exe)

Also, for the code you poste previously:

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()
        {
            PlantItemsAtFarm("Cedar sapling","YourCharacterName");
            CollectItemsAtFarm("Cedar tree","Logging: Spend up to 10 Labor to chop down a tree.","YourCharacterName");

            //Same but in random zone
            RoundZone z = new RoundZone(me.X,me.Y,25);  
            PlantItemsInZone("Cedar sapling", z);
            CollectItemsInZone("Cedar tree","Logging: Spend up to 10 Labor to chop down a tree.",z);
        }
    }
}

This would go, and place 1 "Cedar Sapling" and then chop it. Would it chop it instantly, or would it wait, until its grown? (I guess it would wait, right? Since the name changes once its mature. And that name is what we are looking for, right?)

I want to make a profile that plants something until the farm is full, then waits till i ts grown, and then farms it. Once finished, it should start over. I guess that should by possible by adding a FOR loop with like 10 runs for planting, then a Wait for the amount of time necessary
to grow, and then another FOR loop with 10 runs for farming. once both done, start over again.

Like this:

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()
        {
			for (int i=0;i<20;i++)
            {
			PlantItemsAtFarm("Potato Eyes","EnterNameHere");
			}
            Thread.Sleep(600000);
			for (int i=0;i<20;i++)
			{
			CollectItemsAtFarm("Potato","Farming: Spend up to 10 Labor farm.","EnterNameHere");
			}
			
        }
    }
}


Edit: Cant get that compiled :( keeps telling me there is no *.cs file to compile in my selected folder.
 
Last edited by a moderator:
What do i have to do to make the bot farm and harvest potatoes all the time? Plant, wait, Harvest, plant, wait, harvest... ?
 
Plant, wait, Harvest, plant, wait, harvest... ?
while (true)
{
PlantItemsAtFarm(....);
CollectItemsAtFarm(....);
Thread.Sleep(6000);
}
 
If you need working example - i`l can post it tomorrow.
 
Would be nice if you could release such samples with each update of AA :) Like you did with Scarecrow plugin. I love this :D but the sound was annoying
 
Out could you please whenever you will have some time write few more simple codes im fine with editing but i dont know how to add new stuff and your samples and easy codes from other topics are very helpfull. Please ;)
 
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()
{
PlantItemsAtFarm("Azalea Seed","YourCharacterName");
CollectItemsAtFarm("Azalea","Logging: Spend up to 10 Labor to chop down a tree.","YourCharacterName");

//Same but in random zone
RoundZone z = new RoundZone(me.X,me.Y,25);
PlantItemsInZone("Cedar sapling", z);
CollectItemsInZone("Cedar tree","Logging: Spend up to 10 Labor to chop down a tree.",z);
}
}
}


I did not understand very well ... as she gets properly?

is to make planting and harvesting afk?
 
Does the scarecrow one make it so that it plants the max the field can hold? Like 20 aspens on a large farm?
 
Back
Top