Script that runs different loop depending on which option is set to true

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
luvvmisery
Posts: 1
Joined: 09 May 2024, 01:09

Script that runs different loop depending on which option is set to true

09 May 2024, 01:20

I've been trying to make a script that runs a different loop depending on which option I have set to true. I've tried a few ways, but they never seem to work.
Here's what I've got so far:

Code: Select all

E::exitapp

;Config
Option_1 := true
Option_2 := false

CheckConfig() {
    if (Option_1)
    Option1()

    if (Option_2)
    Option2
}

Option1 {
    Loop {
        Send, Option
        Send, One
        Send, Selected
    }
}

Option2 {
    Loop {
        Send, Option
        Send, Two
        Send, Selected
    }
}

Q::
{
CheckConfig()
}
User avatar
boiler
Posts: 17188
Joined: 21 Dec 2014, 02:44

Re: Script that runs different loop depending on which option is set to truec

09 May 2024, 04:50

The two lines where you assign true/false never execute because they are below a hotkey. See Structure of a Script.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 67 guests