Edit version:
i addet alot of new code to makes my Mage/Priest close to Unkillable:
Player LUA Line ~192-224 from the new SVN code overwrite the whole function CPlayer:checkPotions()
with this code:
Code:
Code: Select all
-- Check if you need to use Imunity, and use them.
function CPlayer:checkImunity()
self:checkPotions();
-- Still cooling down, don't use.
-- if( os.difftime(os.time(), self.ImunityLastUseTime) < settings.profile.options.IMUNITY_COOLDOWN ) then
-- cprintf(cli.red, "Imunity in Cooldown\n");
-- end
if( os.difftime(os.time(), self.ImunityLastUseTime) < settings.profile.options.IMUNITY_COOLDOWN ) then
return;
end
if( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_USE_IMUNITY ) and ( self.Battling ) then
self.ImunityLastUseTime = os.time();
cprintf(cli.red, "Use Imunity\n");
local modifier = settings.profile.hotkeys.HP_LOW_IMUNITY.modifier
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.HP_LOW_IMUNITY.key);
if( modifier ) then keyboardRelease(modifier); end
yrest(250);
if( settings.profile.options.URGENT_HEAL_USE == true ) then
cprintf(cli.red, "Urgent Heal\n");
local modifier = settings.profile.hotkeys.CAST_HEAL_URGENT.modifier
keyboardPress(settings.profile.hotkeys.CAST_HEAL_URGENT.key);
yrest(1000);
cprintf(cli.red, "Urgent Heal\n");
keyboardPress(settings.profile.hotkeys.CAST_HEAL_URGENT.key);
yrest(500);
end
end
end
-- Check if you need to use any potions, and use them.
function CPlayer:checkHealth1()
if( (self.Mana/self.MaxMana*100) < settings.profile.options.MP_LOW_HEAL_URGENT ) and ( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_URGENT ) then
cprintf(cli.red, "Low on Mana for Urgent\n");
return;
end
-- If we need to use a health potion
if( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_URGENT ) then
cprintf(cli.red, "Urgent Heal\n");
local modifier = settings.profile.hotkeys.CAST_HEAL_URGENT.modifier
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.CAST_HEAL_URGENT.key);
if( modifier ) then keyboardRelease(modifier); end
yrest(1200);
end
end
-- Check if you need to use any potions, and use them.
function CPlayer:checkHealth()
-- Still cooling down, don't use.
if( os.difftime(os.time(), self.HealLastUseTime) < settings.profile.options.HEAL_COOLDOWN ) then
return;
end
-- If we need to use a health potion
if( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_HEAL ) then
self.HealLastUseTime = os.time();
cprintf(cli.red, "Regenerate\n");
local modifier = settings.profile.hotkeys.CAST_HEAL_REGENERATE.modifier
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.CAST_HEAL_REGENERATE.key);
if( modifier ) then keyboardRelease(modifier); end
yrest(500);
end
end
-- Check if you need to use any potions, and use them.
function CPlayer:checkPotions()
-- Still cooling down, don't use.
if( os.difftime(os.time(), self.PotionLastUseTime) < settings.profile.options.POTION_COOLDOWN ) then
return;
end
if( settings.profile.options.HEAL_AND_PORTION_HEAL_USE == true ) and ( (self.Mana/self.MaxMana*100) > settings.profile.options.HEAL_PORTION_USE_TO_MANA_DOWN ) then
-- If we need to use a health potion
if( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_POTION ) then
self.PotionLastUseTime = os.time();
local modifier = settings.profile.hotkeys.HP_POTION.modifier
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.HP_POTION.key);
if( modifier ) then keyboardRelease(modifier); end
cprintf(cli.red, language[10]);
yrest(500);
end
end
-- If we need to use a mana potion(if we even have mana)
if( self.MaxMana > 0 ) then
if( (self.Mana/self.MaxMana*100) < settings.profile.options.MP_LOW_POTION ) then
self.PotionLastUseTime = os.time();
local modifier = settings.profile.hotkeys.MP_POTION.modifier
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.MP_POTION.key);
if( modifier ) then keyboardRelease(modifier); end
cprintf(cli.red, language[11]);
yrest(500);
end
end
end
line ~ 520
yrest(1000); << fixes my loot problems
-- Monster is dead (0 HP) but still targeted.
-- Loot and clear target.
Code: Select all
-- Monster is dead (0 HP) but still targeted.
-- Loot and clear target.
self:checkPotions();
self:update();
player.lua line ~ 488
self:checkPotions();
self:checkSkills();
overwrite with this code:
Code:
Code: Select all
if( settings.profile.options.IMUNITY_USE == true ) then
player:checkImunity();
end
self:checkPotions();
if( settings.profile.options.HEAL_USE == true ) then
self:checkHealth();
end
if( settings.profile.options.URGENT_HEAL_USE == true ) then
self:checkHealth1();
end
self:checkSkills();
end
player.lua line ~698
self:checkPotions();
overwrite with this code:
Code:
Code: Select all
if( settings.profile.options.IMUNITY_USE == true ) then
player:checkImunity();
end
self:checkPotions();
if( settings.profile.options.HEAL_USE == true ) then
self:checkHealth();
end
if( settings.profile.options.URGENT_HEAL_USE == true ) then
self:checkHealth1();
end
bot.lua 291-294
if( player.TargetPtr == 0 ) then
player:checkPotions();
player:checkSkills();
end
overwrite with this code:
Code:
Code: Select all
if( player.TargetPtr == 0 ) then
player:checkPotions();
if( settings.profile.options.IMUNITY_USE == true ) then
player:checkImunity();
end
if( settings.profile.options.HEAL_USE == true ) then
player:checkHealth();
end
if( settings.profile.options.URGENT_HEAL_USE == true ) then
player:checkHealth1();
end
player:checkSkills();
end
Profil.xml
right after:
<profile>
<options>
insert this:
Code:
Code: Select all
<option name="LOGOUT_TIME" value="240" />
<option name="LOGOUT_SHUTDOWN" value="true" />
<option name="IMUNITY_USE" value="true" />
<option name="HP_LOW_USE_IMUNITY" value="55" />
<option name="IMUNITY_COOLDOWN" value="120" />
<option name="HEAL_USE" value="true" />
<option name="HP_LOW_HEAL" value="85" />
<option name="HEAL_COOLDOWN" value="20" />
<option name="URGENT_HEAL_USE" value="true" />
<option name="MP_LOW_HEAL_URGENT" value="20" />
<option name="HP_LOW_URGENT" value="65" />
<option name="HEAL_AND_PORTION_HEAL_USE" value="true" />
<option name="HEAL_PORTION_USE_TO_MANA_DOWN" value="40" />
<option name="POTION_COOLDOWN" value="32" />
<option name="HP_LOW_POTION" value="40" />
<option name="MP_LOW_POTION" value="60" />
and in <hotkeys>
insert this:
Code:
<hotkey name="HP_LOW_IMUNITY" key="VK_6" />
<hotkey name="CAST_HEAL_REGENERATE" key="VK_0" />
<hotkey name="CAST_HEAL_URGENT" key="VK_9" />
pawn.lua line line 63 below this self.PotionLastUseTime = 0;
add this:
Code:
self.ImunityLastUseTime = 0;
self.HealLastUseTime = 0;
to clear things up:
self explain:
<option name="IMUNITY_USE" value="true" />
at 50% HP the bot will use Imunity:
<option name="HP_LOW_USE_IMUNITY" value="50" />
Cooldowntimer of your Imunity spell:
<option name="IMUNITY_COOLDOWN" value="120" />
true means you want use Regenerate:
<option name="HEAL_USE" value="true" />
at 75% HP the Bot will cast Regenerate if the Timer is Up:
<option name="HP_LOW_HEAL" value="75" />
Cooldown Timer of Regenerate 20 = 20 seconds:
<option name="HEAL_COOLDOWN" value="20" />
true means use Urgent Heal, false dont use it:
<option name="URGENT_HEAL_USE" value="true" />
Bot only Cast Urgent Heal if your Mana higher then 30%:
<option name="MP_LOW_HEAL_URGENT" value="30" />
at 50% the bot will cast Urgent Heal when Mana > 30% and HP lower then 50%:
<option name="HP_LOW_URGENT" value="50" />
true means use use Heal Portions and Heal Spells, false dont use Heal Portion:
<option name="HEAL_AND_PORTION_HEAL_USE" value="true" />
Use Heal Portion only when your Mana greater then 40%:
<option name="HEAL_PORTION_USE_TO_MANA_DOWN" value="40" />
i know it can be codet better but for me personel works great.