Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Loselessly transposing output to miniwindow?

Loselessly transposing output to miniwindow?

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


Posted by VBMeireles   Brazil  (47 posts)  Bio
Date Tue 14 Sep 2010 07:42 PM (UTC)
Message
What I'm trying to do is having the whole "score" output transposed to a miniwindow at the side.

At the moment I have one trigger to each line of the score that, upon matching the sentence, omits it from output while printing it to the miniwindow at the prefixed position.

However, even though the score is color coded, it's all being transposed in plain white color, as I'm just using %0 to get the expression.

I'd like to know the simplest workaround (even if the simplest is still complex) to simply transpose the output text, using the same colors etc, to the miniwindow.

Vinícius
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 14 Sep 2010 09:22 PM (UTC)
Message
See this:

http://gammon.com.au/forum/?id=9965

That shows copying an inventory to a miniwindow, retaining colours (you effectively have to copy the style runs). However it is quite short. It also shows how you can omit from output.

Basically doing a "score" would be almost identical, except for the initial command you send, and how you detect the start and end of the stuff you want to copy.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by VBMeireles   Brazil  (47 posts)  Bio
Date Reply #2 on Wed 15 Sep 2010 12:54 AM (UTC)
Message
Thanks! It is a little more complex than I expected, though.

Maybe I should switch from the miniwindow idea to do like Aardwolf's plugin, where they use additional "world" windows to redirect the text into.

Would that be simpler as a single function for text redirection? Omits output from the world but sends it as-is to another window?

Vinícius
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 15 Sep 2010 01:04 AM (UTC)

Amended on Wed 15 Sep 2010 01:05 AM (UTC) by Nick Gammon

Message
No. That was a mess really. That is one of the reasons I did the miniwindows. You constantly have to worry about two "world" files being open. The relevant part of the miniwindow approach is here:


for i, styles in ipairs (inv) do

  local x = 5
  for _, style in ipairs (styles) do
    x = x + WindowText (win, font, style.text, x, y, 0, 0, style.textcolour)
  end -- for
  y = y + font_height

end -- for each inventory item


That isn't too complicated. You will have more complication trying to do it the other way.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 15 Sep 2010 05:04 AM (UTC)
Message
Also see this thread:

http://www.gammon.com.au/forum/?id=10515

That describes a miniwindow you can do coloured text in, just be sending simple calls from another plugin.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


19,198 views.

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

Go to topic:           Search the forum


[Go to top] top

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