Keypress on health level

Fridgecritter

Premium Member
Joined
May 14, 2011
Messages
49
Reaction score
6
Points
8
Hello there,

I'm wondering if anyone has already done this, so I can add to it and learn at the same time...

I need a macro that runs and detects when my health is at a certain percent and does a keypress.

Thanks in advance.
 
Last edited:
I've taken a snippet from a bind wound submission here and modified it, and I'm wondering why it's not working. This is why I'm asking for help. I want this to press a key for a hotbutton I've created on my hotbar to click a pot from my potion bar.


Code:
Sub main
    /echo keypress.mac started. Will press 9 key automatically under 50%. 
    :loop
    /if (${Me.PctHPs}>50) {
        /keypress TAB
        /delay 1s
        /keypress 9
	/delay 1s
	/keypress TAB
    }
    /delay 1s
    /goto :loop
/return
 
Last edited:
This is what I have now... figured out I had the > sign in there instead of <... and got rid of the delay 1s but now I'm wondering if there's an easier way to target myself and use the POT without using keypress TAB. This is what I have now.


Code:
Sub main
    /echo keypress.mac started. Will press 2 key automatically under 50%. 
    :loop
    /if (${Me.PctHPs}<50) {
        /keypress TAB
	/keypress 2
	/keypress TAB
    }
    /delay 1s
    /goto :loop
/return