Sorry about the subject, didn't know how to word my problem. (brain injury)
I am using gammon's adaption of Friendish's mini chat window. It works great, except sometimes when you are in combat, the chat will go on the same line as your health bar.
Let me try to make this more clear with some examples.
Normally when you say, tell, gossip, etc. the MUD I play makes a new line and puts it under the health bar, or prompt, or whatever it's called.
<500hp(500) 500ma(500) 500mv(500)(500) 500gp sp: [commn] >
You say (in common), 'test'.
However, sometimes when you are in combat, it puts it on the same line as the health bar, or prompt, or whatever it's called.
<500hp(500) 500ma(500) 500mv(500)(500) 500gp sp: [commn] > You say (in common), 'test'.
When it goes on the same line, it fails to echo it in the miniwindow. I managed to make a temp. fix by adding more triggers.
<trigger
enabled="y"
match="You say (in common), '*'."
script="chats"
omit_from_output="y"
sequence="100"
></trigger>
<trigger
enabled="y"
match="* You say (in common), '*'."
script="chats"
omit_from_output="y"
sequence="100"
></trigger>
So with that temp. fix, when chat happens on the same line as the health bar, it does echo it in the miniwindow, except it also echos the entire health bar.
What I'm trying to do is make it so it omits the health bar when the chat screws up like that in game and goes on the same line as the health bar.
I'm thinking I need to make a new chats function for the triggers that catch the health bar so it can be omitted from the miniwindow, but I'm already way over my head with this, and hoping for some help.
Like for the * You say (in common), '*'. one it would send it to chatsa instead of chats.
Here's chats function.
function chats (name, line, wildcards, styles)
-- echo in this world as well if the user wants
if echo then
for _, v in ipairs (styles) do
ColourTell (RGBColourToName (v.textcolour),RGBColourToName
(v.backcolour),v.text)
end -- for each style run
Note ("") -- wrap up line
end -- echo wanted
-- inject timestamp if wanted
if timestamp then
local tstamp = os.date (date_format)
table.insert (styles, 1, {
text = tstamp,
textcolour = ColourNameToRGB (TIMESTAMP_TEXT_COLOUR),
backcolour = ColourNameToRGB (TIMESTAMP_BACK_COLOUR),
length = string.len (tstamp),
style = 0,
} )
end -- if
Here is what I am wanting to do, and from what I read googling, ipairs wouldn't work like this, but this is just to try to make things more clear what I am wanting.
function chatsa (healthbar, name, line, wildcards, styles)
Now I do capture the hp for another trigger like this.
<*hp(*) *ma(*) *mv(*)(*) *gp sp: [*] > *
then it runs
hp = "%1"
SetVariable("hp", hp)
I'm very very very new to lua and for that matter, any programming language, so I don't imagine the way I define the variable is correct, but it works, so I've left it that way lol. Able to call it from other triggers with GetVariable and has been working perfectly.
I'm thinking I need to somehow redo the way I capture the health bar, putting every * into a variable like I did with the hp, and then somehow use it for the miniwindow so I can omit it.
Sorry if this is all too confusing or too little or too much information.
I hope from this mess of a post you can understand my problem, how I am trying to fix it, and what I am needing help with.
If not please ask me anything and I will do my best to answer. |