Restart D2 script v2.0

Page 1 of 4 1, 2, 3, 4  Next

View previous topic View next topic Go down

Restart D2 script v2.0

Post by Quirinus on Wed Nov 28, 2012 9:04 pm

UPDATE: New version available. This one stays active and auto-restarts D2 on error. It also has an installer that handles the shortcut and files.

Why?

One day while trying to farm A3 sewers I had to restart the game 15 times in a row, from which 5 produced an error. I got annoyed by having to constantly end the game process with the task manager and restarting it, so I decided to write a script that automatically does that. Now life is easier.



What does the script do?

Run the script. It starts minimized.

If Diablo II is not running, it starts it, otherwise it immediately restarts it.

Then it remains active and:
Checks for errors every second. If it finds an error it restarts the script/D2.
Checks if Diablo II is still running, if not it closes. (So if you just close D2 it will close as well.)

Pretty simple. Should work with W7 and Vista.



How to make it work?

Download the installer and run it. Choose your Diablo II folder path, if it isn't already chosen.



Problem?

Startup parameters
You can change them by editing 'restartD2.bat' and just removing them from this line:
start "Diablo II start" "%gamepath%" -w -skiptobnet
-w runs the game in windowed mode; lags less for me than full screen and I can write my items in a list or use some IM program while playing
-skiptobnet opens the realm login screen at startup; I love this, speeds things so much

If it doesn't close Diablo II, do this:
Right click the shortcut -> Properties -> Shortcut tab -> Advanced -> Run as Administrator.


Last edited by Quirinus on Fri Nov 30, 2012 7:26 am; edited 7 times in total

Quirinus
Creature of Flame

Bloody High Five
Posts : 5567
TGGood none
Country : Croatia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by iwansquall on Thu Nov 29, 2012 1:47 am

Do you know a way to make it windowed + dock it to top left screen?

Mine always run at centre, and i always have to drag it manually.

iwansquall
Blood Golem

Underpowered Admin
Posts : 2206
Country : Malaysia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by kambala on Thu Nov 29, 2012 2:32 am

Glide can remember window position Wink

kambala
Follower of Akarat

Posts : 1417
Country : Ukraine

View user profile http://worldofplayers.ru/forums/769/

Back to top Go down

Re: Restart D2 script v2.0

Post by noty on Thu Nov 29, 2012 2:52 am

Sorry to inform you , but your Batchscript wont work because of this:



This sneaky Errorwindow is hiding behind the overlay, and if you got luck, you can get back to the desktop if your playing in fullscreen and confirm.

As long this window exists, the game.exe is still listed as an active process.

I had the same idea back then and wrote 2 tools for starting and stopping Diablo:MXL, which is crashing due spritelimit without any chance getting back to desktop again.

I might release em on request.

noty
Moon Knight

Posts : 28
Country : ???

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by iwansquall on Thu Nov 29, 2012 2:57 am

Glide doesnt work multi-res isnt it?

At least i remembered it was damn ugly on windowed.


EDITED:
Found a solution, but still ugly as hell.
1. Run the game
2. Go to task manager
3. Right click on diablo 2 process
4. Select Maximize

Now the game dock perfectly at top left of screen. Best part of it? because it 'enlarge' the window border, it pretty much lock your mouse so you couldnt accidentally run it out of windows + unfocus/minimized the game Smile


EDITED 2:
Apparently not the best way. The settings is lost once you died and then save & exit. It will resize back to standard (i have multires, so it shrink) so you lose the 'unfocus' thingy. It still stayed at top left corner though.

iwansquall
Blood Golem

Underpowered Admin
Posts : 2206
Country : Malaysia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by Quirinus on Thu Nov 29, 2012 7:41 am

@noty wrote:Sorry to inform you , but your Batchscript wont work because of this:



This sneaky Errorwindow is hiding behind the overlay, and if you got luck, you can get back to the desktop if your playing in fullscreen and confirm.

As long this window exists, the game.exe is still listed as an active process.

I had the same idea back then and wrote 2 tools for starting and stopping Diablo:MXL, which is crashing due spritelimit without any chance getting back to desktop again.

I might release em on request.

Works for me. The error window is a child of Game.exe, as far as I know, and the taskkill parameter /t kills the whole tree (parent + children). /f forces the end of the process regardless if it's active or unresponsive.

@iwansquall wrote:Do you know a way to make it windowed + dock it to top left screen?

Mine always run at centre, and i always have to drag it manually.

Don't know about docking and remembering window position. I tried googling and this seems to be the answer: http://www.desksoft.com/WindowManager.htm



Maybe I'll write one that auto-restarts D2 upon an error, but there might be some problems with that.

Quirinus
Creature of Flame

Bloody High Five
Posts : 5567
TGGood none
Country : Croatia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by Quirinus on Thu Nov 29, 2012 5:00 pm

UPDATE: New version available. This one stays active and auto-restarts D2 on error. It also has an installer that handles the shortcut and files.

_____________________
"Zu jeder Zeit, an jedem Ort, bleibt das Tun der Menschen das gleiche."

Quirinus
Creature of Flame

Bloody High Five
Posts : 5567
TGGood none
Country : Croatia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by noty on Thu Nov 29, 2012 5:44 pm

Just tested:

http://imgur.com/JgS9C

Same as i told you. Smile

noty
Moon Knight

Posts : 28
Country : ???

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by Quirinus on Thu Nov 29, 2012 6:37 pm

@noty wrote:Just tested:

http://imgur.com/JgS9C

Same as i told you. Smile

Works for me on W7 and I assume it'd work on Vista, I guess it's a XP thing then (or is that Vista with XP look?). Thanks for testing. Let me see what I can do.

The problem is either in that it can't detect/kill the child error message box, or it doesn't have admin privileges to do so. Could you open up the cmd window and see what it says? (maybe remove @echo off if it doesn't display anything)

Quirinus
Creature of Flame

Bloody High Five
Posts : 5567
TGGood none
Country : Croatia

View user profile

Back to top Go down

Re: Restart D2 script v2.0

Post by noty on Thu Nov 29, 2012 7:59 pm

I dont need your tool, its (maybe) a nice thing for others, im just testing it for teh lulz.

Anyways, i gave it a shot and here is your screeny.

http://imgur.com/EHuW0

No Child-Window this time, but as you can see in the taskbar , Diablo is not responding, stated in german.



noty
Moon Knight

Posts : 28
Country : ???

View user profile

Back to top Go down

Page 1 of 4 1, 2, 3, 4  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum