So made up section of code for autopotion use. Goes inside the combatbuffs behaviour for your class.
So basically when your health gets below 50% it uses the highest potion you have in your inventory, x-pot > mega > hi > potion.
Code:
if (Core.Player.CurrentHealthPercent < 50)
{
foreach(ff14bot.Managers.BagSlot slot in ff14bot.Managers.InventoryManager.FilledSlots)
{
if(slot.RawItemId == 4554) //X-Potion
{
slot.UseItem();
return true;
}
if(slot.RawItemId == 4553) //Mega-Potion
{
slot.UseItem();
return true;
}
if(slot.RawItemId == 4552) //Hi-Potion
{
slot.UseItem();
return true;
}
if(slot.RawItemId == 4551) //Potion
{
slot.UseItem();
return true;
}
}
}
You can also put skills in there if you want. You probably have to enable them though, which is kind of complicated.
So say you want to use Second wind. Place
Code:
if (await SecondWind()) return true;
before the foreach.
Then open the UltimaCR\Settings\Forms\UltimaForm.Designer.cs.
Find the section of code for the SecondWind for the class your enabling it for.
Example for Lancer is the code your looking for will start with LancerSecondWind.
Then find this code
Code:
this.LancerSecondWind.Enabled = false;
and remove it. This will enable second wind cross-class skill for lancers then check it like normal in the combat routine settings in the bot. If its checked and your put the secondwind code above in the right place, When your health gets below 50% it will use the second wind skill first, then the potions if your skill is on cooldown.
You can do this for combat buffs as well. Just set the combat buff health percentage a little higher (like 70 or 90). Here is some example code with pugilist and rogue skills. You still need to go into the UltimaForm.Designer.cs and remove the section of code to enable them like I explained above.
Code:
if (Core.Player.CurrentHealthPercent < 70)
{
if (await KeenFlurry()) return true;
if (await Featherfoot()) return true;
if (await ShadeShift()) return true;
if (await Foresight()) return true;
}