Whenever the who list is checked, the styles are recorded into a whoL table.
What I am trying to do, is right before it writes it into the mini-window, check the style.text to see what format it is in.
Whether it's like this:
or like this:
This way I can trim off the comma and everything after so it just shows it like:
I'm just unsure how to go about this. Maybe something like string.find to detect the comma then gsub to cut it out?
The part I'm really confused about is when it doesn't show the class/classes and is just a word, like Demigod, God, etc.. due to those extra spaces. Then you've got two worded ones like Lesser God and Adept Finder.
Here's the code for when it writes it into the mini-winder, nothing fancy.
What's a good way to go about this?
What I am trying to do, is right before it writes it into the mini-window, check the style.text to see what format it is in.
Whether it's like this:
Hum [ Ra:30 Th:30 Cl:30 ] Wuggly, the noob scripter.
or like this:
Elf [ God ] Nick, the grand master.
This way I can trim off the comma and everything after so it just shows it like:
Hum [ Wa:30 Th:30 Ma:30 ] Wuggly
I'm just unsure how to go about this. Maybe something like string.find to detect the comma then gsub to cut it out?
The part I'm really confused about is when it doesn't show the class/classes and is just a word, like Demigod, God, etc.. due to those extra spaces. Then you've got two worded ones like Lesser God and Adept Finder.
Here's the code for when it writes it into the mini-winder, nothing fancy.
if whoL ~= nil then
local y = font_height * 2 + 35
for i, styles in ipairs (whoL) do
local x = 5
for _, style in ipairs (styles) do
x = x + WindowText (status_win, font, style.text, x, y, 0, 0, style.textcolour)
end -- for
y = y + font_height
end -- for
end -- whoL
What's a good way to go about this?