Backup tool
I realized that one reason my turns go so slow even in SP is because, having spent hours or days developing a strong gaming position, I don't want to throw it away with stupid errors like forgetting to re-hire Obscuro when I badly need an air mage. It makes me paranoid and I check everything thrice. (It's sort of the same reason that makes Axis and Allies play so slowly if you're playing against someone who rigidly enforces the phases and won't let you attack if you make a noncombat move.) So, I decided to address this by writing a quick little Python script that backs up my files each turn.
Remember that the distinction between a script and a program is that a program is opaque and a script is transparent and meant to be fiddled with by the end user--i.e. my error handling in this script is not robust. Oh well. You may still find it useful. Save it to your dom3 root directory and run dom3 with the --preexec switch and the name of the game you'll be playing. On Windows this would be
dom3 --preexec "backup.py <gamename>"
Yeah, I know, having to type in the name of the directory to back up is onerous, etc. Maybe I'll fix it later but right now this is what I'm using.
-Max
edit: That's funny. The attachment is gone, and there's no option to create a new one. I'll paste in the text here directly, although now maybe I'll use Ich's version instead. My script:
import sys
import os
if len(sys.argv) != 2:
print "Usage: backup <gamename>"
exit()
def execute(cmd):
print cmd
os.system(cmd)
gamedir = 'savedgames\%s' % sys.argv[1]
print 'Backing up', gamedir
execute('cd %s' % gamedir)
execute('mkdir %s\\backup' % gamedir) # Could already exist, but oh well, ignore the error
execute('erase %s\\backup\\* /Q' % gamedir)
execute('copy %s\\* %s\\backup /Y' % (gamedir, gamedir))
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"
["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
|