Your code would spam "/echo All healed up lets rock!", and that 20 second delay is unnecessary
Code:
sub hpCheck
/if (${Me.PctHps}<30) {
/call sitHeal
}
/return
sub sitHeal
:wait
/if (${Me.State.NotEqual[SIT]}) /sit
/if (${Me.PctHps}>95) {
/delay 7s
/echo All healed up lets rock!
/if (${Me.State.NotEqual[STAND]}) /stand
/return
}
/goto :wait
/return
I can't figure out why you would have a 7 second delay after verifying that the hps are over 95%... Also why have two sub routines for one function?
Here is a slightly more complex sub that can be used in wider variety of situations.
Code:
Sub hpCheck(int sitHPs, int standHPs)
/if (!${Defined[sitHPs]}) /declare sitHPs int local 30
/if (!${Defined[standHPs]}) /declare standHPs int local 95
/if (${standHPs} <= ${sitHPs}) /varset standHPs 95
:sitLoop
/if (${Me.PctHPs} < ${sitHPs}) {
/if (!${Me.Sitting}) /sit on
/delay 1s
/doevents
} else /if (${Me.PctHPs} > ${standHPs}) {
/echo All healed up. Let's rock!
/stand
/return
}
/goto :sitLoop
/return
This way you could use the same sub in any situation without having hard coded variables (except for the defaults if the values are omitted in the /call), makes it easier to reuse in different situations.
Also including the return as an else if will save processor time since it should not even be evaluated if the first /if validates.
But of course this is just my suggestion, I like to write commonly used subroutines to be as versatile as possible =P