Yes your third link is exactly how I set it up originally.
The problem is afflictions cured by goldenseal also can be cured by focus and I cure off the prompt so it sends both types of cures. If you eat goldenseal but focus cured it already then the goldenseal strips your insomnia defense.
I set up my curing like in that third link. I have an herbcure, salvecure, and so on. Each of those iterate through a table for those specific cures for each affliction type.
The only problem with what you have there is I don't understand how I could set up for each cure type as in focus and herbs. Everything works on balance. That would work fine if there were two different herbs that cured the same affliction. I guess I will have to figure out how to mix herb curing and focus curing together to use that script somehow...
These are the two tables for the focus and herb cures I use.
cures.focus.affs = {
"stupidity",
"recklessness",
"anorexia",
"weakness",
"confusion",
"epilepsy",
"agoraphobia",
"claustrophobia",
"shyness",
"dizziness",
"loneliness",
"masochism"
}
For focus, the cure is always just focus.
cures.herbs.curelist = {
{ name = "scytherus" , cure = "ginseng" },
{ name = "hypochondria" , cure = "kelp" },
{ name = "paralysis" , cure = "bloodroot" },
{ name = "impatience" , cure = "goldenseal" },
{ name = "asthma" , cure = "kelp" },
{ name = "recklessness" , cure = "lobelia" },
{ name = "masochism" , cure = "lobelia" },
{ name = "darkshade" , cure = "ginseng" },
{ name = "sensitivity" , cure = "kelp" },
{ name = "haemophilia" , cure = "ginseng" },
{ name = "slickness" , cure = "bloodroot" },
{ name = "epilepsy" , cure = "goldenseal" },
{ name = "clumsiness" , cure = "kelp" },
{ name = "confusion" , cure = "ash" },
{ name = "hallucinations" , cure = "ash" },
{ name = "stupidity" , cure = "goldenseal" },
{ name = "hypersomnia" , cure = "ash" },
{ name = "healthleech" , cure = "kelp" },
{ name = "weakness" , cure = "kelp" },
{ name = "lethargy" , cure = "ginseng" },
{ name = "nausea" , cure = "ginseng" },
{ name = "dissonance" , cure = "goldenseal" },
{ name = "shyness" , cure = "goldenseal" },
{ name = "dizziness" , cure = "goldenseal" },
{ name = "loneliness" , cure = "lobelia" },
{ name = "vertigo" , cure = "lobelia" },
{ name = "agoraphobia" , cure = "lobelia" },
{ name = "claustrophobia" , cure = "lobelia" },
{ name = "addiction" , cure = "ginseng" },
{ name = "dementia" , cure = "ash" },
{ name = "paranoia" , cure = "ash" },
{ name = "justice" , cure = "bellwort" }
}
The problem is these 5 only:
{ name = "epilepsy" , cure = "goldenseal" },
{ name = "stupidity" , cure = "goldenseal" },
{ name = "dissonance" , cure = "goldenseal" },
{ name = "shyness" , cure = "goldenseal" },
{ name = "dizziness" , cure = "goldenseal" },
If I only have one of those, I just want to cure with focus and not eat an herb. If I have two of them however, then I want to do my focuscure and herbcure both. I don't understand how to do that with what you posted.
These are the two functions.
function cure.herbs()
-- check for ability to eat herb
if not auto.herbs or
not cures.herbs.bal or
cures.herbs.try or
afflicted.anorexia or
afflicted.aeon or
afflicted.sleep or
afflicted.stunned or
afflicted.impaled or
afflicted.transfixed or
cures.general.paused then
return
end -- can't do it yet
-- eat function
local function eat(herb)
if outrifted[herb] then -- if herb outrifted then eat first
SendImmediate("eat " .. herb)
SendImmediate("outr " .. herb)
else
SendImmediate("outr " .. herb)
SendImmediate("eat " .. herb)
SendImmediate("outr " .. herb)
end
cures.herbs.eating = herb
cures.herbs.try = true
EnableTimer("herbTimer", true)
end
end -- function eat
-- find affliction and cure
for _, v in ipairs(cures.herbs.curelist) do
if afflicted[v.name] then
eat(v.cure)
return
end
end
if defense.blindness == false then
eat("bayberry")
elseif not defense.deafness and not cures.herbs.hawate then
eat("hawthorn")
cures.herbs.hawate = true
elseif not defense.kola then
if outrifted[kola] then
SendImmediate("eat kola")
SendImmediate("outr kola")
else
SendImmediate("outr kola")
SendImmediate("eat kola")
SendImmediate("outr kola")
end
end
end -- function herb cure
function cure.focus()
-- check if can focus
local halfmana = mystats.maxmana * 0.5
if mystats.mana <= halfmana or
afflicted.sleep or
afflicted.stunned or
afflicted.aeon or
not auto.focus or
not cures.focus.bal or
afflicted.impatience or
cures.general.paused or
cures.focus.try then
return
end -- can't focus
-- do focus
for _, v in ipairs(cures.focus.affs) do
if afflicted[v] then
SendImmediate("focus")
cures.focus.try = true
EnableTimer("focusTimer", true)
ResetTimer ("focusTimer")
return
end
end
end -- focus
|