Download Infobar 3.2 \ Graphical Status Bar for MUSHclient

Started by Agent_137, April 09, 2009, 02:51:29 PM

Quote from: Irulan on February 02, 2010, 12:00:03 PM
Just a quick note to people using Vista (like me...Vista makes baby jesus cry) Downloading the script was a pain in the rear...it kept downloading it as .htm instead of .lua and I finally had to have Agent just email it to me. Vista users be wary  :P!

This was not a problem for me - because I use Firefox??

Maybe so, I was using IE, and then needed to switch over to chrome. I've decided the combination of IE and VISTA sucks!
Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."
---
Inara: "Thank you for the wine. It's very... fresh."

Mal: "To Kaylee, and her inter-engine fermentation system."


Quote from: Agent_137 on February 02, 2010, 12:47:01 PM
lol, yes. combining two piles of crap just gets you one BIG pile of crap.

o is that wat synergy is?
Quote from: WarriorPoet
I play this game to pretend to chop muthafuckaz up with bone swords.
Quote from: SmuzI come to the GDB to roleplay being deep and wise.
Quote from: VanthSynthesis, you scare me a little bit.

Quote from: alicedavignon on April 23, 2009, 08:39:25 AM
Seems like there are some encoding issued under WINE. A pity really. :(



Did anyone ever figure out a fix for this? I've tried changing the font in the actual script to no avail. I can -almost- make out numbers, but the rest is a jumbled mess.

it's a conflict between infobar fonts and wine. check out this thread for answers:
http://www.gammon.com.au/forum/?id=10152&page=999

in summary, you can try a bunch of different fonts until one works, or you can run the fix from winetricks. (details on that thread.)

if you find a working font let me know and i'll update the source.

Quote from: Agent_137 on May 03, 2010, 05:39:43 PM
it's a conflict between infobar fonts and wine. check out this thread for answers:
http://www.gammon.com.au/forum/?id=10152&page=999

in summary, you can try a bunch of different fonts until one works, or you can run the fix from winetricks. (details on that thread.)

if you find a working font let me know and i'll update the source.

Downloaded the fix...and now I just see symbols rather than any form of letters at all...It is interesting to have an airplane as part of my health, though.

I'm going to play with fonts..and see if I can figure anything out!

did you look over the packages that come with winetricks and install all the fonts?

http://wiki.winehq.org/winetricks

Or, if you are sure you installed the corefonts package, change the font from verdana in the script (two places) to Courier.

verdana is kinda weird that's left over from when i first got the base script. Blame delirium.

tiptoe, I assume you figured it out since you didn't post back?

In anycase, I changed the font in the script from Verdana (windows only) to Helvetica, which linux, mac and windows all have. I'm sure that would fix the issue. Also moved the file to a new location for easier download.

shade,
agent

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 ---

Oh, and you verdana-intolerant people may want to edit it further to switch the font to helvetica. ;)

Sexy, makes me want to download the old MushClient again to use it. But I can't fucking spell, so I use KildClient, which is free, and has spell checking. Oh well.
"rogues do it from behind"
Quote[19:40] FightClub: tremendous sandstorm i can't move.
[19:40] Clearsighted: Good
[19:41] Clearsighted: Tremendous sandstorms are gods way of saving the mud from you.

@a strange shadow: thanks. I guess i never did get around to making that mana toggle. I hope you found the change easy and well commented?

@FightClub: mushclient has spell checking you just have to enable in the options. I mean, it's not the cool red squiggly underlines you get in Microsoft Word and stuff, but it definitely spellchecks.

@tiptoe & alicedavignon: pleeease tell us if changing it to helvetica worked.

p.s.
sorry for the delay on responding to this thread. I thought I was getting alerts when people posted on it but i guess not.

p.s.s.
I made another program for arma today. It's used to help you track your play time to the minute, even across characters if you want. It's a windows program, though. Sorry, no version for you verdana-intolerant people.


yea here's a zip file. should have probably distributed it as a zip anyway. Not for file size but just to avoid problems like this:
http://dl.dropbox.com/u/6237857/acrapyscript.zip <-- magicker version

http://dl.dropbox.com/u/6237857/acrapyscript-mundane.zip <-- mundane version (the same as strange shadow posted, but w/helvetica as font)

Thank you.  :) The normal function seems to be working but /SwapInfobar() is giving me a touch of trouble.

Edit: Not anymore. Hm.

I still use the old version. It works tons better for me.



You should be able to just remove the relevant triggers and disable the script, and also reset your prompt to whatever you like of course.

Also - bump, for those talking of prompts in that thread over yonder.

Edit: a few posts up is my re-write of the script for mundanes. :)

bump. made updates.  see original post for latest install instructions and details.

Current Users:
if you're happy with it you don't need to update since all I did was add a toggle for mana, improve the installation instructions, and add encumbrance as one of the available but non-default variables.

Kalai,
I'm sorry I never saw your posts to this thread. For some reason it's not notifying me by email anymore. Were you able to uninstall it OK? Please email me if not. And I'd love to hear about what kind of issues you had with it so I can improve it.

I think I went to a new MushClient folder or something. The issue, whatever it was, was winding me up with a 4 or 5 line nonsense prompt rather than the pretty thing it was supposed to be, but it's a bit long past to give you a detailed report.

Quote from: alicedavignon on April 23, 2009, 08:39:25 AM
Seems like there are some encoding issued under WINE. A pity really. :(


I figured this out. 2 ways to fix it.
1. remove the 2 lines from the script file that start with InfoFont (tested and works)
2. copy all the fonts from a real windows font directory into wine's windows font directory. (reportedly works)

Quote from: Adj on December 06, 2011, 02:31:26 AM
I WISH there was an Info BOX that can be made HUGE that I can place on the side.


it's called a miniwindow. If you're code savvy, you could always adapt the Achaea Health Bar Plugin for arma.

If I ever started playing arma again, that's what i would do. Don't hold your breath, though.

Just wanted to say your status bar increased my love of Arm tenfold.
QuoteSunshine all the time makes a desert.
Vote at TMS
Vote at TMC