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

[GUIDE] DB Refresher - Keep your DB bots running at top performance! (Source Code)

vegasmoney

New Member
Joined
Jun 7, 2012
Messages
13
Reaction score
2
DB Refresher


2012-07-11 3:44PM /update/ - Working on a new version! It will have more features, some 'bells and whistles', and will be a lot more friendly on the configuration. If you have any feature requests or anything, now is the time to let me know :)

2012-07-05 8:59PM v1.0 - First public release! Please give feedback and/or feature requests. If you like the script, let me know!

--------------------------------------------------


Info:

I made this script initially for personal use. Since friends have used it and love it, I've decided to share it here. I thought I was the only one, but apparently everyone drastically loses performance on their DB bots the longer time DB/D3 runs without a restart.

This is an AutoIt script. You will need AutoIt to compile and use it. You can get AutoIt @ AutoIt - AutoItScript

Features of the script:
  • Restart your DB bots after X hours
  • Toggle on/off status display messages
  • Ability to specify which monitor status messages display on
  • Random timer between stopping and restarting bots (time range is configurable)
  • Can specify a different D3 installation for each bot
  • (In Testing) After restarting bots the script can resize, position, and/or tile the windows as you like (It's in the code currently, but disabled by default)
  • (Coming Soon) Support for 20+ bots, maybe unlimited (Currently the script supports 1 to 3 bots)
  • (Coming Soon) Script can change profiles after a restart. Possibly I will add the ability to randomly choose a profile per bot.

This script/app/tool will always be offered in source code, and source code only.



Newbie Help:

Not a programmer? No worries, you can still use DB Refresher! First you need to get AutoIT from the link above and make sure you get the installer that includes "SCiTE". Once AutoIt is installed, you can right click the .au3 file and then click "Edit Script". At the top of the script is the part you want to edit. You will want to start at "CONFIG STARTS HERE" and stop editing/configuring when you see "CONFIG ENDS HERE".

Once you have the script configured to your liking, save it. Next, right click the script (.au3 file) and choose "Compile Script". It will make the script into an .exe file. Now you can run the script by just double clicking it. To stop the script at anytime, you can close it from your taskbar. The icon for the script is a blue circle with a white triangle in it. I might have a friend make a custom icon so it will make it even easier to find for you guys.

If you have any questions, post in the thread.



Source Code:

Code:
;############################################
;#   DemonBuddy Refresher [DB Refresher]
;#   by vegasmoney (vegasmoney @ DemonBuddy)
;#
;# NOTES:  Restarts Diablo 3 bot DemonBuddy
;#         every X hours.
;############################################

#RequireAdmin

;##### CONFIG STARTS HERE #####

;On/Off for status display -- Only shows info when it needs to ("1" = ON, "0" = OFF)
$displaytoggle = 1

;Which monitor for status messages to display? ("1" = monitor #1 , "2" = monitor #2)
;If you aren't sure, put "1"
$monitordisplay = 2

;Number of bots (DemonBuddy + D3 clients) you are running.
;(example: "3" would mean 3 DB's and 3 Diablo3's)
$numberofbots = 2

;How many hours to wait between restarts?
$hoursuntilrestart = 4

;Minimum time (in minutes) to wait between stopping DB/D3 and then starting them up again
;(If you are having session lock issues, set this to 5)
$minrestarttime = 3

;Maximum time (in minutes) to wait between stopping DB/D3 and then starting them up again
;(Make sure this is higher than minimum time setting above)
$maxrestarttime = 5

;Path to DB with Demonbuddy.exe (MUST be in quotes)
$dbpathandfile = "E:\_DOWNLOADS\dbuddy\DemonBuddy\Demonbuddy.exe"

;DB Key (MUST be in quotes)
$dbkey = "1A2B3C4D5E6F7G9Hx123"

;Battle.net account (MUST be in quotes)
$bnetaccount01 = "[email protected]"

;Battle.net password (MUST be in quotes)
$bnetpw01 = "mypassword123"

;Path to Diablo 3 with Diablo III.exe (MUST be in quotes)
$d3pathandfile01 = "C:\Program Files (x86)\Diablo III\Diablo III.exe"

;DB Profile to use, include path (MUST be in quotes)
$dbprofile = "E:\_DOWNLOADS\dbuddy\DemonBuddy\_[Barbarian] Sarkoth Farm-Apoc01.xml"

;DB Routine to use, do not include path (MUST be in quotes)
;(examples: "Mammon All-in-One Ver.1.0.0.23" or "Belphegor All-in-One")
$dbroutine = "Mammon All-in-One Ver.1.0.0.23"

;ONLY if you are using more than 1 account/bot, add the extra Bnet user and passwords here
;Use format below (max supported bots currently is 3, will be unlimited in future version)
$bnetaccount02 = "[email protected]"
$bnetpw02 = "mypassword123"
$d3pathandfile02 = "F:\1installed\Diablo III-2\Diablo III.exe"

$bnetaccount03 = "[email protected]"
$bnetpw03 = "mypassword123"
$d3pathandfile03 = "F:\1installed\Diablo III-3\Diablo III.exe"

;##### CONFIG ENDS HERE #####

;-----------------------------------------------------------------------------
;----------------------------- DO NOT EDIT BELOW -----------------------------
;-----------------------------------------------------------------------------

Global $minresttime = $minrestarttime * 60000
Global $maxresttime = $maxrestarttime * 60000

Global $secstorestart = $hoursuntilrestart * 3600000

Global $dbfullparams01 = "-key " & $dbkey & " -bnetaccount " & $bnetaccount01 & " -bnetpassword " & $bnetpw01 & ' -d3path="' & $d3pathandfile01 & '" -profile="' & $dbprofile & '" -routine="' & $dbroutine & '" -autostart -noflash'
Global $dbfullparams02 = "-key " & $dbkey & " -bnetaccount " & $bnetaccount02 & " -bnetpassword " & $bnetpw02 & ' -d3path="' & $d3pathandfile02 & '" -profile="' & $dbprofile & '" -routine="' & $dbroutine & '" -autostart -noflash'
Global $dbfullparams03 = "-key " & $dbkey & " -bnetaccount " & $bnetaccount03 & " -bnetpassword " & $bnetpw03 & ' -d3path="' & $d3pathandfile03 & '" -profile="' & $dbprofile & '" -routine="' & $dbroutine & '" -autostart -noflash'


While 1
   TTDisplay()
   ;asks if user wants an immediate run, this only happens once
   $runonstart = MsgBox(36, "DB Refresher", "Run DB Refresh now?  (YES = Kill any DB/D3 currently running and restart, NO = Just start the timer until the next restart)", 30)
   If $runonstart = 6 Then
	  If $displaytoggle = 1 Then TTSend("Ending DB and D3 Processes...")
	  ;if user wants immediate run kill db/d3 
	  For $i = 1 To $numberofbots
	  $DBclose = ProcessClose("Demonbuddy.exe")
	  Sleep(250)
	  If $DBclose = 0 Then WinKill("Demonbuddy")
	  $d3close = ProcessClose("Diablo III.exe")
	  Sleep(250)
	  If $d3close = 0 Then WinKill("Diablo III")
	  Sleep(500)
	  Next
   ;wait user inputted time until restart
   If $displaytoggle = 1 Then TTSend("Waiting " & $minrestarttime & " to " & $maxrestarttime & " minutes until restart...")
   Sleep(Random($minresttime, $maxresttime, 1))
   ;now restart
   If $displaytoggle = 1 Then TTSend("Restarting DB and D3...")
   ;~For $i = 1 To $numberofbots
   If $numberofbots = 1 Then
	  ShellExecute($dbpathandfile, $dbfullparams01)
	  Sleep(15000)
   ElseIf $numberofbots = 2 Then
	  ShellExecute($dbpathandfile, $dbfullparams01)
	  Sleep(15000)
	  ShellExecute($dbpathandfile, $dbfullparams02)
	  Sleep(15000)
   ElseIf $numberofbots = 3 Then
	  ShellExecute($dbpathandfile, $dbfullparams01)
	  Sleep(15000)
	  ShellExecute($dbpathandfile, $dbfullparams02)
	  Sleep(15000)
	  ShellExecute($dbpathandfile, $dbfullparams03)
	  Sleep(15000)
   EndIf
   ;~Next
   EndIf

;Main loop starts here
   While 1
	  If $displaytoggle = 1 Then TTSend("")
	  ;wait X hours (set in config)
	  Sleep($secstorestart)
	  ;kill db and d3 process(es)
	  If $displaytoggle = 1 Then TTSend("Ending DB and D3 Processes...")
	  For $i = 1 To $numberofbots
	  $DBclose = ProcessClose("Demonbuddy.exe")
	  Sleep(250)
	  If $DBclose = 0 Then WinKill("Demonbuddy")
	  $d3close = ProcessClose("Diablo III.exe")
	  Sleep(250)
	  If $d3close = 0 Then WinKill("Diablo III")
	  Sleep(500)
	  Next
	  If $displaytoggle = 1 Then TTSend("Waiting " & $minrestarttime & " to " & $maxrestarttime & " minutes until restart...")
	  ;wait user inputted time until restart
	  Sleep(Random($minresttime, $maxresttime, 1))
	  If $displaytoggle = 1 Then TTSend("Restarting DB and D3...")
	  ;now restart
	  ;~For $i = 1 To $numberofbots
	  If $numberofbots = 1 Then
		 ShellExecute($dbpathandfile, $dbfullparams01)
		 Sleep(15000)
	  ElseIf $numberofbots = 2 Then
		 ShellExecute($dbpathandfile, $dbfullparams01)
		 Sleep(15000)
		 ShellExecute($dbpathandfile, $dbfullparams02)
		 Sleep(15000)
	  ElseIf $numberofbots = 3 Then
		 ShellExecute($dbpathandfile, $dbfullparams01)
		 Sleep(15000)
		 ShellExecute($dbpathandfile, $dbfullparams02)
		 Sleep(15000)
		 ShellExecute($dbpathandfile, $dbfullparams03)
		 Sleep(15000)
	  EndIf
	  ;~Next
   WEnd
WEnd

Func TTDisplay()
   If $displaytoggle = 1 Then
	  If $monitordisplay = 1 Then
		 Global $monitorx = 0
	  ElseIf $monitordisplay = 2 Then
		 Global $monitorx = 1920
	  EndIf
   EndIf
EndFunc

Func TTSend($var)
   ToolTip($var, $monitorx, 0)
EndFunc



Downloads:

View attachment apt-db_refresher-v1.0.zip


If you like the script, please hit +rep at the bottom left and/or +like at the bottom right of this post!
 
Last edited:
I'm guessing that a "relogger" like this can't support authenticator-protected accounts right?
 
I'm guessing that a "relogger" like this can't support authenticator-protected accounts right?

I dont think any relogger can support authenticator, Unless someone wants to add in authentication support.

There is open source authenticator program called winauth - Battle.net / World of Warcraft / Diablo III Authenticator for Windows and Windows Mobile - Google Project Hosting "winAuth" if they used that code in a relogger im sure it would be possible but alot more extra work involved.

Can be run from the command line: (really to help with multi-boxing with more than one authenticator - most people don't need this)

winauth.exe [-min] [-p password] <authenticator-xml-file>

where:
-min to start WinAuth minimized
-p is explicit password to decrypt authenticator
<authenticator-xml-file> is the XML file containing your authenticator

Found that just edited so it is possible ask and he may add support. Obviously you would have to remove your current auth key, and use the digital one.
 
Last edited:
btw vegasmoney,

;ONLY if you are using more than 1 account/bot, add the extra Bnet user and passwords here
;Use format below (max supported bots currently is 3, will be unlimited in future version)
$bnetaccount02 = "[email protected]"
$bnetpw02 = "mypassword123"
$d3pathandfile02 = "F:\1installed\Diablo III-2\Diablo III.exe"

$bnetaccount03 = "[email protected]"
$bnetpw03 = "mypassword123"
$d3pathandfile03 = "F:\1installed\Diablo III-3\Diablo III.exe"

If you do: "F:\1installed\Diablo III\Diablo III.exe" -launch you can load from 1 client instead of making 8gig x each client in your hdd. thats what i do with innerspace i use 1 install to run as many games as i want, The main install loads an extra Cache folder for each client it loads with around 200mbs in them.
 
Last edited:
I'm not able to login.. Just stays at login screen... any advice?
 
btw vegasmoney,



If you do: "F:\1installed\Diablo III\Diablo III.exe" -launch you can load from 1 client instead of making 8gig x each client in your hdd. thats what i do with innerspace i use 1 install to run as many games as i want, The main install loads an extra Cache folder for each client it loads with around 200mbs in them.

1 install is supported, put the same path\to\diablo iii.exe . The reason it's like that is so you CAN use different installs if you want. The idea is full configurability.
 
Last edited:
interesting. will post back with some questions in a bit.

;Path to Diablo 3 with Diablo III.exe (MUST be in quotes)
$d3pathandfile01 = "C:\Program Files (x86)\Diablo III\Diablo III.exe"

Are you able to load ISBoxer profile instead of just the Diablo exe?

for example: in this thread http://www.thebuddyforum.com/demonbuddy-forum/59628-plugin-request-isboxer-loader.html

I'd have to look into ISBoxer, but possibly. If this is requested a lot I'll definitely look into how it can be done for you guys.
 
I'm not able to login.. Just stays at login screen... any advice?

Well, DB actually does all of the actual d3/bnet login process. Download latest DB? I'm not sure really.

Once DB launches, it's completely out of the hands of the script and completely in the hands of DemonBuddy.
 
I'm guessing that a "relogger" like this can't support authenticator-protected accounts right?

Well, my authenticators only ask for a key like once a week at the very most (assuming logins are coming from same PC). As long as you've entered it in recently, you should be fine to not have to worry about it.

As far as authenticator support in the script, I strongly doubt it.
 
I'd have to look into ISBoxer, but possibly. If this is requested a lot I'll definitely look into how it can be done for you guys.

ISBoxer: premium MMORPG multiboxing software - Free 7 day trial.

ISBoxer is awesome program for loading and resizing windows to really really small + allowing u to do certain window makeups like i have set, heaps of tiny 150x100 windows with an inactive big window so when i click on the small windows and do the hotkey it opens or transfers the small window into the big inactive window so i can see whats going on. and press hotkey again to send it back to small window leaving the big window inactive again.

Its much better then normal load windows as u can manage resources better, and at 40$ a year its a great deal. however.. The problem im facing is with DB i think. As i cannot get it to login

I also tried the DB batch file which runs the program but never logs in...
 
Getting a launch error after compiling the *.au3 of:

AutoIt Error
Line 19 (File C:\Users\<my user name>\Desktop\apt-db_refresher-v1.0.exe"
Error: Variable used without being declared

Using Notepad++ to do the script edit before compilation, Line 19 is actually a space between arguments.

Suggestion?
 
Getting a launch error after compiling the *.au3 of:

AutoIt Error
Line 19 (File C:\Users\<my user name>\Desktop\apt-db_refresher-v1.0.exe"
Error: Variable used without being declared

Using Notepad++ to do the script edit before compilation, Line 19 is actually a space between arguments.

Suggestion?

That means you didn't properly edit the "CONFIG" section of the script (the top part). AutoIt only counts actual lines of codes, not lines that are commented out or spaces. So if you want to find out which line that was, count down from the top only counting lines that are not commented out and that have text.


EDIT: According to my count, line 19 = $bnetpw03 = "mypassword123"

If you aren't using more than 1 bot you can leave the config's for bot #2 and bot #3 unedited. Or if you are using 2, leave #3 unedited.

EDIT #2: In the next version I will fix this so if you aren't using those bots it doesn't matter what you have for those bot configs.. or lack of.
 
Last edited:
UPDATE: I updated the main thread post and like it says, I'm working on a new version. I already have a few features I'm adding and also some code-cleanup I'm doing, but if you have any feature requests, now is the time to make them. :)
 
Last edited:
Back
Top