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.
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.
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).
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..?
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 > 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.
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?
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.