[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Triggers & ANSI/XTERM colors

Triggers & ANSI/XTERM colors

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Grace   (2 posts)  [Biography] bio
Date Thu 13 Dec 2012 08:14 PM (UTC)
Message
I did search but I might have missed something, so if his is elsewhere, by all means let me know.

I am trying to set up proper spawn windows. Everything works as far as getting a triggered line to the spawn window, and getting the spawn text sent back to the main world. That's fine.

The part I can't figure out is how to do all of this with ANSI/XTERM colors intact. If I abandon the trigger itself enirely, I can try just getting the last line of output and looping like this:

while i<=n do
NoteColourRGB(spawn,GetStyleInfo(line,i,14),GetStyleInfo(line,i,15))
text=GetStyleInfo(line,i,1)
Tell(spawn,text)
i=i+1
end


This works fine, except that the only way GetStyleInfo works is off of line numbers, and with word-wrap on, one chat message can easily be two lines, sometimes more. (I'm not talking about multiple lines sent from the MU*, I'm talking about lines the client has broken up because of length.) I can't figure out any way to determine just which output lines that trigger represents, or any way to just take the trigger input and get the color information from that.

Is there something I'm missing, here? Is this just impossible? It doesn't seem like it should be this complicated.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 13 Dec 2012 08:38 PM (UTC)

Amended on Thu 13 Dec 2012 08:39 PM (UTC) by Nick Gammon

Message
Triggers in Lua have a fourth argument, the style runs. That is a table. The entries are documented in the help for editing a trigger:

http://www.gammon.com.au/scripts/doc.php?dialog=IDD_EDIT_TRIGGER

(Also available inside the client).

Some examples here:

Template:faq=23 Please read the MUSHclient FAQ - point 23.


(Also see FAQ 33).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Grace   (2 posts)  [Biography] bio
Date Reply #2 on Thu 13 Dec 2012 09:20 PM (UTC)
Message
Thank you! I knew there had to be something I was missing.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,703 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]