What's wrong with this? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
TigerYT

What's wrong with this?

12 Aug 2018, 13:25

Code: Select all

*Alt::
    toggle  := !toggle
    if (toggle = 1)
        Click, 484, 340
        Click, 484, 414
        Click, 484, 476
        Click, 484, 558
        Click, 484, 618
        Click, 780, 340
        Click, 780, 414
        Click, 780, 476
        Click, 780, 544
        Click, 780, 618
    else
        Click, 574, 340
        Click, 574, 414
        Click, 574, 485
        Click, 574, 558
        Click, 574, 635
        Click, 854, 340
        Click, 854, 414
        Click, 854, 485
        Click, 854, 558
        Click, 854, 635
Return
https://cdn.discordapp.com/attachments/ ... nknown.png
Alibaba
Posts: 472
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: What's wrong with this?  Topic is solved

12 Aug 2018, 14:01

Braces -> Blocks, and use == for checking equality. If you are checking Boolean values (true, false) however, you don’t even check for “== 1”, if will evaluate the variable itself:

Code: Select all

*Alt::
    toggle  := !toggle
    if (toggle)
    {
        Click, 484, 340
        Click, 484, 414
        Click, 484, 476
        Click, 484, 558
        Click, 484, 618
        Click, 780, 340
        Click, 780, 414
        Click, 780, 476
        Click, 780, 544
        Click, 780, 618
    }
    else
    {
        Click, 574, 340
        Click, 574, 414
        Click, 574, 485
        Click, 574, 558
        Click, 574, 635
        Click, 854, 340
        Click, 854, 414
        Click, 854, 485
        Click, 854, 558
        Click, 854, 635
    }
Return
"Nothing is quieter than a loaded gun." - Heinrich Heine

Return to “Ask For Help”

Who is online

Users browsing this forum: Bad husband, Bing [Bot], Icey and 23 guests