Page 1 of 1

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

Posted: 09 May 2024, 01:20
by luvvmisery
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()
}

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

Posted: 09 May 2024, 04:50
by boiler
The two lines where you assign true/false never execute because they are below a hotkey. See Structure of a Script.