Sure thing! The trigger in question:
<trigger
enabled="y"
group="Core"
match="^(?:\d+h)?(?:\, )?(?:\d+m)?(?:\, )?(?:\d+e)?(?:\, )?(?:\d+p)?(?:\, )?(?:\d+en)?(?:\, )?(?:\d+w)?(?:\, )?(?:(?:[1-5])mo)? ([elrxkdbpSsi<>]*)\-$"
name="core_prompt"
keep_evaluating="y"
omit_from_log="y"
omit_from_output="y"
regexp="y"
script="events.prompt"
sequence="1000"
>
</trigger>
calls:
function prompt(name, line, wildcards, styles)
--If less than two colours, it is an illusion.
if (#styles < 2) then
return
end
prompt_flags = wildcards[1] -- Sets the retrieved flags.
local no_prompt = prompt_actions["no_prompt"]
if not balances.onbal then
events.tvar_clear("balance_action")
end
balances.prompt() -- Updates balance stats.
events.balance() -- Runs balance event.
affs.recklessness_check() -- Are we a little too crazy?
inventory.pipe_check()
affs.checks()
-- Execute all actions lined up for the prompt.
for name,action in pairs (prompt_actions) do
if type(action) == "function" then
action()
elseif type(action) == "string" and #action > 0 then
Execute(action)
end
prompt_actions[name] = nil
end
pvars = {}
-- Cures your afflictions.
curing.routine()
if not no_prompt then
ui.prompt() -- Draws the acorn prompt.
end
if (#affs.last_cures > 0) then
Note()
local c = string.gsub(table.concat(affs.last_cures, ", "), "_", " ")
ColourNote("white", "", "cleared: ", "silver", "", c)
end
affs.last_cures = {}
core.prev_hp, core.prev_mp, core.prev_ep = core.hp or 0, core.mp or 0, core.ep or 0
end
The above function called the ui function (which redraws the prompt)
function prompt() --Draws the prompt in all its prettiness.
local time_ms = GetInfo(232)
local powerfract = ( tonumber(core.power)/ tonumber(GetVariable("vitals_maxpow")) )
local flagcolour = "yellow" --Just colours the flags based on balance status.
if not (balances.onbal) or (affs.prone) then
flagcolour = "silver"
end
ColourTell("silver", "", "[")
Hyperlink("time_stamp_difference "..time_ms, string.format("%0.2f", time_ms), "Click to get difference.", "lightslategray", "", 0)
ColourTell("silver", "", "|")
if not affs.get("recklessness") then
ColourTell(colourfract(core.hpfract), "", string.format("%d", (core.hpfract * 100)).."%h")
ColourTell("silver", "", "|")
ColourTell(colourfract(core.mpfract), "", string.format("%d", (core.mpfract * 100)).."%m")
ColourTell("silver", "", "|")
ColourTell(colourfract(core.epfract), "", string.format("%d", (core.epfract * 100)).."%e")
ColourTell("silver", "", "|")
ColourTell(colourfract(powerfract), "", core.power.."p")
else
ColourTell("chartreuse", "", "Reckless")
end
ColourTell("silver", "", "|")
ColourTell(colourfract(core.enfract), "", string.format("%d", (core.enfract * 100)).."%en")
ColourTell("silver", "", "|")
ColourTell(colourfract(core.wpfract), "", string.format("%d", (core.wpfract * 100)).."%w")
ColourTell("silver", "", "] ")
ColourTell(flagcolour, "", events.prompt_flags.."- ")
if core.is_paused() then
ColourTell("darkred", "", "(", "crimson", "", "psd", "darkred", "", ")" )
end
if affs.get("stunned") then
ColourTell("goldenrod", "", "(", "gold", "", "stn", "goldenrod", "", ")" )
end
if affs.get("asleep") then
ColourTell("royalblue", "", "(", "cornflowerblue", "", "slp", "royalblue", "", ")" )
end
if affs.slow() then
local c = "slateblue"
if events.tvars["slow_block"] then
c = "plum"
end
ColourTell("darkslateblue", "", "(", c, "", "slow", "darkslateblue", "", ")" )
end
if affs.get("jinx") then
ColourTell("darkorange", "", "(", "orange", "", "jinx", "darkorange", "", ")" )
end
if #mapper.autowalking > 0 then
ColourTell("darkgray", "", "(", "silver", "", "moving - "..mapper.autowalking[1], "darkgray", "", ")" )
elseif events.tvars["autowalk_arrived"] then
events.tvar_clear("autowalk_arrived")
ColourTell("darkgray", "", "(", "silver", "", "arrived", "darkgray", "", ")" )
end
point_changes()
end
Also, thank you for that link. I'll be studying this now :) |