Page 1 of 1

evalTarget

Posted: Tue Apr 26, 2011 9:44 pm
by WhiteTiger
Is there a way to make an own evalTarget function and use it to the normal fight system instead of evalTargetDefault? If I try to rewrite it in the player class the bot stop working.
Thx in advance

Re: evalTarget

Posted: Tue Apr 26, 2011 10:11 pm
by rock5
So you are not talking about using your own evalfunc when using player:fight() yourself, you are talking about using your own evalfunc when the bot is running around and auto targeting mobs, right?

I think the easiest way would be to start with the evaltargetDefault function and just edit it to do the checks you want.

Re: evalTarget

Posted: Wed Apr 27, 2011 3:09 am
by Administrator
You could just write your eval function in a userfunction script, and set evalTargetDefault to your new function. Basically, just hook it.

Code: Select all

local originalEval = evalTargetDefault;
evalTargetDefault = function(address)
 -- stuff here
end

Re: evalTarget

Posted: Wed Apr 27, 2011 7:19 am
by WhiteTiger
thx :P, forgot that u could overwrite functions in userfuctions