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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  color text in notepad windows?

color text in notepad windows?

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


Posted by Guest1   USA  (256 posts)
Date Fri 30 Jun 2006 11:22 PM (UTC)

Amended on Fri 30 Jun 2006 11:24 PM (UTC) by Guest1

Message
Hello. Been ages since I've upgraded, so I'm wanting to know if the script generated notepad windows I create and position to the side of my main play window in MC can yet have different color text in them at the same time.

One of the windows I use is for spell status (spells on self, like iron skin, strength etc) - 'up' or 'down'. There is also a mud generated message 1 minute before a spell drops as a warning. I have scripted so I have a list of spells and alongside the status of each - up, down, or 1min. What I'd really like to do is color code those (ie green for up, yellow for 1min left, red for down)... so do any changes with MC in recent times allow me to do this? The old MC version I use allows a choice of text color in a notepad window, but it effects all text in that window, not just parts of it like something like HTML tags would.

There's another client called WinTin by one of our old immorts which can do this, but I don't want to rewrite all my scripts for a different client when I actually like MC so much.

p.s. I use VB at present for my scripts.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 01 Jul 2006 12:40 AM (UTC)
Message
I saw a post recently here by someone that simply makes a world file that doesn't connect to anything (connects to 0.0.0.0 or something) and then scripts ColourNote to that world to use it as a simulated Notepad that lets him write coloured text as much as he likes. That might work for you.

The current notepad implementation only supports a single foreground and text colour at a time.

- Nick Gammon

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

Posted by Guest1   USA  (256 posts)
Date Reply #2 on Sat 01 Jul 2006 02:09 AM (UTC)

Amended on Sat 01 Jul 2006 02:10 AM (UTC) by Guest1

Message
Ok thanks, although with using a world window I'm not sure if I can refresh the window like I do with a notepad window every time there is a change in status of one of the spells, although it would work well for putting tells onto a separate window (which I do already using append to stop the tells getting lost in gameplay spam).
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 01 Jul 2006 03:15 AM (UTC)
Message
You could use DeleteOutput (in the extra window) to empty it and then replace it.

- Nick Gammon

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

Posted by Guest1   USA  (256 posts)
Date Reply #4 on Sat 01 Jul 2006 07:10 AM (UTC)

Amended on Sat 01 Jul 2006 07:21 AM (UTC) by Guest1

Message
Ok thanks. It's probably something really obvious, but how do I (or can I) get rid of the text input box at the bottom of these separate world windows that I intend to use as notepads..?

p.s. I think this is the post you were referring to above:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6551
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Mon 03 Jul 2006 06:31 AM (UTC)
Message
I don't think you can completely remove the command box, the most you can do is size it down to one line.

- Nick Gammon

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

Posted by Guest1   USA  (256 posts)
Date Reply #6 on Mon 03 Jul 2006 02:05 PM (UTC)
Message
Nods, it seems so, thanks.

Can you please consider notepad implementation with multicolor text a suggestion for some future release :)
[Go to top] top

Posted by MattMc   USA  (54 posts)  [Biography] bio
Date Reply #7 on Sun 23 Jul 2006 02:12 AM (UTC)
Message
Hi,

I use the "world window that connects to nada" approach and I really enjoy it.

I layer my windows so that my actual game play takes up about 8/10s of the screen, and overlaps over the capture window - to cover the input line.

I use the plugin Nick made to gag commands sent to the window, and I setup that world file to not popup on disconnect etc.

Matt
[Go to top] top

Posted by Gore   (207 posts)  [Biography] bio
Date Reply #8 on Wed 26 Jul 2006 04:25 PM (UTC)
Message
also is there anyway to make it so that you can't ctrl+tab to the notepad window, or make it so that when you go to close it, it doesn't want to save?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Wed 26 Jul 2006 10:41 PM (UTC)

Amended on Wed 26 Jul 2006 10:42 PM (UTC) by Nick Gammon

Message
This alias will let you switch worlds but ignore notepad windows:


<aliases>
  <alias
   match="SwitchWorld"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
do -- protect global variables
  
  local worlds = GetWorldIdList ()  -- find all worlds
  local us = GetWorldID ()          -- find our world
  
  local function find_world (k, v)
     if v == us then 
       return k
     end -- if our world
   end -- function find_world
       
  -- find where we are in the list
  
  local n = table.foreach (worlds, find_world)
  
  -- if found, go to next one up
  
  if n then
    n = n + 1 -- next world
    if n &gt; table.getn (worlds) then
      n = 1   -- back to first world
    end -- wrap-around
    GetWorldById (worlds [n]):Activate ()
  end -- found us

end -- do</send>
  </alias>
</aliases>



Now make an accelerator:


Accelerator ("ctrl+tab", "SwitchWorld")


Now Ctrl+Tab switches worlds, not notepads.

Quote:

... make it so that when you go to close it, it doesn't want to save?


Added a new script function to version 3.76 that lets you control whether or not MUSHclient offers to save notepad windows.

- Nick Gammon

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

Posted by Gore   (207 posts)  [Biography] bio
Date Reply #10 on Thu 27 Jul 2006 12:19 AM (UTC)
Message
That is really crazy, thanks Nick. How easy would that be to port into vbscript on my own? Just a little research of Lua? or should I just go out and learn lua, and convert all of my scripts into it?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Thu 27 Jul 2006 05:54 AM (UTC)
Message
You could make that into a Lua plugin (put the Accelerator command into the OnPluginInstall function).

However it is not particularly Lua-specific.

Just take the general idea and do it in another language if you want. I am just getting the list of open worlds, finding the current one in the list, and adding 1 (to the index). Then if that exceeds the number of worlds in the list I take the first world.


- Nick Gammon

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


31,988 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]