Farm Manager - Tribal Wars 2 Farmbot

yes, to give a break every other cycle but have you looked into being able to use multiple account at once? or do i need to purchase 2 separate keys?

Perhaps if i were to try farm-barb-min-points: 150-300

Would that work? so my accounts could avoid farming eachothers barbs?

You can run at least five online instances in parallel on the same machine. Each instance has a separate web browser window.
The bot does not need input focus on the operating system level so that you can run any number of instances in the background.

There is currently no functionality for coordination between two instances running on the same game world.

Question:

If I configure the bot to run x cycles and after the first cycle a barbarian village is captured by another player, will the bot stop attacking this village or will it send x-1 attacks? Basically, does the bot ever check the coordinates saved after the first cycle? Because if it doesn’t it would be pretty obvious you are running a bot.

The bot stops attacking a village when a player conquers it.
Before attacking, the bot checks when it last read reading at these coordinates. If the last reading is too old, it rereads the village data. As we can see in this part of the program code, the threshold is ten seconds:

how do i run mulptiple instances? MY previous window closes when i try to do so

To clarify, I’ll run the seperate .bat or command and both command consoles will appear and recognize eachother but the chromium being used will close adn then open an entirely new one. what am i doing wrong?

I remember there was a separate version to support running multiple instances on the same machine. I just need to update that branch for the framework changes from a few weeks ago.

I found the earlier branch here:

I uploaded a new farmbot for multiple instances. You can run it from https://catalog.botengine.org/0d5a0181e4a15c14d2c47fb3137eb41614ce6ad4d04d440c30b28dcfa821cae1

I definitely appreciate it! After a couple cycles it will open a new tab and keep the old tab still running. Is there a way to have the Bot run off of 2 separate windows or will it only work in tabs? In my situation, I’m using it to farm in a main account and a co-op as well. After each cycle it creates a new tab. Eventually while I’m gone at work I could see 10-20 tabs hindering the performance of the bot and high CPU/Ram Usage.

1 Like

Or maybe I’m using it wrong? I’m using 2 separate command prompts, should I only be using 1?

Using separate command prompts is correct. That is how it should work.

I am looking into the problem with superfluous tabs.
I think this configuration should help to repro this faster: FrontendWeb.Main

EDIT:
Looks like I also should reduce restartGameClientInterval to see the problem.

Turns out there is a rounding error preventing the configured break duration of one minute to work. So I had to change the app-settings to set two minutes break time: FrontendWeb.Main

I see the problem with the growing number of tabs now, even using just a single instance.

I found a better way to run multiple instances in parallel. This time, without the growing number of tabs, while still restarting the web browser periodically. (We had introduced the restarting of the web browser last year to avoid problems with resource usage and the game client become unresponsive)
I found a way to separate the bot instances by using different profiles in the Chrome browser. The new bot kills browser instances before starting a new browser window. Today’s innovation is it kills only those instances that use the same user profile directory.
I uploaded a new bot using that approach here:https://catalog.botengine.org/4d38448be51a4177513bc2f637b98af2064f5431f888caa1411c311490c5a696/configure-run-app/eyJvbmxpbmVTZXNzaW9uIjpmYWxzZSwiYXBwU2V0dGluZ3MiOiJ3ZWItYnJvd3Nlci11c2VyLXByb2ZpbGUtaWQgPSBwcm9maWxlLWJldGEiLCJwYXVzZUFwcEtleXMiOiIiLCJzZXNzaW9uTGVuZ3RoTGltaXQiOiIiLCJkZXRhaWxlZFNlc3Npb25SZWNvcmRpbmciOiIifQ==

To set a user profile ID for a bot, use the new web-browser-user-profile-id app-setting like this:

web-browser-user-profile-id = profile-beta

The bot displays the profile ID in the engine window, so you can check that each running instance has a unique profile ID:

Note that browser state like bookmarks and cookies belong to a profile. That means you need to log in to the game for each new browser profile that you create.

thank you! i will start utilizing this right now!

1 Like

Is there any way to set a parameter command similar to avoiding barb, where we can tell the bot to only use preset from these set of villages and ignore the rest? This way I don’t have to disable or create a different preset for certain village I want it to continue farming and ignore the other ones.

Also, is there a way for the bot to not send a preset to a bar that has an army returning? Sometimes, you need to run the bot again but it will send a preset to a barb that has a army coming back from it.

I am not sure what the ‘parameter command similar to avoiding barb’ is.
You mean this one?

farm-avoid-coordinates: List of village coordinates to avoid when farming. Here is an example with two coordinates: ‘567|456 413|593’

I did not see the connection to coordinates in the other part. :thinking:


Likely yes, we can take a closer look at how your game client works in that area.

I remember there is a function that counts the number of army movements for the current village. As far as I remember, this number might be coming from a list of movements that we get from the game. Each entry in there might have a property to identify the village.
The information could be in the JSON that we decode with decodeVillageDetailsCommands here:

When you send me a recording of one of your sessions, I can check if we can get it there.

I am not sure what the ‘parameter command similar to avoiding barb’ is.
You mean this one?
Like is there a way to set a coordinate on a village that you own that the bot will ignore and won’t send unit to farm?

Likely yes, we can take a closer look at how your game client works in that area.

I remember there is a function that counts the number of army movements for the current village. As far as I remember, this number might be coming from a list of movements that we get from the game. Each entry in there might have a property to identify the village.
The information could be in the JSON that we decode with decodeVillageDetailsCommands here:

I’ll try to get the JSON file for it. Thanks!

Hi
You said it “remembers the co-ordinated of farms” after the second cycle. I have a favourites list of barbarians to farm. ie. Village 1 has L.cav and farms far, Village 2 has spears and farms close.
Is there a way to input these ‘farms’ for the bot to use? Basically use the farms in the Battle report to “refarm” exactly.
or
Is there a way for the bot to farm from a distance ie. 60minutes away, and come closer?
That way the Village 1 cavalry with farm preset ‘farm A’ = far; and the Village 2 spear with preset 'farm B" = closer farms.

Thank you for your valuable time

The one I linked in this topic does not support that. You could change the program code to do that.
The reversed ordering by distance sounds like it could be simple.
One difference I see is that the linked app uses distance to order the targets instead of time.

Also, is there a way for the bot to not send a preset to a bar that has an army returning?

Likely yes, we can take a closer look at how your game client works in that area.

I remember there is a function that counts the number of army movements for the current village. As far as I remember, this number might be coming from a list of movements that we get from the game. Each entry in there might have a property to identify the village.
The information could be in the JSON that we decode with decodeVillageDetailsCommands here:

github.com
Viir/bots/blob/9b9af9fe313b9aa08c621256102e6afb231eaf99/implement/applications/tribal-wars-2/tribal-wars-2-farmbot/BotEngineApp.elm#L1758-L1761
decodeVillageDetailsCommands : Json.Decode.Decoder VillageCommands
decodeVillageDetailsCommands =
Json.Decode.map VillageCommands
(Json.Decode.at [ “data”, “commands”, “outgoing” ] (Json.Decode.list decodeVillageDetailsCommand))
When you send me a recording of one of your sessions, I can check if we can get it there.

Not sure what recording or info you need. But shorten the break duration and this is what it does even though they’re plenty of other barb. Using Tribal Wars 2 farmbot version 2020-12-21
image

The session recording archive of a session where you had this scenario:

The session needs to be long enough to have the bot sent at least one attack from the village your army is returning to. At this stage, the reading of that part of the game state should have happened already, so that it is included in the recording.

You can use the approach from bots/guide/how-to-report-an-issue-with-a-bot-or-request-a-new-feature.md at main ¡ Viir/bots ¡ GitHub to get your archive.