PoE-TradeMacro / POE-TradeMacro

Price checking script for Path of Exile.
https://poe-trademacro.github.io/
GNU General Public License v3.0
936 stars 189 forks source link

Custom Macros being executed on startup #1127

Closed Basoeckn closed 3 years ago

Basoeckn commented 4 years ago

AHK version: 1.1.32.00 Windows version: 10.0.18363

Since roundabout the new league, whenever I start the whole script, the first of my custom macros gets executed. I've tested it with a few macros and they all had this behaviour. Additionally, this does not confine to just the PoE window, but can also happen in other windows, if they are focused at the moment.

Nightblade commented 3 years ago

Could you attach your custom macro file?

Basoeckn commented 3 years ago

Here you go customMacros_example.txt

Nightblade commented 3 years ago

You have all your code in the "to be executed at script start" section -:)

There's some documentation here: https://github.com/PoE-TradeMacro/POE-TradeMacro/wiki/Custom-Macros

This should do what you want, assuming you've turned off the built-in F5 hotkey function:

; This is executed at script start.  Assign hotkeys to the labels further down.
CM_ExecuteCustomMacrosCode_Label:
    Hotkey, F5, CM_MyHotkey_Thanks
    Hotkey, 4,  CM_MyHotkey_PopsicleStick
    Hotkey, ^t, CM_MyHotkey_TheDee
Return

CM_MyHotkey_Thanks:
    SendInput {Enter}{asc 0037}Thanks, gl hf :){Enter}
Return

CM_MyHotkey_PopsicleStick:
    SendInput 4321
Return

CM_MyHotkey_TheDee:
    cmKeyDown := !cmKeyDown
    If cmKeyDown
        SendInput {d down}
    Else
        SendInput {d up}
Return
Basoeckn commented 3 years ago

I guess that makes sense, didn't catch it since it used to work like that until march