Quote Originally Posted by Ladon View Post
Sorry man you already tried to use that one on someone else. You are wrong in this case though.

Yes you can create objects within functions by calling on them which in turn the function can return that object if that is it's function.

NOCOMBAT is a function call restriction, it does not prevent you from passing a returned object, or variable when calling another function. All it does is prevent you from calling that function in order to pass in an object in order to get the return.

So in your case, since the OnHover or OnClick function can be called in combat then you can get the target returned during combat. You can then pass in that object to any other function that is not restricted by NOCOMBAT if you are in combat. So unless GetPlayerHP() is NOCOMBAT restricted then there is no reason you can't get the HP returned by passing in your already acquired target object. And then from there you can pass your HP value into a Lua script, have the script spit out a command object then pass that to CastAbility(). Again all functions that aren't restricted by NOCOMBAT.

It seems like you are under the impression that you can somehow strip out an object or variable. This isn't possible as long as you can call the function and get the return.
If the function for creating that object has the NOCOMBAT restriction, then you will not have that object to pass it.

If you think creating a target without player input is possible, then you're wrong. Creating a target object would require a function which is restricted from combat use. OnHover and OnClick events do require player input, and are therefore not restricted from in-combat use.

Moreover, WOW has protected classes and 'tainting', which makes your example of LUA comparisons moot, because action calls refuse to run if scripts are ran or it receives any data from a tainted source. It is for this reason that HealBot does not have conditional statements in it, such as canceling a heal action of the target's HP is too low/high.

http://www.wowwiki.com/Secure_Execution_and_Tainting