Page 2 of 2

Re: A poll for everyone

Posted: October 21st, 2018, 2:41 pm
by jsmorley
eclectic-tech wrote: October 21st, 2018, 2:37 pm Have you looked at Mordasius's Lua example? It may provide a simple reusable solution.
The only thing I would caution is that Lua is not good with Unicode characters when using a function that depends on "position" in a string. Multi-byte Unicode characters will throw it off. Staying with the 256 ASCII / Extended ASCII characters will work fine with this approach.

Re: A poll for everyone

Posted: October 21st, 2018, 3:05 pm
by kyriakos876
eclectic-tech wrote: October 21st, 2018, 2:37 pm Have you looked at Mordasius's Lua example? It may provide a simple reusable solution.
This looks promising... would you mind explaining what is going on here:

Code: Select all

for n, s in ipairs(StreamsByViewer) do
	SKIN:Bang('!SetOption','MeterStream'..n..'','Text',string.format("%-8s %-20s %5d  %-6s %-10s",s.stream.Type,s.stream.Owner, s.stream.Viewers,center(s.stream.Races,7),center(s.stream.Rating,10)))
end   
I get it all, my only issue is that I don't get what this means:

Code: Select all

"%-8s %-20s %5d  %-6s %-10s"
I tried looking here: https://www.lua.org/pil/20.html
but didn't understand much...

Re: A poll for everyone

Posted: October 21st, 2018, 3:06 pm
by kyriakos876
jsmorley wrote: October 21st, 2018, 2:41 pm The only thing I would caution is that Lua is not good with Unicode characters when using a function that depends on "position" in a string. Multi-byte Unicode characters will throw it off. Staying with the 256 ASCII / Extended ASCII characters will work fine with this approach.
Oh wait, so the Celsius degree symbol wont work?

Re: A poll for everyone

Posted: October 21st, 2018, 3:10 pm
by jsmorley
kyriakos876 wrote: October 21st, 2018, 3:06 pm Oh wait, so the Celsius degree symbol wont work?
º or ° should be ok, they are ASCII 176 / 248 and are single byte characters.

Re: A poll for everyone

Posted: October 21st, 2018, 3:11 pm
by kyriakos876
jsmorley wrote: October 21st, 2018, 3:10 pm º should be ok, it's ASCII 176 and is a single byte character.
Right... my bad :Whistle