tabs and mudlet

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

tabs and mudlet

Post by quentinnuk »

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: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: tabs and mudlet

Post by SlySven »

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: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: tabs and mudlet

Post by Vadi »


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

Re: tabs and mudlet

Post by quentinnuk »

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: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: tabs and mudlet

Post by Vadi »

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

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

Re: tabs and mudlet

Post by quentinnuk »

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