ID:1634697
 
Code:
mob
verb
Attack()

if(src.cooldown_attack == 1) //checks if you're already attacking
return

winset(src, "mainwindow", "macro = macro_melee") //changes to an empty macro list, preventing any input from being detected
src.cooldown_attack = 1 //prevents you from attacking
flick("attack",src) //plays the "attack" animation within your current icon

sleep(2.5)//prevents you from moving or attacking until the animation has played out fully

winset(src, "mainwindow", "macro = macro_movement") //changes to the macro list containing the movement procs
src.cooldown_attack=0 //allows you to attack again
return


Problem description: I am getting a tad bit of input lag from the macro lists once I have changed it. Currently, any procs in the "macro_movement" list can be interrupted by calling Attack() and remain inaccessible until Attack() has finished.

However, if I continuously hold down the assigned key or keys in the macro list that isn't currently selected, once the list is re-selected and enabled there is a delay (nearly 1/2 a second) before the procs assigned to the held keys are called.

This only occurs if you were not holding down the key prior to interrupting with Attack(). If you hold day a specific key, call Attack, and never released the key until Attack() finishes, there is no delay and it is called instantly once the macro list is restored.

What is confusing me is that if you do not hold down said key or keys, you can press them immediately after Attack() finishes and the procs will be called instantly with no delay.


Is this a something that can be fixed? If so, I'd appreciate any suggestions or assistance as to how to do so. Any feedback is appreciated as always.