Search found 73 matches

by chrio
Mon Aug 09, 2021 4:46 pm
Forum: Mudlet Mapper
Topic: Color Detection for Room Mapping?
Replies: 1
Views: 6691

Re: Color Detection for Room Mapping?

Ooh, that's from Nannymud, right? :) I use these settings to get the ansi colors on room/exit: toggle ansi on toggle oshort on colour exit green colour short boldwhite If you use other colors, just change the initial trigger to pick up the 'oshort' color. The exit color can be whatever you want, sin...
by chrio
Thu Aug 05, 2021 11:53 am
Forum: Scripts & Packages
Topic: Dark vertical scrollbar
Replies: 0
Views: 4061

Dark vertical scrollbar

If you want a dark style for the scrollbar, but don't necessarily want the whole dark theme package you can use this script: setAppStyleSheet [[ QScrollBar:vertical { border: 1px solid #303030; background: #222222; width: 15px; margin: 12px 0 12px 0; } QScrollBar::handle:vertical { background: #4444...
by chrio
Wed Aug 04, 2021 11:37 am
Forum: Scripts & Packages
Topic: Auto-update scripts from file (helper-script)
Replies: 3
Views: 3667

Re: Auto-update scripts from file (helper-script)

I updated the script to give a warning if it tries to update a file that causes an error.
Failed updating script [somescript]! Check code for errors and try again
I added the script to a github repo, so further updates can be found on https://github.com/chrio/MudletScripts
by chrio
Tue Aug 03, 2021 10:55 am
Forum: Scripts & Packages
Topic: Auto-update scripts from file (helper-script)
Replies: 3
Views: 3667

Re: Auto-update scripts from file (helper-script)

I noticed that if you have a syntax error in the script file, then setScript() can not update the code. When that happens you either have to debug your file and save again, or do the old copy-paste to get better indications on where your script syntax fails.
by chrio
Mon Aug 02, 2021 5:07 pm
Forum: Help Forum
Topic: Help converting string into seperate strings
Replies: 4
Views: 4132

Re: Help converting string into seperate strings

demonnic wrote:
Thu Jul 22, 2021 4:31 am
You can also do
Code: [show] | [select all] lua
local str = "Chris, David and Edward"
str = str:gsub(",", ""):gsub(" and ", " ")
local names = str:split(" ")
Ooh, readable and even shorter, I like that one!
by chrio
Mon Aug 02, 2021 4:42 pm
Forum: Scripts & Packages
Topic: Auto-update scripts from file (helper-script)
Replies: 3
Views: 3667

Auto-update scripts from file (helper-script)

I made a small script that lets you auto-update your mudlet scripts from disk when the file content changes. It's pretty straightforward, but keep in mind that it will not care if you have multiple scripts with the same name, so keep the script names unique if you decide to use this. Also, a general...
by chrio
Wed Jul 21, 2021 8:23 pm
Forum: Help Forum
Topic: Help converting string into seperate strings
Replies: 4
Views: 4132

Re: Help converting string into seperate strings

Since this seems like common pattern I figured an extra solution wouldn't hurt. This is the simplest code I could come up with: local str = 'Chris, David and Edward.' local names = {} for word in str:gmatch("(%w+)") do if word ~= 'and' then table.insert(names, word) end end display(names)
by chrio
Mon Jul 30, 2018 4:08 pm
Forum: Help Forum
Topic: ANSI colors not being displayed
Replies: 18
Views: 15129

Re: ANSI colors not being displayed

Thanks for the links it was good reading. I took look at it and would like to discuss it some more. I found more on wikipedia https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters (mostly the same info, but more selective). Oh, those sequences do look wrong: Screen...
by chrio
Mon Jul 30, 2018 2:46 pm
Forum: Help Forum
Topic: ANSI colors not being displayed
Replies: 18
Views: 15129

Re: ANSI colors not being displayed

Sorry for the late response, I've been on vacation over the weekend.
Vadi wrote:
Fri Jul 27, 2018 4:42 pm
Would you mind reporting the issue to them about the invalid ANSI?
Sure, I'll try to get in touch with them.
by chrio
Thu Jul 26, 2018 2:13 pm
Forum: Help Forum
Topic: ANSI colors not being displayed
Replies: 18
Views: 15129

Re: ANSI colors not being displayed

I am just taking a look at this and will see what I can find - I expect some recent improvement I made to the ANSI SGR code handling has made things much better except for a corner case that is now being hit... I tested with mudlet 3.0.1 downloaded from the archives and it had the same problem. Per...