Infinite loop

by Sylphas

Back to Mechanic's Corner.

Amaru2005-04-18 20:14:57
Mhmm.
Unknown2005-04-22 10:15:05
Ah, I see.

My aliases have the same kind of targetting, I just add an #IF statement to each of them, pretty simple and straightforward.

Like:
CODE

#ALIAS mb {#if (%1) {ta %1}; moonburst @target}


"ta" is my targetting alias, @target is the target variable.

Of course one can argue that #IF (%1) is slightly bad coding style but it works. If you want to be 100% sure you can do #IF (%numparam() > 0) instead.


Actually you don't even necessarily need the #IF, I only do it because if I call my TA alias without parameter, it'll clear my target variable. So if your targetting alias doesn't do that, you can also do
CODE

#ALIAS ta {#if (%numparam() > 0) {#var target %1; #echo Targetting @target}}
#ALIAS mb {ta %1; moonburst @target}


That'd make the attack aliases have a tad less code. Doesn't really matter I guess.