Make a noise

Post Reply
Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Make a noise

Post by Talkslowtome »

Hi again. Simple triggers and aliases have become easy for me. Thanks to your collective help in my previous questions.
When the mud I play generates a box symbol (which I can't paste into this box or into any of the numbered substring boxes) I want mudlet to play a sound file. If I could paste in the box it would be easy. But I can't. I can however paste it into the big white box at the bottom of the trigger dialog.

Is it possible to work this out?

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Make a noise

Post by SlySven »

Box symbol, do you mean something like the U+2610 codepoint '☐'. In the Mudlet application this could well be due to the fact that the incoming stream parser and some other part of the application does NOT yet parse or handle Utf-8 {a way of encoding Unicode in a variable number of 8-bit bytes}.

I certainly want that to be in place for Mudlet 4.0 and as I come into contact with various parts of the Lua subsystem I am revising them to parse Utf-8 to and from user's scripts but there are some significant chunks elsewhere that do need revising to handle it.

As for your browser - check to see what encoding it is set to use (on FireFox check "View"->"Text Encoding" and see whether it is set for Unicode or something limited instead), also check to see whether your browser is set to force-ably use a font with a restricted character-set or can use what the server suggests, (again on FireFox there is "Tools"->"Options"->"Content"->"Advance" under Fonts and Colors->"Allow pages to choose their own fonts, instead of my selections above" checkbox)... ;)

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Make a noise

Post by Jor'Mox »

I would try making a trigger off of some other text that shows up when one of these boxes is printed, and use the string.byte function to see if I could figure out what the actual character is. You can do this to get a relatively easy on the eyes listing of every character in a line: table.concat({string.byte(line,1,#line)},", "). Then look for anything below 32 or above 126. Alternately, you could make something to do the looking for you, like this:
Code: [show] | [select all] lua
local tbl = {string.byte(line,1,#line)}
for k,v in ipairs(tbl) do
    if v < 32 or v > 126 then
        print("Character : " .. v .. " found at position " .. k .. ".")
    end
end
Then just look to see what it reports, and find the right one (assuming there are multiple different characters outside of that range, which wouldn't typically be the norm, at least in an english language environment).

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Re: Make a noise

Post by Talkslowtome »

I kept meaning to say thank you for the responses. Everytime I did I was on my phone and meant to do it when I got home. Finally, belatedly, thank you.

Post Reply