blizzhackers / kolbot

d2bs: core + d2bot (noah) + kolbot libs (kolton) | January 2020's clone of https://github.com/kolton/d2bot-with-kolbot/ + further development
247 stars 160 forks source link

D2Bot crashed but the script is still running #122

Closed KKzLEO closed 4 years ago

KKzLEO commented 4 years ago

Hi,

The bot is awesome but today I want to use AutoMule function so I set up the mule config and AutoMule.js then I found out my D2Bot.exe will crash after the response time count down to 0.

The weird thing is that the D2Bot crashed but the script is still running and working fine.

Before the crash I saw the console of D2Bot.exe shows D2Bot shows d2bs is not responding... starting profile., so I changed the compatibility mode to window XP or win 7 and run as Administrator then the situation got worst that the scripts didn't execute.

The logs of d2bs:

[06/22/20 04:21:03] D2BS 18228: ÿc2D2BSÿc0 :: Engine startup complete!
[06/22/20 04:21:03] D2BS 18228: ÿc2D2BSÿc0 :: Switched to profile Sor
[06/22/20 04:21:03] D2BS 18228: ÿc2D2BSÿc0 :: Starting D2BotLead.dbj
[06/22/20 04:21:03] D2BS 18228: ÿc2D2BSÿc0 :: D2BotLead.dbj running.
[06/22/20 04:21:08] D2BS 18228: Heartbeat loaded
[06/22/20 04:21:08] D2BS 18228: Recieved Game Info
[06/22/20 04:21:16] D2BS 18228: Error: login time out 42
[06/22/20 04:21:34] D2BS 18228: D2BS Shutdown complete.

Event Viewer:

Application: D2Bot.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception
   at System.Diagnostics.ProcessManager.OpenProcess(Int32, Int32, Boolean)
   at System.Diagnostics.Process.GetProcessHandle(Int32, Boolean)
   at System.Diagnostics.Process.get_HasExited()
   at D2Bot.D2Profile.StopClient()
   at D2Bot.D2Profile.RestartClient(Boolean)
   at D2Bot.D2Profile+<>c__DisplayClass151_0.<Restart>b__0()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

The version of D2Bot is 20.6.7.100

Thanks

Fa-b commented 4 years ago

have you configured Automule.js to stop a profile that doesn't exist? Or stop the actual mule profile?

KKzLEO commented 4 years ago

I didn't set stopProfile. I made a GIF to demo my problem https://imgur.com/Uc1DNGa

Fa-b commented 4 years ago

This hasn't happened before you configured AutoMule.js? I'm guessing it is caused by misconfiguration then.. what starter is this profile Sor using? Sor is a MF profile right? It should resume using D2BotLead or whatever it had before. mule should be using the starter D2BotMule.

In AutoMule.js:

KKzLEO commented 4 years ago

This happened before I configured AutoMule, so I guess this issue is not related to AutoMule? My Sor config: https://imgur.com/QzX9VUU

Fa-b commented 4 years ago

The bot is awesome but today I want to use AutoMule function so I set up the mule config and AutoMule.js then I found out my D2Bot.exe will crash after the response time count down to 0.

This is misleading then..

Does it happen with older versions of D2Bot too?

KKzLEO commented 4 years ago

Sorry for misleading :(

I used D2Bot 19.3.3.100 + D2BS 1.6.3U and D2Bot 17.6.23.100 and it's the same.

And I tried to execute single player script but it didn't work.

Fa-b commented 4 years ago

I don't really get how this error is crashing D2Bot, but it appears the process handle of the client D2Bot wants to use to restart the profile (because of D2Bs appearing to be not responding which seems to be the actual error here) is corrupted/invalid for some reason. If the handle was null, D2Bot should not be crashing imo.

Are you sure you are running everything as x86? Don't force any compatibility please. Also, has the setup ever worked for you?

KKzLEO commented 4 years ago

My OS is windows 10 64bit. I checked I installed the c++ 2008, 2010 with x86 version and .NET 4.0. How do I check everything is running as x86?

BTW, I found the logs/exception.txt shows

System.ComponentModel.Win32Exception (0x80004005): **Access is denied**
   at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
   at System.Diagnostics.Process.get_HasExited()
   at D2Bot.D2Profile.StopClient()
   at D2Bot.D2Profile.StopThread()
   at D2Bot.Main.HandleAction(D2Profile d2p, ProfileAction pa)
   at D2Bot.Main.<>c__DisplayClass53_0.<WorkThread>b__0()
KKzLEO commented 4 years ago

Hi

I installed VMBOX and created a win 7 32 bit VM. It's working perfectly now.

Seems my system environment has some issues? But I decide to give it up and change to use VM to run the bot. Anyway, thank you for your kind assistance.

Fa-b commented 4 years ago

I really don't know what could be causing it on your base system.. good to hear it works for you on a VM.

I think this can be closed, it's unclear if this issue is caused by D2Bot or rather the environment.

KKzLEO commented 4 years ago

I guess the issue is caused by windows update because I remember my first run works perfectly. I have a long time not to update the windows.... I disabled all the windows update related config but seems they still updated my windows automatically after my first run.

Close this issue because the VM solution works. Thank you again