[enhencement] Autosave.

Post Reply
BiZZ Keryear
Posts: 2
Joined: Mon Jan 20, 2014 8:45 am

Mon Jan 20, 2014 8:48 am

Sometimes if you have advanced in the game very far you only have to wait for things to happen, like resoearch or producing weapons (takes the most time of all productions).
Then it is a bit unfortune if the game crashes and you realise that you haven't saved in ages...

So I made this little script for Autohotkey:

Code: Select all

; made for Kenshi 0.59.1
CustomColor = EEAA99  ; Can be any RGB color (it will be made transparent below).
Gui, save:New
Gui, save: +LastFound +AlwaysOnTop -Caption +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, save:Color, %CustomColor%
Gui, save:Font, s32  ; Set a large font size (32-point).
Gui, save:Add, Text, vMyText cLime, Autosave active  ; XX & YY serve to auto-size the window.
; Make all pixels of this color transparent and make the text itself translucent (150):
WinSet, TransColor, %CustomColor% 150
return

+^a:: ;desired hotkey here in this case:  shift+strg+a 
if autosve = 1
{
	SetTimer autosave, off
	Gui , Save:Cancel
}
else
{
	ifwinexist ahk_class OgreD3D9Wnd
	{
		SetTimer autosave, 300000
		goto autosave
	}
}
return
autosave:
ifwinnotexist ahk_class OgreD3D9Wnd
{
	SetTimer autosave, off
	Gui , Save:Cancel
}
else
{
	Gui, save:Show, x0 y50 NoActivate  ; NoActivate avoids deactivating the currently active window.
	winactivate, ahk_class OgreD3D9Wnd
	SetKeyDelay , 400 , 400
	send {F5}
}
return
It shows a little overlay that it is active and pulls every 5 minutes Kenshi in foreground and "hits F5" / triggers a quicksave.

It will be actived (or deactivted if its already running) with shift + ctrl + a (It also deactivates if Kenshi isn't running.)

Autohotkey: http://www.autohotkey.com

Edit: I wish someone would tell me if they think if its unsefull for them as it was for me.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests