Monday, February 07, 2005

Ok timeout

Thought I'd Take a moment to mention I started scripting some shortcuts for writing this blog using a program called AutoHotKey. First I used it to make typing things like Caius Cosades as easy as typing cc then I realized I could something REALLY useful like auto-save my game every five minutes. The script with commentary is enclosed below. To use it just install AutoHotKey, paste this code into notepad and save the file with extension AHK.

; *** Start morrowind auto-save script here ***
; *** you must install autohotkey to make this work

; Glitch: the SetTitleMatchMode line tells the script to find a window that says
; "morrowind" and ONLY morrowind however start another window that somehow has
; morrowind only in it and this script may act on that one.
; Of course if you play in full-screen that will not be much of an issue.

SetTitleMatchMode, 3 ; match *exactly* Morrowind

IfWinNotExist, Morrowind
{
MsgBox, 4, Morrowind?, Open Morrowind to play?

IfMsgBox, No
{
Return
}

; adjust game path to your own

Run, G:\Program Files\Bethesda Softworks\Morrowind\Morrowind Launcher.exe, G:\Program Files\Bethesda Softworks\Morrowind

}

Sleep, 120000 ; lets wait 2 minutes for the user to load morrowind and the save game (comment to skip)

loop ; normally infinite loops are bad...
{
IfWinNotExist, Morrowind
{
return ; but this one auto-exits after it finds no morrowind window
}

IfWinExist, Morrowind
{
IfWinActive, Morrowind
{ ; the first number in the below line is time in ms.
; how long between each auto-save in other words
; 300000 translates to 5 minutes by my calculations (5 * 60 * 1000)
; the second number is how long the key pressed
; according to the autohotkey FAQ that's a necessary entry with some DirectX games.

SetKeyDelay, 300000,20
Send, {F5}
}
}
}
; *** End morrowind auto-save script here ***


For another example here's some common Morrowind-related things you may have to type in somewhere for some reason. Same as above put in notepad and name with AHK extension:

; **** start script-key ****
::cc::Caius Cosades
::bal::Balmora
::hhl::House Hlaalu
::rhl::Ralen Hlaalo
::dth::Drarayne Thelas
::bcl::Bacola Closcius
::fmo::Fort Moonmoth
::lvo::Larrius Varro
::aru::Ald'ruhn
::snu::Seyda Neen
::ehe::Ebonheart
::gni::Gnisis
::gda::General Darius
::ile::Imperial Legion
::ner::Nerevarine
::efe::Eydis Fire-Eyes

; *** end script key ***

0 Comments:

Post a Comment

<< Home