Farm Manager - Tribal Wars 2 Farmbot (old version from 2018)

Hello. Already the next day there was a mistake in the program at night. He ran normally during the day. I enclose an error listing in the attachment. Please give advice where the problem is. Thank you
peki1808

v Submission#0.<>d__0.MoveNext()
— Konec trasování zásobníku z předchozího místa, ze kterého byla vyvolána výjimka —
v System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
v System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
v Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- Konec trasování zásobníku z předchozího místa, ze kterého byla vyvolána výjimka --- v System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() v System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) v Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext()
— Konec trasování zásobníku pro vnitřní výjimku —
v System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) v BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_1.<Start>b__3() v System.Threading.Tasks.Task1.InnerInvoke()
v System.Threading.Tasks.Task.Execute()
—> (Inner Exception #0) System.NotImplementedException: Did not find button to switch to battle reports.
v Submission#0.<>d__0.MoveNext()
— Konec trasování zásobníku z předchozího místa, ze kterého byla vyvolána výjimka —
v System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
v System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
v Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- Konec trasování zásobníku z předchozího místa, ze kterého byla vyvolána výjimka --- v System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() v System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) v Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext()<—
<—

00-25-34.736: status transition from Running to Failed.

Most Recent Bot Operation Sessions

2019-11-12 05:32:19 UTC - session e26a4865c7f96cb0 using bot 0040E8762ADCB304E2FB4B6FE3878005AE480FD5

Status: , Duration: 136 minutes

2019-11-11 20:33:17 UTC - session c3b9759fbea4f59c using bot 0040E8762ADCB304E2FB4B6FE3878005AE480FD5

Status: Failed :x:, Duration: 172 minutes

2019-11-11 14:13:14 UTC - session 09b15da2c119307e using bot 0040E8762ADCB304E2FB4B6FE3878005AE480FD5

Status: Failed :x:, Duration: 215 minutes

Haloo. I’ve already figured out a problem. The robot stops after midnight to retrieve the report and at the same time starts the daily reward for the raw materials. it stops the robot and writes an error.

10-43-59.957: Bot operation started in session 4fd4c8acf0f3262b.
10-44-00.133: Welcome! - ¡Bienvenido! - Bienvenue! ---- This is the Tribal Wars 2 Farmbot. I read your battle reports and send troops to your farms again. To learn more about how I work, see /forum.botengine/t/farm-manager-tribal-wars-2-farmbot/1406. In case you have any questions, feel free to ask at ://forum.botengine
10-44-00.133: According to the configuration, I will repeat farming in 1 cycles. Between the farming cycles, I will take breaks with lengths between 60 and 80 minutes.
10-44-00.134: RuntimeException: System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.UnauthorizedAccessException: Access to the path ‘C:\WINDOWS\system32.local-chromium’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at PuppeteerSharp.BrowserFetcher.d__22.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
at BotOperationApp.Windows.Exe.ScriptRunClient.OpenNewBrowserPage()
at BotOperationApp.Windows.Exe.ScriptRunClient.<get_ToScriptGlobals>b__15_0()
at BotOperationApp.Windows.Exe.WebBrowser.OpenNewBrowserPage()
at Submission#0.<>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_1.<Start>b__3() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_0.b__4()
—> (Inner Exception #0) System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.UnauthorizedAccessException: Access to the path ‘C:\WINDOWS\system32.local-chromium’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at PuppeteerSharp.BrowserFetcher.d__22.MoveNext()

— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
at BotOperationApp.Windows.Exe.ScriptRunClient.OpenNewBrowserPage()
at BotOperationApp.Windows.Exe.ScriptRunClient.<get_ToScriptGlobals>b__15_0()
at BotOperationApp.Windows.Exe.WebBrowser.OpenNewBrowserPage()
at Submission#0.<>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_1.<Start>b__3() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
—> (Inner Exception #0) System.AggregateException: One or more errors occurred. —> System.UnauthorizedAccessException: Access to the path ‘C:\WINDOWS\system32.local-chromium’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at PuppeteerSharp.BrowserFetcher.d__22.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
at BotOperationApp.Windows.Exe.ScriptRunClient.OpenNewBrowserPage()
at BotOperationApp.Windows.Exe.ScriptRunClient.<get_ToScriptGlobals>b__15_0()
at BotOperationApp.Windows.Exe.WebBrowser.OpenNewBrowserPage()
at Submission#0.<>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext()
—> (Inner Exception #0) System.UnauthorizedAccessException: Access to the path ‘C:\WINDOWS\system32.local-chromium’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at PuppeteerSharp.BrowserFetcher.d__22.MoveNext()<—
<—
<—

10-44-00.134: status transition from None to Failed.
@Viir can you please help me out? First run was perfect but at the second one all this things showed up please tell me what should i do

Thank you Pavel for sharing these observations. Looks like next month I will have time to look into improving the Tribal Wars 2 farmbot.

This problem occurs when the bot is started in the wrong working directory. To fix it, make sure the botengine executable file is in a directory where have full write access and start it directly from there.
(When you use a shortcut, make sure to adapt the working directory to match the directory that contains the botengine executable file)

Hello. If you have time, please edit the cycles. Attacks from 5 villages always stop at 196 farm attacks. I have 250 attacks, 50 from each village. Or at least advice on which parameter to change. Thanks peki

1 Like

Thank you for the update Peki.

I don’t think that there is a simple parameter to achieve this. Because of a bug we discovered in the Tribal Wars 2 report display UI. Because of that bug in the TW2 UI, interruptions of the bot become more frequent with larger number of farm villages.

This looks like we need an approach to work around the UI bug which currently interrupts the bot. Looking into this thread, I find this description of an alternative approach at Farm Manager - Tribal Wars 2 Farmbot (old version from 2018) - #209 by Viir

Would this approach work with the interface you are getting from Tribal Wars 2?

It is not a complete automation, but it already contains some assumptions about how the game UI works, and these assumptions could be wrong. If I had access to Tribal Wars 2 account set up, I could check this.

If you have time to log into a Tribal Wars 2 account and check what options there are to perform these tasks, this could help develop a bot faster:

  • Only knowing the coordinates, send an attack to these coordinates.
  • Only knowing the coordinates, check if there is a village there. Also, check if that village is owned by barbarians.

Maybe there is a better approach to farming :man_shrugging: so feel free to propose a different way :+1:

Hallo bin neu hier ich suche einen Farm Boot beziungsweise eine Attak Script für TW 2.
Ich hatte da was aber das funktioniert nicht mehr.
vielleicht kann mir jemand helfen

Danke

Would it be possible to implement a “feature” not paying while the bot is on a break?
I just bought 300000 credits, and 2000 credits an hour seems like a crazy price to pay
for some software that’s active for like 5 minutes each hour (given a 60*60 break in between cycles).
with this bot you effectively pay 2000 credits for 5 minutes, do you get what I mean?

Welcome, Giuseppe, and thank you for the feedback!

So you only use it for five minutes per hour? I will look for a solution for this scenario, that should reduce the price to a fraction. I will get to that when the new Tribal Wars 2 farm bot is ready.

Since you mention break duration: You always have the option to adjust the break length.

I indeed only use the bot for ca. 5 minutes at a time: the bot starts all new attacks, which takes an average of 5 minutes, going through all the pages etc. Then I need to wait for my troops to arrive at the target location, which is an average of 20 minutes + time to return another 20 minutes, totalling 40 minutes.

Did I get you right? You’re working on a new version of the bot? Got an ETA? Sick!

Yes, I am working on a new version. It will be more efficient and work better with large accounts.

If we find someone who tests unfinished versions of the bot, it could be ready in two weeks. I don’t have access to a suitable account at the moment. I can build one, but that takes more time.

I’d volunteer for that spot :slight_smile: if you decide to accept me you can just shoot me the .cs and I will gladly run it :wink:

1 Like

Great! I sent you a PM with the new farmbot.

The new Tribal Wars 2 farmbot is ready!

This version integrates what I learned from you about the farmbots from 2016 and 2018. Since it is more efficient and avoids the UI bug in the battle report display, it works much better on large accounts.

Also, this new version is easier to configure for multiple cycles and break duration.

The setup of the new bot is explained in the topic at Farm Manager - Tribal Wars 2 Farmbot

Thank you all for the feedback helping to make this farmbot so robust!