Secure Containers Protected from Settlers - AutoHotKey Cheat

Post » Sun Jan 24, 2016 11:59 pm

I was looking for ways to prevent settlers from taking valuable stuff from the workshops and containers. Some of the lengths people went to and their lack of success was surprising. I like the simplicity of a lockable safe so I made an AutoHotKey script for securely locking and unlocking a player created floor safe using the console with the convenience of one button. The safe requires a key to unlock it, so it shouldn't be pickable by any settlers. About halfway through, I realized I was making a one-button unlocking cheat, doh. I don't have a problem resisting cheats and also don't really care what someone else may use the script for in a single-player game, so I'm posting it anyway. It may help people with game problems rather than cheating.


To use it, just focus on the safe and press "u" to unlock and "l" to lock. If you don't own the safe that you are locking, it doesn't get set to requiring a key, just back to locked.


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



#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.

; #Warn ; Enable warnings to assist with detecting common errors.

SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.


; may need to increase these if on a slower computer?

short_wait=50 ; time in milliseconds

long_wait=250


; assuming a full screen window on 1080p monitor

x_mid:=1920/2 ; middle of the window

y_mid:=1080/2


open_console(short_wait, long_wait, x_mid, y_mid)

{ SetKeyDelay, 20, 50

SendEvent {vkC0sc029} ; the Grave Accent Key (unshifted tilde) on qwerty keyboards (???)

Sleep, %short_wait%

MouseMove, %x_mid%, %y_mid%

Click down

Sleep, %short_wait%

Click up

Sleep, %long_wait%

Return

}


close_console(short_wait, long_wait)

{

SetKeyDelay, 20, 50

Sleep, %short_wait%

Send, {ENTER down}

Sleep, %short_wait%

Send, {ENTER up}

Sleep, %long_wait%

MouseMove, 0, 0

Click down

Sleep, %short_wait%

Click up

Sleep, %short_wait%

SendEvent {vkC0sc029}

Sleep, %short_wait%

Return

}


; only map the keys when 'Fallout4' is in the active window's title

#IfWinActive, ahk_class Fallout4


u:: ; unlock a safe with no key via console

open_console(short_wait, long_wait, x_mid, y_mid)

Send, unlock

close_console(short_wait, long_wait)

Return


l:: ; lock a safe that requires a key via console

open_console(short_wait, long_wait, x_mid, y_mid)

Send, lock -1

close_console(short_wait, long_wait)

Return

User avatar
ILy- Forver
 
Posts: 3459
Joined: Sun Feb 04, 2007 3:18 am

Post » Mon Jan 25, 2016 10:39 am

Or...



simply select the storage container or doorway to your home so the ID appears in the console command. then enter "lock 10" which then locks the container or structure. Then when you open it, you have a novice difficulty opening it. This grants you experience as well as likes from your companions. so bonus.



I do this and always return to find settlers free from my home and my items still where I left them.

User avatar
Alkira rose Nankivell
 
Posts: 3417
Joined: Tue Feb 27, 2007 10:56 pm

Post » Mon Jan 25, 2016 1:57 am

That is a good idea. (Is it safe?) I finally got around to giving my settlers combat rifles and was surprised by the stuff they had in their inventories. From 72 pipe guns from my workshop in one to some of my legendaries and power cores from containers in others. I had thought containers at least were ok. Most posters seem to believe that it can't happen and must be caused by a bug or bad mods. Some even claim that settlers can get through our locks, hence my extreme measures. It would be nice to be sure that can't happen. Maybe I overreacted a little. I was kind of shocked.

User avatar
cheryl wright
 
Posts: 3382
Joined: Sat Nov 25, 2006 4:43 am

Post » Sun Jan 24, 2016 11:13 pm

It's quite simple to do this in the console without installing questionable third party software.


Lock 0-100 sets the level. 0 is unlocked, 1-25 is novice, 26-50 is advanced, 51-75 is expert, and 76-100 is master.



Click on the door with the console open, type 'lock x' where x is your desired lock level. Open the console, click on the door, and type 'unlock' to unlock the door, or simply pick the lock to gain some XP.



That being said, I'm very much looking forward to a mod that allows you to lock/unlock your built doors without using the console.

User avatar
Brooks Hardison
 
Posts: 3410
Joined: Fri Sep 07, 2007 3:14 am


Return to Fallout 4