Hi guys.
I edited Agent's script to remove references to mana, for mundanes. I've tested it and nothing seems to break.
1. If you already have the script installed, remove the four prompt triggers that currently exist in your trigger list. Otherwise, follow the installation instructions until you have the script installed, but don't enter /InstallInfobar() just yet.
2. Open the script, delete the contents, and paste the code below. When that's done, save the script (tell it to reprocess) and close it.
3. Log in to your character, and hit /InstallInfobar().
You should now have a mana-less prompt.
--[[ Your scripting language is not set to lua if you ever see this line in the mushclient output.
###INSTALLATION###
Step 1: Save this file to your hard drive. I recommend the MushClient/Script directory. If you are using my own MCL file you can skip to step 5.
Steps 2-4: Hit shift-ctrl-6 to open the scripting settings menu. Set your scripting language to Lua, set your script prefix to forward slash(/), then click browse to find and select this file. Click OK to close the script dialogue.
Step 5:Login to Armageddon and send this command to arma: /InstallInfobar()
##################
Programmer Comments follow. Normal people stop reading and play the game.---->
here is the Status Prompt; enter the entire following line into armageddon after you have logged into your character.
prompt PROMPT_%a_%o_%O_%k_%e_LINEONE\n
PROMPT_%WHATEVER_%A_%w_%h_%H_%t_%T_%v_%V_LINETWO\n
PROMPT_%s_LINE3\n
btw, this is a really important piece. changing even the order will break everything in both DetailedInfobar and DescriptiveInfobar.
the following line is the new matching string. Create a new trigger and put it into the matching field at the top. Don't save and close it yet though.
^PROMPT_([^_]+)_([^_]+)_([^_]+)_riding: ([^_]+)_([^_]+)_LINEONE\n
PROMPT_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_LINETWO\n
PROMPT_([^_]+)_LINE3$
While still in the same trigger, check these options: regular expression, omit from output, and optionally omit from log.
Lastly you must put the name of the function (script) you want to use in the "script:" field for the trigger. Either DetailedInfobar or DescriptiveInfobar depending on which you want to use.
Again, this is a really important piece. That's because this pattern is regex code for the prompt information. If you change something it may not recognize your prompt info anymore and you'll get a bunch of nil values.
An author's todo list:
test descriptive, swap between descriptive and detailed, better variable scoping, speed enhancements.
also add a mana toggle or build into install scripts
]]-- multiline intro comment ends here.
function installinfobar()
InstallInfobar()
end --end installinfobar
function installInfobar()
InstallInfobar()
end --end installinfobar
function Installinfobar()
InstallInfobar()
end --end installinfobar
function InstallInfobar()
--Prototype for trigger class: long AddTriggerEx(BSTR TriggerName, BSTR MatchText, BSTR ResponseText, long Flags, short Colour, short Wildcard, BSTR SoundFileName, BSTR ScriptName, short SendTo, short Sequence);
AddTriggerEx ("DetailedInfobarTrigger", "^PROMPT_([^_]+)_([^_]+)_([^_]+)_riding: ([^_]+)_([^_]+)_LINEONE\\nPROMPT_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_LINETWO\\nPROMPT_([^_]+)_LINE3$", "", 41, -1, 0, "", "DetailedInfobar", 0, 10)
--above line sets up trigger to read in the data from the prompt and feed it to the script.
SetTriggerOption ("DetailedInfobarTrigger","multi_line", 1)
SetTriggerOption ("DetailedInfobarTrigger","lines_to_match", 3)
--above two lines enable multi-line matching which is neeeded due to the length of the prompt - it won't fit all on one line
--also note that it's important to set these triggers to 'keep evaluating' otherwise it will only act on each line once.
AddTriggerEx ("DetailedInfobarTriggerGag1", "^PROMPT_([^_]+)_([^_]+)_([^_]+)_riding: ([^_]+)_([^_]+)_LINEONE$", "", 47, -1, 0, "", "", 0, 20)
AddTriggerEx ("DetailedInfobarTriggerGag2", "^PROMPT_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_([^_]+)_LINETWO$", "", 47, -1, 0, "", "", 0, 20)
AddTriggerEx ("DetailedInfobarTriggerGag3", "^PROMPT_([^_]+)_LINE3$", "", 47, -1, 0, "", "", 0, 20)
--above three lines gag the prompt lines - multi-line triggers can't gag text.
SendImmediate ("prompt PROMPT_%a_%o_%O_%k_%e_LINEONE\\nPROMPT_%WHATEVER_%A_%w_%h_%H_%t_%T_%v_%V_LINETWO\\nPROMPT_%s_LINE3\\n")
--above creates Prompt ingame. Notice the \\n to create linebreaks in the prompt. The extra \ is needed otherwise the SendImmediate command will hit the enter key, so to speak, when it reads \n.
ShowInfoBar (true)
--above Turns on infobar in case it's off.
SendImmediate ("inv")
--above sends just any input to trigger a prompt in game.
Tell ("You should now see your stats in the infobar at the bottom of your mushclient window. If not, send email to my gmail account - agent.137")
end --end InstallInfobar
function SwapInfobar()
--http://www.gammon.com.au/scripts/function.php?name=GetTriggerOption
local InfobarTriggerScript
InfobarTriggerScript = GetTriggerOption ("DetailedInfobarTrigger", "script")
if InfobarTriggerScript == "DetailedInfobar" then
SetTriggerOption ("DetailedInfobarTrigger", "script", "DescriptiveInfobar")
elseif InfobarTriggerScript == "DescriptiveInfobar" then
SetTriggerOption ("DetailedInfobarTrigger", "script", "DetailedInfobar")
else Note ("something is rotten in the state of SwapInfobar()")
end -- if statement
end --end SwapInfobar
function DetailedInfobar(thename, theoutput, wildcards)
--Now creating variables with "local" command then filling them with the data from the prompt and trigger:
--The numbers here match the corresponding entry into your prompt. i.e. %a (accent) is first, so it becomes wildcards[1], %o (language) is wildcards[2]
--But it doesn't get assigned a number until it passes through the regex in the trigger: which is why you can't change one without changing all three.
--From here on out, the info from your prompt is contained in the variables created below. i.e. your current health, %h from your prompt, is stored in CurrentHealth.
local CurrentAccent
CurrentAccent = wildcards [1]
local CurrentLanguage
CurrentLanguage = wildcards [2]
local CurrentMood
CurrentMood = wildcards [3]
local CurrentRiding
CurrentRiding = wildcards [4]--used in DetailedInfobar by default.
local CurrentTime
CurrentTime = wildcards [5]--used in DetailedInfobar by default.
local CurrentWHATEVER
CurrentWHATEVER = wildcards [6]
local CurrentArmed
CurrentArmed = wildcards [7]--used in DetailedInfobar by default.
local CurrentSpeed
CurrentSpeed = wildcards [8]--used in DetailedInfobar by default.
local CurrentHealth
CurrentHealth = tonumber(wildcards [9])--used in DetailedInfobar by default.
local CurrentHealthMax
CurrentHealthMax = tonumber(wildcards [10])--used in DetailedInfobar by default.
local CurrentStun
CurrentStun = tonumber(wildcards [11])--used in DetailedInfobar by default.
local CurrentStunMax
CurrentStunMax = tonumber(wildcards [12])--used in DetailedInfobar by default.
local CurrentStamina
CurrentStamina = tonumber(wildcards [13])--used in DetailedInfobar by default.
local CurrentStaminaMax
CurrentStaminaMax = tonumber(wildcards [14])--used in DetailedInfobar by default.
local CurrentPosition
CurrentPosition = wildcards [15]--used in DetailedInfobar by default.
--Setting up default look
InfoClear ()
InfoBackground ("wheat")
InfoFont ("Verdana",10,1) --last digit represents style - 0=normal and 1=bold.
--Add a Text Variable - in the line after next, replace 'TextVariable' with the variable you want to add from the list above. Then uncomment them both.
--InfoColour ("black")
--Info ("abbreviation",TextVariable)
--Riding Status
InfoColour ("black")
Info ("Riding: ",CurrentRiding," ")
--[[ Testing auto figuring of ratio. if it breaks, reset ifs to this pattern: elseif tonumber(CurrentHealth) < 40 then
it will probably break - check how to run operations within an input.]]--
--CurrentHealth
if (CurrentHealth/CurrentHealthMax) < 20/100 then
InfoColour ("crimson")
elseif (CurrentHealth/CurrentHealthMax) < 40/100 then
InfoColour ("firebrick")
elseif (CurrentHealth/CurrentHealthMax) < 70/100 then
InfoColour ("darkorange")
elseif (CurrentHealth/CurrentHealthMax) < 100/100 then
InfoColour ("darkgreen")
elseif CurrentHealth then
InfoColour ("black")
end
Info ("Health:",CurrentHealth)
--Uncomment the next line and comment in the following that deal with the max value if you want to remove the max but keep the current value.
--Info (" ")
--following 7 lines will add the corresponding max value to the display.
if CurrentHealthMax then
InfoColour ("black")
Info ("/",CurrentHealthMax," ")
else
InfoColour ("black")
Info (" ")
end
--End CurrentHealth with Max
--CurrentStun
if (CurrentStun/CurrentStunMax) < 20/100 then
InfoColour ("crimson")
elseif (CurrentStun/CurrentStunMax) < 40/100 then
InfoColour ("firebrick")
elseif (CurrentStun/CurrentStunMax) < 70/100 then
InfoColour ("darkorange")
elseif (CurrentStun/CurrentStunMax) < 90/100 then
InfoColour ("darkgreen")
elseif CurrentStun then
InfoColour ("black")
end
Info ("Stun:",CurrentStun)
--Uncomment the next line and comment in the following that deal with the max value if you want to remove the max but keep the current value.
--Info (" ")
--following 7 lines will add the corresponding max value to the display.
if CurrentStunMax then
InfoColour ("black")
Info ("/",CurrentStunMax," ")
else
InfoColour ("black")
Info (" ")
end
--End CurrentStun with Max
--CurrentStamina
if (CurrentStamina/CurrentStaminaMax) < 20/100 then
InfoColour ("crimson")
elseif (CurrentStamina/CurrentStaminaMax) < 40/100 then
InfoColour ("firebrick")
elseif (CurrentStamina/CurrentStaminaMax) < 70/100 then
InfoColour ("darkorange")
elseif (CurrentStamina/CurrentStaminaMax) < 90/100 then
InfoColour ("darkgreen")
elseif CurrentStamina then
InfoColour ("black")
end
Info ("Stam:",CurrentStamina)
--Uncomment the next line and comment in the following that deal with the max value if you want to remove the max but keep the current value.
--Info (" ")
--following 7 lines will add the corresponding max value to the display.
if CurrentStaminaMax then
InfoColour ("black")
Info ("/",CurrentStaminaMax," ")
else
InfoColour ("black")
Info (" ")
end
--End CurrentStamina with Max
--Adding Extra Spacing
InfoColour ("black")
Info (" | ")
--Time of Day
InfoColour ("black")
if CurrentTime == "dusk" then
InfoColour ("firebrick")
Info (CurrentTime, " ")
elseif CurrentTime == "late afternoon" then
InfoColour ("darkorange")
Info (CurrentTime , " ")
elseif CurrentTime == "unknown" then
InfoColour ("black")
Info ("underground", " ")
elseif CurrentTime then
InfoColour ("black")
Info (CurrentTime , " ")
end
--Walking/Running Status
InfoColour ("black")
if CurrentSpeed == "running" then
InfoColour ("firebrick")
elseif CurrentSpeed == "sneaking" then
InfoColour ("darkorange")
elseif CurrentSpeed then
InfoColour ("black")
end
Info (CurrentSpeed, " ")
--Armed/Unarmed Status
InfoColour ("black")
if CurrentArmed == "armed" then
InfoColour ("firebrick")
elseif CurrentArmed == "unarmed" then
InfoColour ("black")
elseif CurrentArmed then
InfoColour ("black")
end
Info (CurrentArmed, " ")
--Position. I.e. Standing or Fighting:Target Status
InfoColour ("black")
if CurrentPosition == "Fighting" then
InfoColour ("firebrick")
elseif CurrentPosition == "sleeping" then
InfoColour ("darkorange")
elseif CurrentPosition == "resting" then
InfoColour ("darkblue")
elseif CurrentPosition == "sitting" then
InfoColour ("darkgreen")
elseif CurrentPosition then
InfoColour ("black")
end
Info (CurrentPosition, " ")
end --- end detailed infobar ---
function DescriptiveInfobar(thename, theoutput, wildcards)
local CurrentAccent
CurrentAccent = wildcards [1]
local CurrentLanguage
CurrentLanguage = wildcards [2]
local CurrentMood
CurrentMood = wildcards [3]
local CurrentRiding
CurrentRiding = wildcards [4]--used in DetailedInfobar by default.
local CurrentTime
CurrentTime = wildcards [5]--used in DetailedInfobar by default.
local CurrentWHATEVER
CurrentWHATEVER = wildcards [6]
local CurrentArmed
CurrentArmed = wildcards [7]--used in DetailedInfobar by default.
local CurrentSpeed
CurrentSpeed = wildcards [8]--used in DetailedInfobar by default.
local CurrentHealth
CurrentHealth = tonumber(wildcards [9])--used in DetailedInfobar by default.
local CurrentHealthMax
CurrentHealthMax = tonumber(wildcards [10])--used in DetailedInfobar by default.
local CurrentStun
CurrentStun = tonumber(wildcards [11])--used in DetailedInfobar by default.
local CurrentStunMax
CurrentStunMax = tonumber(wildcards [12])--used in DetailedInfobar by default.
local CurrentStamina
CurrentStamina = tonumber(wildcards [13])--used in DetailedInfobar by default.
local CurrentStaminaMax
CurrentStaminaMax = tonumber(wildcards [14])--used in DetailedInfobar by default.
local CurrentPosition
CurrentPosition = wildcards [15]--used in DetailedInfobar by default.
--Setting up default look
InfoClear ()
InfoBackground ("wheat")
InfoFont ("Verdana",10,1) --last digit represents style - 0=normal and 1=bold.
Info ("You're ")
--CurrentHealth
if (CurrentHealth/CurrentHealthMax) < 5/100 then
InfoColour ("crimson")
Info ("at Death's door, ")
elseif (CurrentHealth/CurrentHealthMax) < 15/100 then
InfoColour ("crimson")
Info ("dying, ")
elseif (CurrentHealth/CurrentHealthMax) < 30/100 then
InfoColour ("firebrick")
Info ("severely wounded, ")
elseif (CurrentHealth/CurrentHealthMax) < 66/100 then
InfoColour ("darkorange")
Info ("damaged, ")
elseif (CurrentHealth/CurrentHealthMax) < 85/100 then
InfoColour ("darkgreen")
Info ("hurting, ")
elseif (CurrentHealth/CurrentHealthMax) < 100/100 then
InfoColour ("black")
Info ("mostly unharmed, ")
end
---CurrentStamina
if (CurrentStamina/CurrentStaminaMax) < 5/100 then
InfoColour ("crimson")
Info ("done for, ")
elseif (CurrentStamina/CurrentStaminaMax) < 15/100 then
InfoColour ("crimson")
Info ("practically crawling, ")
elseif (CurrentStamina/CurrentStaminaMax) < 35/100 then
InfoColour ("firebrick")
Info ("exhausted, ")
elseif (CurrentStamina/CurrentStaminaMax) < 65/100 then
InfoColour ("darkorange")
Info ("wearing down, ")
elseif (CurrentStamina/CurrentStaminaMax) < 80/100 then
InfoColour ("darkgreen")
Info ("lightly fatigued, ")
end
--CurrentStun
if (CurrentStun/CurrentStunMax) < 5/100 then
InfoColour ("crimson")
Info ("see only black, ")
elseif (CurrentStun/CurrentStunMax) < 15/100 then
InfoColour ("crimson")
Info ("nearly unconcious, ")
elseif (CurrentStun/CurrentStunMax) < 30/100 then
InfoColour ("firebrick")
Info ("mentally wracked, ")
elseif (CurrentStun/CurrentStunMax) < 45/100 then
InfoColour ("darkorange")
Info ("woozy, ")
elseif (CurrentStun/CurrentStunMax) < 65/100 then
InfoColour ("darkgreen")
Info ("dizzy, ")
end
--Armed/Unarmed Status
InfoColour ("black")
if CurrentArmed == "armed" then
InfoColour ("firebrick")
Info ("armed, ")
elseif CurrentArmed == "unarmed" then
InfoColour ("black")
Info ("unarmed, ")
end
--Riding
InfoColour ("black")
if Riding then
Info ("mounted, ")
else
Info ("")
end
--Walking/Running Status
InfoColour ("black")
Info ("and set for ")
if CurrentSpeed == "running" then
InfoColour ("firebrick")
elseif CurrentSpeed == "sneaking" then
InfoColour ("darkorange")
elseif CurrentSpeed then
InfoColour ("black")
end
Info (CurrentSpeed, ". ")
--Position. I.e. Standing or Fighting:Target Status
InfoColour ("black")
Info ("Also, you're ")
if CurrentPosition == "Fighting" then
InfoColour ("firebrick")
elseif CurrentPosition == "sleeping" then
InfoColour ("darkorange")
elseif CurrentPosition == "resting" then
InfoColour ("darkblue")
elseif CurrentPosition == "sitting" then
InfoColour ("darkgreen")
elseif CurrentPosition then
InfoColour ("black")
end
Info (CurrentPosition, ". ")
--Time of Day
InfoColour ("black")
Info ("It's ")
if CurrentTime == "dusk" then
InfoColour ("firebrick")
Info (CurrentTime, " ")
elseif CurrentTime == "late afternoon" then
InfoColour ("darkorange")
Info (CurrentTime , " ")
elseif CurrentTime == "unknown" then
InfoColour ("black")
Info ("underground", " ")
elseif CurrentTime then
InfoColour ("black")
Info (CurrentTime , ". ")
end
end --- end descriptive infobar ---