Script not running

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
didimaox
Posts: 22
Joined: 02 Feb 2022, 07:21

Script not running

Post by didimaox » 28 Nov 2022, 12:30

Hello

I have been using autohotkey without issues for quite some times, but today my script couldn't run.

In fact, in doesnt even appear in windows task manager.

I tried uninstalling/reinstalling it, running as administrator, opening with autohotkey...Nothing works.

Thanks for helping me :)

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 28 Nov 2022, 12:42

Hello,

You could add the process or folder as an exclusion to your antivirus software. After doing that, test a one-line hotkey subroutine that displays a message box.

didimaox
Posts: 22
Joined: 02 Feb 2022, 07:21

Re: Script not running

Post by didimaox » 28 Nov 2022, 12:58

hello

i tried to exclude both the script and the autohotkey folder from my antivirus. I also tried completely disabling it, and it still doesn't work :/

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 28 Nov 2022, 13:12

When you look in Task Manager, what do you seek for verification that AutoHotkey is running?

You can test a batch file that runs AutoHotkey, using your script on the command line. https://www.autohotkey.com/docs/Scripts.htm#cmd

In a reply below, you can post the code for the script that you are running.

Does one specific script fail to run, or all scripts?

What is your file extension for scripts?

What version of AHK have you uninstalled and reinstalled?

Are multiple versions of AutoHotkey installed, or multiple locations?

geek
Posts: 1052
Joined: 02 Oct 2013, 22:13
Location: GeekDude
Contact:

Re: Script not running

Post by geek » 28 Nov 2022, 13:37

Some games' anti cheat platforms will forcibly prevent AHK from running while the game is open. Could it be something like that?

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 28 Nov 2022, 13:39

geek, I am curious to know which games do that.

didimaox
Posts: 22
Joined: 02 Feb 2022, 07:21

Re: Script not running

Post by didimaox » 28 Nov 2022, 14:11

Hello, thank you for your answers

When you look in Task Manager, what do you seek for verification that AutoHotkey is running?

Background processes and running applications

Does one specific script fail to run, or all scripts?

None of my scripts are currently working

What is your file extension for scripts?

.ahk

What version of AHK have you uninstalled and reinstalled?

1.1.35

Are multiple versions of AutoHotkey installed, or multiple locations?

No just one

Some games' anti cheat platforms will forcibly prevent AHK from running while the game is open. Could it be something like that?

I've tried the script when no game is running, same result


Here's the script i'm trying to use, it is a very simple one:

Send {S 4}

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 28 Nov 2022, 14:16

As I mentioned, try running a hotkey subroutine that displays a message box.

Code: Select all

F3::MsgBox, 64, Test, Test!
When you run the script, see if AutoHotkey.exe is present in the Details tab of Task Manager.

If you have games running, you can close them first.

This is a one-line script, with no other code, and no other scripts running.

You also try from CMD command-shell window.

Code: Select all

"c:\Program Files\AutoHotkey\AutoHotkey.exe" "d:\temp2\temp23.ahk"
That is the path to my script; you would replace it with yours.

didimaox
Posts: 22
Joined: 02 Feb 2022, 07:21

Re: Script not running

Post by didimaox » 28 Nov 2022, 15:10

Your script is running fine, but mine still doesn't work somehow.

I can't figure what is wrong with it though.

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 28 Nov 2022, 15:58

Now we're getting somewhere. :)

Some possibilities:
1. When you send text, the wrong window is active. This can be determined by activating Notepad before you trigger your hotkey (as a test). Unless your script activates a window, waits for a window, specifies a target window in some other way, or uses a hotkey, the wrong window is likely to be active at any moment.
2. Your target window is elevated or blocks scripting. This can be determined if the script works in other windows. You can try UI Access (admin as a last resort). See documentation.
3. Your script exits or is terminated before you can notice anything. This can be determined by verifying that the script is still running.
a. Another program terminates your script.
b. Your script exits or ends itself. The script that you posted is not persistent and so will exit when the end of the script is reached. A different script may have different results (as you saw from my script).
4. The script contains a bug.

Whenever I see a post that says, "My script worked yesterday but not today", it's usually because the author changed the script!

garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Re: Script not running

Post by garry » 28 Nov 2022, 16:20

Here's the script i'm trying to use, it is a very simple one:
Send {S 4}
example for test , send to notepad > SSSS

Code: Select all

#persistent
run,notepad
return

$F9::
Send {S 4}
return
esc::exitapp

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Script not running

Post by boiler » 29 Nov 2022, 00:44

mikeyww wrote: geek, I am curious to know which games do that.
These are probably not the kind of games you’re thinking of or that geek is referring to, but the geolocation software in New Jersey that ensures you are within the state’s boundaries when playing their online casino/poker games also does a check for AHK processes and will not let you make real money bets while one is running. However, compiled AHK scripts are not detected. :shh: :mrgreen:

I am guessing that the other states that have legalized online gambling have implemented the same or similar software. I know they do the geofencing part.

didimaox
Posts: 22
Joined: 02 Feb 2022, 07:21

Re: Script not running

Post by didimaox » 29 Nov 2022, 05:31

Hello

Thanks to everyone's help, i just changed my script to

$S::
Send {S 4}

and it now works !

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Script not running

Post by mikeyww » 29 Nov 2022, 06:02

Since the script did not appear in Task Manager, the most likely event is that the script ran, sent the key to the wrong window, and immediately exited. Glad it works now! :thumbup:

Thanks, boiler, for the interesting information about the NJ casino. Regarding games, geek referred to
forcibly prevent AHK from running
That sounds like a game that would actually terminate an AHK process, so I was curious if there were any of those. The NJ system sounds like games that instead alter their own behavior in the presence of an AHK process.

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Script not running

Post by boiler » 29 Nov 2022, 06:15

Ah, I missed that distinction. Thanks for pointing that out.

Post Reply

Return to “Ask for Help (v1)”