(Fallout4) need some help GUI / console / Send

Ask gaming related questions (AHK v1.1 and older)
Detile
Posts: 7
Joined: 18 Nov 2015, 17:37

(Fallout4) need some help GUI / console / Send

19 Nov 2015, 06:34

Hello everyone,
I'm don't really like cheating in games, but i love spending time building tools to improve things.
Since Fallout 4 is a solo game, and all cheats codes are given, i feel more confident trying to build a trainer that for that game.
I think a understood the basis of AHK scripting, and i'm sure i miss so many features.
Anyway, i'm getting on my way, but still face to some problems.

what i want to do:
A trainer with a GUI, where you select items you want to spawn in your inventory or other stuff.
At start the script should activate the game window, open the console and type all the commands inside.

Hmmm, pretty easy for a first script, the wiki and forums are here, and i found nearly all i needed for my acheivment.

But, first problem : i can't open the console with AHK.
Nevermind, my workaround : i open a Msgbox and write the instruction inside : " In game, press ~ to open console, then F12 to send the instructions".
It's ok, i open manually the console, press F12, but now second problem, only a part of my text send from the script is present.
I tried the script in the notepad instead of the game and there, all is ok, the text is full written.
I'm pretty sure there is a workaround for that too, i tried to search the forums but without succes.
If you need my code i can paste it here, but since this is working in the notepad i don't really understand where is my mistake.
It look likes the game delete a random number of characters befrore whriting it in console.
Any help is welcome.
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 06:52

Try:
Open the console
Wait for the game to finish opening the console [ Sleep-command ]
Send instructions

I hope that gets you startet.
Last edited by wolf_II on 19 Nov 2015, 06:58, edited 1 time in total.
Detile
Posts: 7
Joined: 18 Nov 2015, 17:37

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 06:57

No, it still doesn't work.
When i try

Code: Select all

F12::
{	
	Send, t
	Sleep, 100
	Send, e
	Sleep, 100
	Send, s
	Sleep, 100
	Send, t
	Sleep, 100
	Send, {SPACE}
	Sleep, 100
	Send, o
	Sleep, 100
	Send, n
	Sleep, 100
	Send, e
	Sleep, 100
	Send {ENTER}
}
it works !
but if i add another full sentence, the game still delete some characters at the en

Code: Select all

F12::
{	
	Send, o
	Sleep, 100
	Send, n
	Sleep, 100
	Send, e
	Sleep, 100
	Send {SPACE}
	Sleep, 100
	Send, last test ;line added that the game delete patially
}
so i think it's a problem of Send mode, or Keydelays, something like that - not really sure of the terms
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 07:09

This is very interesting, letters get deleted at the end of the string ... I don't know any tips for that scenario, sorry.
grant
Posts: 323
Joined: 14 Oct 2015, 17:27

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 07:13

It might be that you are sending the keys too fast, you might want to check out:
https://autohotkey.com/docs/commands/SetKeyDelay.htm

Code: Select all

F12::
setkeydelay, 100	
Send, last test
setkeydelay, 0
return
EDIT yes, end of the string seems a bit odd I assumed that it was because he sent it as a single send command with no delays.
Detile
Posts: 7
Joined: 18 Nov 2015, 17:37

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 07:42

I thought you were my savior, but i'm affraid to announce you that it doesn't work.
Still some characters at the start (and not the end) are deleted.
the result is "t test" .

For a simple code who should looks like :
F12 ::
Send player.additem 0001F66B 1000; (or something like this cause there are specials caracters in it)

i have to write

Code: Select all

F12::
{	
	Sleep, 50
	Send,p
	Sleep, 50
	Send, l
	Sleep, 50
	Send, a
	Sleep, 50
	Send, y
	Sleep, 50
	Send, e
	Sleep, 50
	Send, r
	Sleep, 50
	Send, .
	Sleep, 50
	Send, a
	Sleep, 50
	Send, d
	Sleep, 50
	Send, d
	Sleep, 50
	Send, i
	Sleep, 50
	Send, t
	Sleep, 50
	Send,e
	Sleep, 50
	Send, m
    Sleep, 50
	Send, {SPACE}
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, 1
	Sleep, 50
	Send, F
	Sleep, 50
	Send, 6
	Sleep, 50
	Send, 6
	Sleep, 50
	Send, B
	Sleep, 50
	Send, {SPACE}
	Sleep, 50
	Send, 1
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, 0
	Sleep, 50
	Send, {;}
	Sleep, 50
	Send, {ENTER}
}
Funny :/ I'm the workaround guy ^^ but it will take ages to write :)
grant
Posts: 323
Joined: 14 Oct 2015, 17:27

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 08:36

You can use functions to shorten that a bit, especially when you start adding more additions.
You also might want to test out adding a delay to hold the key down for a bit, the game may be missing some of the really fast inputs.

anyway, look at the PM I sent you, you might find some help in the examples.
Detile
Posts: 7
Joined: 18 Nov 2015, 17:37

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 09:35

Thanks a lot for this PM Grant, i'm checking it - some interesting stuff to save me some time :)

This post to say that when i open the window with Script lines most recently executed, the script is waiting after:
045: WinActivate,Fallout4 ahk_class Fallout4 ahk_exe Fallout4.exe (0.25)
047: WinWaitActive (24.26)
The game windows lloks like not activated but pop up on my screen. Weird. And the hotkeys in the next part of the script are working well.
...
...
...
117: Send,0
118: Sleep,50 (0.05)
119: Send,{;}
120: Sleep,50 (0.05)
122: }
123: Return (4.04)
047: STILL WAITING (586.95): WinWaitActive
I play in windowed mode like i saw in some threads, execute the script with admin privileges, script is in UTF8, i modified the name with a dummy one, and i try after compiled it too...

----edit : :superhappy:
first step OK thanks to Grant for his tip. The script finally open the console. I had to delete the WinWaitActive command and change the code to

Code: Select all

WinActivate, Fallout4 ahk_class Fallout4 ahk_exe Fallout4.exe
;Run Notepad	;for tests
;WinWaitActive ; line deleted!!
sleep, 500
Send {ù down}
sleep, 20
Send {ù up}
sleep, 50
I think this tip can help me for my second problem.
So... next step ;)
Later
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 13:52

The setkeydelay command you are looking for is probably SetKeyDelay, 0, 50
The most common problem with games is that they need the key to be *held* for a certain amount of time, and that is the 2nd parameter in SetKeyDelay, not the first.
Detile
Posts: 7
Joined: 18 Nov 2015, 17:37

Re: (Fallout4) need some help GUI / console / Send

19 Nov 2015, 17:45

Thank you ! (not so) evilC. I will check that when my headache will stop and maybe update that in the next version^^

When the full version will be ok, i will upload the full ahk script in the appropriate section of this board if needed.
If some of you have this game and want to try the trainer, you can download it there http://www.nexusmods.com/fallout4/mods/1554/?
zdanman

Re: (Fallout4) need some help GUI / console / Send

11 Aug 2017, 15:58

Here is a simple AutoHotKey script to send the "tcl" (enables flying) console command real quickly

Remember to always call BlockInput before or after immitating the console in case the AHK macro is running WHILE the user is pressing a key...

Code: Select all

Process,Priority,,High

NumpadAdd::
BlockInput On
SetKeyDelay,100
Send,{Blind}{`` DownTemp}
Send,{Blind}{`` Up}
SetKeyDelay,-1
Send,{Blind}tcl  ; this is the console command
SetKeyDelay,100
Send,{Blind}{Enter DownTemp}
Send,{Blind}{Enter Up}
SetKeyDelay,100
Send,{Blind}{`` DownTemp}
Send,{Blind}{`` Up}
BlockInput Off
return
zdanman

Re: (Fallout4) need some help GUI / console / Send

11 Aug 2017, 16:00

Oh! and ALWAYS run AutoHotKey Scripts as Administrator

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: jameswrightesq and 143 guests