Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Simple Script Works in Notepad, Not in Game Window [GTA IV, EFLC]



  • Please log in to reply
3 replies to this topic
Sern
  • Members
  • 2 posts
  • Last active: Apr 10 2014 07:21 PM
  • Joined: 09 Apr 2014

I feel like I've tried all the things but I'm hoping that's not true because if it is then I may not ever resolve the issue.

 

I'm trying to get the following script to run in EFLC (GTA IV: Episodes for Liberty City) eflc.exe

I searched Google with various searches looking for existing solutions and most of what I found were either posts that got no response like this one...

http://gtaforums.com...uring-gameplay/

 

Or the responses are a combination of outdated and in which the OP did not seem to clearly indicate what exactly solved their problem.

http://www.autohotke...start-a-script/

 

I have looked through the following documentation:

http://ahkscript.org/docs/Tutorial.htm

http://www.autohotke...ocs/KeyList.htm

http://www.autohotkey.com/docs/FAQ.htm

http://www.autohotke...ControlSend.htm

 

I have tried multiple Send methods including: Send, SendMode Input, SendMode Play, SendRaw, ControlSendRaw, and ControlSend.

 

SendRaw & ControlSendRaw work but neither do what I want. I want the F2 key to be pressed so that I can record on a loop in intervals of about 13 seconds because the in-game record function only records 15-20 seconds at most per key press. I am trying to capture and create footage at the same time so constantly pressing the F2 key makes things difficult.

 

I have gone through countless revisions of my F2 autohotkey script and this is just the one I'm working with now. I'm a novice with autohotkey so please be detailed in your responses else I may not fully understand.

 

Additionally, I have heard that Autohotkey has problems with fullscreen games or those without windowed borderless. Therefore I tried running the game in windowed only which did not seem to affect anything or at least did not get the desired result. I also tried windowed borderless using the following program found on the Steam forums, since GTA IV: Episodes for Liberty City does not have a built in windowed borderless graphics option.

 

http://forums.steamp...d.php?t=2675769

 

You'll notice the DL link is invalid. You can find a new upload of the software at post #307 here, http://forums.steamp...8&postcount=307

 

If you're interested in that program I already ran VirusTotal on it and Spybot S&D. It's clean.

#SingleInstance force
#InstallKeybdHook
#UseHook

stuff := false
SetKeyDelay 1000, 1000
SendMode Play

$F8::
IfWinExist EFLC
{
    WinActivate
}
else
{
    MsgBox, Could not locate EFLC game window.
}
IfWinExist EFLC (Not Responding)
{
    MsgBox, EFLC is a non-responding piece of shit. Please wait.
}
return

$Numpad1::
global stuff
Loop
{
    Send, {F2}
    Sleep 13000
    if stuff
        {
            stuff := false
                break
}
}
return


$Numpad3::
global stuff
stuff := true
return

Examples of what I've done recently with the in-game record feature:

 



Sanctus
  • Members
  • 283 posts
  • Last active: Dec 06 2014 04:05 PM
  • Joined: 30 Nov 2012

Tips you can try:

  • Run the game in windowed mode (AHK often has hard time working in FullScreen)
  • Setup Small sleeps between button presses for a "human-like" input (No code running too fast for the game to handle)
  • Run AHK in Administrator
  • Update AHK to newest patch

Don't think theres anything wrong with your code, this is definitely a AHK -> Game Issue


Check out ALL My Scripts  ;)


SnowFlake_FlowSnake
  • Members
  • 845 posts
  • Last active: Jan 24 2016 05:24 PM
  • Joined: 08 Oct 2012

Try my Send and Click Tool V3.2 if Sanctus tips doesnt work, good luck

 

 

http://www.autohotke...click-tool-v32/


  • Download link of my scripts on Autohotkey.com 2/10/2015 [DOWNLAND]
  • Contact Info:  https://github.com/floowsnaake //  FloowSnaake(A)gmail.com
  • IF you need Help send me a PM,Email or Post on Github

  • Quote by tank  Posted 29 September 2015 - 06:14 PM

  • "Eventually i will find a way to convert the DB back to PHPBB3. but i dont have the bandwidth right now. No one that has tried has had success. It is the Only way i can keep this open is if i could successfully convert it."

Sern
  • Members
  • 2 posts
  • Last active: Apr 10 2014 07:21 PM
  • Joined: 09 Apr 2014
✓  Best Answer

Tips you can try:

  • Run the game in windowed mode (AHK often has hard time working in FullScreen)
  • Setup Small sleeps between button presses for a "human-like" input (No code running too fast for the game to handle)
  • Run AHK in Administrator
  • Update AHK to newest patch
  •  

Don't think theres anything wrong with your code, this is definitely a AHK -> Game Issue

  • Tried running the game in windowed as well as windowed borderless. 
  • F2 was to be pressed in intervals of 13 seconds with a SetKeyDelay of 1k, 1k - I think that should have been enough.
    • I can confirm though that SetKeyDelay (reasonable #) is absolutely necessary because when trying without a SetKeyDelay using multiple input methods there was no response from the game 
  • Yes setting AHK to admin is the first thing I did after installing it yesterday.
  • As said above, it's as recent as it gets besides a pre-release build.

 

Try my Send and Click Tool V3.2 if Sanctus tips doesnt work, good luck

 

http://www.autohotke...click-tool-v32/

I did use your tool, thanks for providing it. I'm not sure if I can say 100 percent that this tool ensured we came to our solution but I can say it may have helped narrow things down or rule certain input types out.

 

Now I will post the definitive solution to this problem that it seems no one else on the internet, that I could find, could resolve in its entirety. A nice, copy/paste solution instead of delving through multiple topics and tweaking, testing, documentation rummaging...etc. Hopefully just a one size fits all solution.

 

This is extremely simplistic...but it works. I would have put this in code tags but doing so seemed to mess up the formatting.

 

  1. #SingleInstance force
  2. #InstallKeybdHook
  3. #UseHook
  4. #MaxThreadsPerHotkey 2
  5. SetKeyDelay 500, 500
  6.  
  7. recordingEnabled := false
  8. timeBetweenPresses = 13000
  9.  
  10. F8::
  11.         recordingEnabled := !recordingEnabled
  12.         if !recordingEnabled {
  13.                 SoundBeep,, 500
  14.                 return
  15.         }
  16.         Loop {
  17.                 if recordingEnabled
  18.                         Send, {F2}
  19.                 else {
  20.                         break
  21.                 }
  22.                 Sleep, timeBetweenPresses
  23.         }
  24.         return