Farm Manager - Tribal Wars 2 Farmbot

error i see it all the time when i try to configure parameter of farming cycles.
My cod

C:\Users\Admin\Desktop\botnew\BotEngine.exe run-bot --key-to-start-online-session=xxxxxxxxxxxxxxxxxxxx --bot-configuration=“number-of-farm-cycles = 140, break-duration = 10 - 20” “bots/implement/applications/tribal-wars-2/tribal-wars-2-farmbot at bf51d851ea1b452ed031155a52303d8cfc4acc36 · Viir/bots · GitHub

And second problem is - after 20 min farming or less barb villagers disappear.

And one more, can u pls add the functions for bot - reload game if he stuck on one village, its happen sometimes when server laging.
Best regards

PS I foung that i can download bot and use it from my disc! Now i can configure it))

Welcome Tod and thank you for the feedback!

In the screenshot of the console window, I also found this text:

I found 188 files in 'https://github.com/Viir/bots/tree/bf51d851ea1b452ed031155a52303d8cfceacc36'.

There is a problem with the bot source: I did not find an 'elm.json' file directly in this directory. Did you mean the subdirectory 'implement\devtools\read-from-image'?

This error message looks like the last part of the command was truncated, the end of the path to the bot code (/implement/applications/tribal-wars-2/tribal-wars-2-farmbot) got lost somehow. So the engine loaded the root directory of the repository containing all the different bots.

So far, I have no idea what could have caused this or how it is related to the addition of the configuration.
I tried to copy the code you posted to see if I can get the same error. I tested these variants:

botengine run-bot --key-to-start-online-session=xxxxxxxxxxxxxxxxxxxx --bot-configuration=“number-of-farm-cycles = 140, break-duration = 10 - 20" "https://github.com/Viir/bots/tree/bf51d851ea1b452ed031155a52303d8cfc4acc36/implement/applications/tribal-wars-2/tribal-wars-2-farmbot"
"C:\Users\John\Downloads\2020-02-16-botengine-console\BotEngine.exe"  run-bot --key-to-start-online-session=xxxxxxxxxxxxxxxxxxxx --bot-configuration=“number-of-farm-cycles = 140, break-duration = 10 - 20" "https://github.com/Viir/bots/tree/bf51d851ea1b452ed031155a52303d8cfc4acc36/implement/applications/tribal-wars-2/tribal-wars-2-farmbot"

In both cases, the loading worked as expected, I got this output:

I found 9 files in 'https://github.com/Viir/bots/tree/bf51d851ea1b452ed031155a52303d8cfc4acc36/implement/applications/tribal-wars-2/tribal-wars-2-farmbot'.

No idea how I could reproduce the error you were seeing. :man_shrugging:


Good idea, I will add that. :+1:
Reloading is simple, I just need to figure out how to detect if it is stuck.

1 Like

Thx, i downloaded files on my pc and now i haven’t problem n1.
About how figure the stucking, maybe when bot dont change villas for a 15 (or some) min? It will work in any situation. The bigest problem what i see for this bot is he all the time moving around map.Its a browser not optimized game, it will always proke many problems, and reload - one way to cleanup.
Best regards

1 Like

Thank you for clarifying Tod. I added the reload feature now, the newest version of the bot reloads the web page, by default every fifteen minutes.

You can run this version from bots/implement/applications/tribal-wars-2/tribal-wars-2-farmbot at cd99c4db9a2fe9ed69eade9681e3bf3ed25ad4c3 · Viir/bots · GitHub

It also indicates in the user interface when the last reload happened:

Reloaded the web page 7 minutes ago.

1 Like

Hey Viir
I am enjoying this seeing as I had to restart in a new world it has helped me a lot.

However, I have a few issues. And I thought by buying 300.000 points they would get solved somehow with a longer session, but sadly no.

First:
It takes very very long for it to search barb villages, and send out attacks, is this normal? 1 coordinate takes around 1 second to search - so one village spends maybe 15 min to send out all attacks - then the problem becomes:
By the time it has reached to send out the attacks… the farm troops have already returned back… so it keeps sending from that same village over and over cause it never hits the 50 attack limit?

It takes the bot about 1 hour and 40 minutes to send attacks from 5 different villages (and cause of that problem I mentioned, I have to manually pause bot, switch village in chromium, then press enter to resume bot so it starts sending from that village…)

Am I the only one to experience this?

Is there any way to make the bot REMEMBER those coordinates it has already searched and found the barb villages at - and then automatically send them there next time instead of searching for coordinates each time?

Besides that, great job to you!

1 Like

Hello Lanson,
Thank you for sharing your experience.

It does hit the 50 attack limit, no matter how fast your troops are because the attacks don’t go to the same barbarian villages in the same farm cycle. With each attack, the distance to the next barbarian village is further, so it takes more time for the troops to return.

It only takes long in the first farm cycle per session. In the second farm cycle, the bot remembers the locations of the barbarian villages, so it does not need to search them anymore. Sending an attack then should take less than 7 seconds.
So starting with the second farm cycle, half an hour is enough for sending 250 attacks.

If you prefer, you can have the bot switch between your villages earlier, so it does not anymore need to reach the 50 attack limit. If you choose this option, it still uses the available 50 attacks, just the ordering between villages would be different.

Many people use a configuration where the bot remembers the barbarian villages for most attacks, which makes them less likely to experience this situation.

Yes, the way is make it remember is to configure more farm cycles. The bot remembers all those coordinates within the same session, so it can reuse this knowledge, starting with the second farm cycle. (It sends only one attack per target per farm cycle, to the remembering does not affect the first farm cycle)

To enable more farm cycles, start the bot with a configuration. If you used the Command Prompt to start the bot, you can apply the configuration using an adapted command.
In your case, the command would be this:

botengine  run-bot  --online-session  --bot-configuration="number-of-farm-cycles = 4, break-duration = 20 - 40"  "https://github.com/Viir/bots/tree/4a4f4b8ba166a441882214337f0b129ea6430da0/implement/applications/tribal-wars-2/tribal-wars-2-farmbot"         

If you apply this configuration, the bot also shows this message after completing the first farm cycle:

Completed 1 of 4 farm cycles.

1 Like

Wow Viir, that was beyond expectation when it came to your reply.

I am really grateful, absolutely amazing and very prompt. I also believe you answered a lot of questions many people might have had. (3 people I know of haha)

You should consider a small FAQ! -

I had a hunch it might remember the previous locations if you run it in multiple cycles, but I didn’t bother to give it a try until I understood the concept of it. Now that I know it does not send out to the same barb village as before - it all makes sense that it finishes the 50 attacks.

A small improvement:
Not everyone has cavalry (fast farming units) in all their villages - would there by any chance be possible to prioritize non cavalry unit villages first, then going to them?

This way it will send infantry (slow farmers) to the closest barb villages, and the cavalry to the furthest - improving efficiency. Maybe defined by the phrase “fast” or “slow” in the preset.

And I believe something a lot of people would really love - set a limit for minimum barb point villages - maybe even defined to the different presets?

Also: Does the bot use credits when it is on pause? It would be really nice to have it on constantly so it never forgets a “session” like you describe it… instead of having to refind all those barbs all the time.

1 Like

Thank you for the explanation, great ideas to refine the user guide.

I will look into it, will post here again when I have a more concrete idea of how it would work. I think there will be a list of presets and villages in an example to illustrate it.
If I understand you correctly, the preset list could look like this:

  • “fast A”
  • “fast B”
  • “slow A”
  • “slow B”

That sounds much simpler. It seems this needs not as much explanation, so I can implement that soon.

Yes.

At the moment I don’t have a solution for this. The idea is to have the engine save the bots memory to your account eventually. Then the bot could load that information on startup.

Or, actually. I might have an idea that could work better, let me know if you disagree of course. Just trying to lend out a hand, your the man here.

Maybe you define, yourself as the player, what villages the bot takes in what order - this way if I move cavalry here, or that there… or whatever I do with the villages… I can just worry about changing their priority. The lower the number, the higher the priority.

Preset names: split on 4 villages =

  • Farm 1

  • Farm 2

  • Farm 3

  • Farm 4

Obviously, it will start sending out attacks from when it detects the lowest number so village with farm 1, then 2, then 3 and so forth. Also, you can make it a configurable state. So maybe priority_farming “1” for on or priority_farming “0” for off. Adds more fun for us - and I know people would appreciate more configs that are simple like this.

@Lanson I don’t understand it yet. It would need some discussion to get it into my brain. I don’t see this fit into this thread, but we can discuss it if you open a new topic.

I will update this topic when I have implemented the other feature for filtering targets by their points.

I implemented this today. You can use the new app setting farm-barb-min-points to enable this feature:

botengine  run-bot  --online-session  --app-settings="farm-barb-min-points=1000"  https://github.com/Viir/bots/tree/84abb44190c2ec856fb4677e2f7e888acee7c6ad/implement/applications/tribal-wars-2/tribal-wars-2-farmbot

I updated the bots description accordingly:

[...]
   ## Configuration Settings

   All settings are optional; you only need it in case the defaults don't fit your use-case.
   You can adjust three settings:

   + 'number-of-farm-cycles' : Number of farm cycles before the bot stops completely. The default is 1.
   + 'break-duration' : Duration of breaks between farm cycles, in minutes. You can also specify a range like '60-120'. I will then pick a random value in this range.
   + 'farm-barb-min-points': Minimum points of barbarian villages to attack.
[...]

Has anyone been banned for using this bot? I remember using it back in 2016 and never had any issues.

The Tribal Wars 2 farmbot recently saw a lot of updates to make it more efficient. I updated the guides to integrate version 2020-03-25. To summarize, the most significant improvements:

  • Faster farming: The newest version sends between 800 and 1000 attacks per hour.
  • New feature to avoid smaller barbarian villages. You can set a threshold for minimum points using the app-settings.
  • Improved user interface, including a detailed report on the last completed farm cycle and many improved status description texts.

i had some credits in 2018, where are they ?

For the 2018 version, nothing changed. The credits for the 2018 version are still at https://manage.botengine.org/credits.

hey, i installed it, and it works, but my question is, if it runs through 1 farm cycle, does it strats automaticly a second? because it says to continu press any key, when i do that, its gone

No, by default it stops after one farm cycle. You have to apply settings to make it run multiple cycles.

To use settings, run the bot using the Windows app called ‘Command Prompt’ (cmd.exe). This app comes by default with any Windows 10 installation.

To run the bot with default settings, you would use this command:

botengine  run-bot  "https://github.com/Viir/bots/tree/ed9cd75aa0e0c11090a2ce2af1d69b3ea3ca153f/implement/applications/tribal-wars-2/tribal-wars-2-farmbot"

Command to start Tribal Wars 2 Farmbot without settings

To run the bot with different settings, expand that command by adding the --app-settings argument.
Here is an example of app-settings for three farm cycles with breaks of 20 to 40 minutes in between:

--app-settings="number-of-farm-cycles = 3, break-duration = 20 - 40"

To apply these settings to the bot, add them into the run-bot command used to start the bot:

botengine  run-bot  --app-settings="number-of-farm-cycles = 3, break-duration = 20 - 40"  "https://github.com/Viir/bots/tree/ed9cd75aa0e0c11090a2ce2af1d69b3ea3ca153f/implement/applications/tribal-wars-2/tribal-wars-2-farmbot"

Command to start Tribal Wars 2 Farmbot with settings

When you have applied settings for multiple farm cycles, the bot displays this message during the breaks between farm cycles:

Next farm cycle starts in 17 minutes. Last cycle completed 16 minutes ago.

i have windows 7 , the bot stops after 1 session, i cant putt something in the command promp, can you make it work for windows 7 ? i cant change the bot options

I have no plans to develop for Windows 7.

the bot never started on my windows 10 PC , what did i do wrong ?

i did folow the instructions
Screenshot - 28ed88af967dfd33d30ef2bae5f69427 - Gyazo
i try to instal it Screenshot - 6a0435a0753709587745367f4042bb50 - Gyazo