I finally got it to work. It turns out I was using a key combo to toggle the macro that conflicted with other keys used by the game, so it wasn't switching on like it was supposed to. I changed the toggle to something that isn't already assigned to a function in Skyrim, and it worked fine. This is what I'm using for crafting:
Code:
Rctrl::Toggle := Toggle ? 0 : 1
~R:: ;For Alchemy
If Toggle = 1
Loop
{
GetKeyState, var, R, P
If var = U
Break
Send R
sleep 50
}
Else
return
~Y:: ;For Smithing, cooking, etc.
If Toggle = 1
Loop
{
GetKeyState, var, Y, P
If var = U
Break
SetKeyDelay 0, 50, Play
Send {Enter}{Y}
sleep 50
}
Else
return
~X:: ;For Enchanting
If Toggle = 1
Loop
{
GetKeyState, var, X, P
If var = U
Break
SetKeyDelay 50, Delay
Send {R}
sleep 50
Send {Y}
sleep 50
Send {S}
sleep 50
Send {E}
sleep 50
Send {D}
sleep 50
}
Else
return
~H:: ;For Atronach Forge or repeated activations
If Toggle = 1
Loop
{
GetKeyState, var, H, P
If var = U
Break
Send {E}
sleep 100
}
Else
return
Right-Ctrl switches the macro on and off. For Alchemy, I just select the ingredients and hold down R, and I can crank out a hundred potions every 5 seconds. For Smithing, I use SkyUI to sort the list so I can highlight the item I want to craft, then hold down Y to spam craft that. For Enchanting, I remove every blank item from my inventory except the stack that I want to enchant en masse, and every filled soul gem except for the stack I intend to use. Before I hold down the hotkey, I select the item, then go to the enchantments list and position the mouse on the enchantment right above the one I want, typically the most expensive like Turn Undead, Damage Stamina, or Banishment. This will allow it to repeatedly select the same enchantment for each loop. Finally, the last one is for whenever you have to just spam the E key, like when you're using the Atronach Forge to create a lot of atronach salts at once.
Here is the macro I use for rapid-fire, which is useful for training weapon skills.
Code:
Rshift::Toggle := Toggle ? 0 : 1
~LButton::
If Toggle = 1
Loop
{
SetMouseDelay 50
Click down
Click up
If (GetKeyState("LButton","P")=0)
Break
}
Else
return
I've gotten good use out of it with the Dynamic Things mod, which lets you train your weapon skills on training dummies and archery targets.