I just wanna suggest what i did to the scripts. ;D
Is it a good idea to add method hook for some action ? such as beforeBotFight and afterBotFight.
this is example for CPlayer:fight()
Code: Select all
function CPlayer:fight()
if( not self:haveTarget() ) then
return false;
end
pcall(beforeBotFight); -- i add beforeFight method hook here.
....
....
....
...
pcall(afterBotFight); -- and add afterFight method hook here.
end -- end of CPlayer:fight()
if i wanna use this method hook just add the function to userfunction, <onload> in waypoint.xml or <onload> in profile.xml
Code: Select all
<onload>
function afterBotFight()
cprintf(cli.yellow, "[INFO] this is afterBotFight() method.");
end
</onload>