tabs and mudlet

Post Reply
quentinnuk
Posts: 8
Joined: Mon Jan 21, 2019 3:29 pm

tabs and mudlet

Post by quentinnuk » Mon Jan 21, 2019 9:22 pm

I see this has come up before but what I read suggests its resolved but doesn't seem to be the case for me.

The MUD i am playing outputs a score with tabs in it; eg as shown on a plain telnet client:

Code: Select all

*score
Score to date: 41019
Level of experience: necromancer
Strength: 100	Stamina: 96	Dexterity: 100	Sex: male
Maximum stamina: 100
Weight carried: 0g (max. weight: 100000g)
Objects carried: 0 (max. number: 12)
Games played to date: 45
*
The gaps between Strength, Stamina, Dexterity and Sex are separated by tabs. On Mudlet these display like this:

Code: Select all

sc
Score to date: 41019
Level of experience: necromancer
Strength: 100                Stamina: 91                                                       Dexterity: 100                       
Maximum stamina: 100
Weight carried: 0g (max. weight: 100000g)
Objects carried: 0 (max. number: 12)
Games played to date: 44
*
Sex is lost off the edge of the window and the tab spacing is all wrong. Does anyone know how to fix this? Im on mudlet 3.16.1 on MacOS

THanks

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

Re: tabs and mudlet

Post by SlySven » Tue Jan 22, 2019 3:18 am

IIRC you should be able to fire trigger off of the tab character - sounds like you need something to replace each one with just a space or two...

User avatar
Vadi
Posts: 4712
Joined: Sat Mar 14, 2009 3:13 pm

Re: tabs and mudlet

Post by Vadi » Tue Jan 22, 2019 6:07 am


quentinnuk
Posts: 8
Joined: Mon Jan 21, 2019 3:29 pm

Re: tabs and mudlet

Post by quentinnuk » Tue Jan 22, 2019 3:17 pm

Thanks Vadi, It does a job, but is not perfect as it is replacing tab characters with 8 spaces whereas it should really be moving to the next mod 8 column.

User avatar
Vadi
Posts: 4712
Joined: Sat Mar 14, 2009 3:13 pm

Re: tabs and mudlet

Post by Vadi » Tue Jan 22, 2019 3:22 pm

That's kind of harder to do. Ideally the game just sends spaces instead and does the formatting itself...

quentinnuk
Posts: 8
Joined: Mon Jan 21, 2019 3:29 pm

Re: tabs and mudlet

Post by quentinnuk » Tue Jan 22, 2019 3:26 pm

I found another solution in the forums which works perfectly:

Code: Select all

local pos = selectString("\t",1)
while pos ~= -1 do
   replace(string.rep(" ",8 - math.fmod(pos,8)))
   pos = selectString("\t",1)
end

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests