So I take some code I found in the main BOT post (I only get read the first 20 pages. It is really big ) and look for the right variables in the player.lua.
But it seems that I cant access the needed variables 'self.mana'??
I put that code in after >onLeaveCombat>. How do I have to declare the variables to get access? I dont want to do that modification within the player.lua
Code: Select all
<onLeaveCombat>-- Additional Lua code to execute after killing an enemy
-- Take break for mana restore. Exit if we get attacked.
if( (self.Mana/self.MaxMana*100) < 60 ) then
for i = 1, 30 do
yrest(1000);
player:update();
if( player:haveTarget() ) then
i = 30;
end;
if( (self.Mana/self.MaxMana*100) > 98 ) then
i = 30;
end;
player:checkSkills(); -- check if we need to cast buffs/heals.
end
end
</onLeaveCombat>