Use Urgent Heal, Regenerate, Imunity how to do inside.
Use Urgent Heal, Regenerate, Imunity how to do inside.
http://www.solarstrike.net/phpBB3/viewt ... f=21&t=401
this works better or more easy use than my idear.
this works better or more easy use than my idear.
Last edited by kumpel100 on Sun Jul 12, 2009 11:38 am, edited 2 times in total.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
I like that idee to make the bot unkillable.kumpel100 wrote:feedback welcome
This morning, sitting in the waiting romm by the doctor, I was thinking about your suggestion and code changes. I think there should be a way, to define that special urgent emergency cast more close to the standard bot solution. What's about some new options for the normal skills in the profile, like:
Code: Select all
<skill name="PRIEST_IMMUNITY" hotkey="VK_8" emergency_hp="15" order="1" level="" />
<skill name="PRIEST_URGENT_HEAL" hotkey="VK_7" emergency_hp="15" order="2" level="" />
<skill name="PRIEST_URGENT_HEAL" hotkey="VK_7" emergency_hp="15" order="3" level="" />
- emergency_hp, that means your own HP value in percent. The skill is triggert if the HP falls under that level
- order, all skills with the same 'emergency' event/level will be cast in the given order
That would 'only' need some changes in 'function CPlayer:checkSkills()' (ok, that changes are at the moment behind my limit of understanding of the bot ). And it would be so flexible, that you can use if for all classes and configure it very individual without to have to define new hotkeys.
btw: I could also imagine to define a 'final strike' cast in that way. Means if the hp of your mob is at a very low level (and yours to !) it could be better to use the 'final strike' instead to try to heal yourselfe before.
The RoM Bot Online Wiki needs your help!
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
i like your idear, a good option would be use skills without use alot of hotkeys.
something like:
ingame macro:
/cast Holy Aura
/wait 1
/cast Urgent Heal
/wait 1
/cast Urgent Heal
/wait 1
or if you are Priest:
/cast Holy Aura
/wait 1
/cast Soul Source ; intant full HP 5min cooldown.
best part would be Cast skills without using Hotkeys.
for atm we can use it this way:
should be not a very good fix but Imunity,Heal,Heal would do the Job.
something like:
ingame macro:
/cast Holy Aura
/wait 1
/cast Urgent Heal
/wait 1
/cast Urgent Heal
/wait 1
or if you are Priest:
/cast Holy Aura
/wait 1
/cast Soul Source ; intant full HP 5min cooldown.
best part would be Cast skills without using Hotkeys.
for atm we can use it this way:
Code: Select all
-- Check if you need to use Imunity, and use them.
function CPlayer:checkImunity()
-- 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);
end
-- If we need a Urgent Heal
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(1000);
end
-- If we need a Urgent Heal
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(1000);
end
end
should be not a very good fix but Imunity,Heal,Heal would do the Job.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
sorry, i am new to the bot.
-del-
-del-
Last edited by ay0304 on Mon Jun 29, 2009 8:50 am, edited 2 times in total.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
Using regenerate is function, you can do without any modification. You have to:ay0304 wrote:i need the regenerate function badly.
- activate self cast in your ingame options
- Insert' <skill name="PRIEST_REGENERATE" hotkey="VK_4" priority="40" level="" />
' in your *charname*.xml profile file under the skills - and put your regenerate spell at the right hotkey, you defined just before (in this example it it the hotkey '4'.
The RoM Bot Online Wiki needs your help!
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
thx a lot....i vn't tickt the self-castd003232 wrote:Using regenerate is function, you can do without any modification. You have to:ay0304 wrote:i need the regenerate function badly.With the '<option name="HP_LOW" value="95" />' in your profile, you define when to cast regenerate. I would suggest to take a high value around 90% to cast regenerate very early in a fight. In this case, I use it at 95% health points.
- activate self cast in your ingame options
- Insert' <skill name="PRIEST_REGENERATE" hotkey="VK_4" priority="40" level="" />
' in your *charname*.xml profile file under the skills- and put your regenerate spell at the right hotkey, you defined just before (in this example it it the hotkey '4'.
that the reason...
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
I just detected in the coding that there is an option 'maxhpper' for the skills defined in the skill database. That's amazing. That's allready the function to define more heal casts at different health levels.
@Admin: you should really take that into the documentation.
I changed now my skills.xml to
and insert that three casts into my profile. I was wondering, if I can't define 'maxhpper' directly in the profile to override the 'default' values from skills.xml ?
And I would like to define the 'InBattle' option with 'true'. That means to cast 'PRIEST_SOUL_SOURCE' and 'PRIEST_HOLY_AURA' only IN combat so I don't waste them outside of combat. Thats not coded if I see that right.
@Admin: you should really take that into the documentation.
I changed now my skills.xml to
Code: Select all
<skill name="PRIEST_HOLY_AURA" mana="60" cooldown="120" type="buff" target="self" maxhpper="20" />
<skill name="PRIEST_URGENT_HEAL" mana="25" manainc="2.5" range="250" casttime="1" type="heal" target="friendly" maxhpper="20" />
<skill name="PRIEST_SOUL_SOURCE" cooldown="300" type="heal" target="self" priority="100" maxhpper="15" />
And I would like to define the 'InBattle' option with 'true'. That means to cast 'PRIEST_SOUL_SOURCE' and 'PRIEST_HOLY_AURA' only IN combat so I don't waste them outside of combat. Thats not coded if I see that right.
The RoM Bot Online Wiki needs your help!
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
Yeah, there is a lot to be documented, but as it stands now the instructions are already monolithic.d003232 wrote: @Admin: you should really take that into the documentation.
Doesn't work like that currently, but will in the future.and insert that three casts into my profile. I was wondering, if I can't define 'maxhpper' directly in the profile to override the 'default' values from skills.xml ?
You can already do that. Add inbattle="true" to the entry in skills.xml. I've updated it on my end and committed to SVN.And I would like to define the 'InBattle' option with 'true'. That means to cast 'PRIEST_SOUL_SOURCE' and 'PRIEST_HOLY_AURA' only IN combat so I don't waste them outside of combat. Thats not coded if I see that right.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
THX for that very fast service.Administrator wrote:You can already do that. Add inbattle="true" to the entry in skills.xml. I've updated it on my end and committed to SVN.
The RoM Bot Online Wiki needs your help!
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
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:
line ~ 520
yrest(1000); << fixes my loot problems
-- Monster is dead (0 HP) but still targeted.
-- Loot and clear target.
player.lua line ~ 488
self:checkPotions();
self:checkSkills();
overwrite with this code:
Code:
player.lua line ~698
self:checkPotions();
overwrite with this code:
Code:
bot.lua 291-294
if( player.TargetPtr == 0 ) then
player:checkPotions();
player:checkSkills();
end
overwrite with this code:
Code:
Profil.xml
right after:
<profile>
<options>
insert this:
Code:
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.
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
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
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.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
Edit your 1st post so people can get the right code withouth having to read the whole thread. Looks amazing btw!
I'm having a problem. My bot won't eaat any potions.
I'm having a problem. My bot won't eaat any potions.
Re: Use Urgent Heal, Regenerate, Imunity how to do inside.
As I wrote before, I like your idee, to give the bot more chances to survive. That was the reason to look deeper, whats possible to do with the bot. There are some undocumented function to use healing casts at different HP levels.kumpel100 wrote:feedback welcome
I think that functions are closer to the standard of the bot und are usable for all RoM classes without changes at the standard functions. That's the reason I try to describe them for all in a new post here. Thx for your work and ideas.
The RoM Bot Online Wiki needs your help!
Who is online
Users browsing this forum: Google [Bot] and 1 guest