Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Message
| The plugin below, designed for use on Aardwolf, provides a "mirror" typing box, which you can drag to wherever you want (eg. under the output box).
It just echoes what you type, so you can keep your eyes closer to the output text. You can't actually type into it (the focus is still down the bottom on the command line), so if you need to click to select stuff you still need to do it in the "real" command window.
 |
To save and install the Echo_Command_Line plugin do this:
- Copy the code below (in the code box) to the Clipboard
- Open a text editor (such as Notepad) and paste the plugin code into it
- Save to disk on your PC, preferably in your plugins directory, as Echo_Command_Line.xml
- The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file Echo_Command_Line.xml (which you just saved in step 3) as a plugin
- Click "Close"
- Save your world file, so that the plugin loads next time you open it.
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Echo_Command_Line"
author="Nick Gammon"
id="1d489536018f38f9bf969b86"
language="Lua"
purpose="Echoes what is typed in the command window"
save_state="y"
date_written="2025-04-08 11:50:44"
requires="5.06"
version="1.0"
>
</plugin>
<script>
<![CDATA[
function OnPluginInstall ()
win = GetPluginID ()
font_id = "fn"
font_name = "Courier New" -- input font name
require "movewindow" -- load the movewindow.lua module
-- install the window movement handler, get back the window position
windowinfo = movewindow.install (win, miniwin.pos_bottom_left, miniwin.create_absolute_location)
-- make window so I can grab the font info
WindowCreate (win,
windowinfo.window_left,
windowinfo.window_top,
1, 1, -- width, height
windowinfo.window_mode,
windowinfo.window_flags,
ColourNameToRGB "#373737")
WindowFont (win, font_id, font_name, 12, false, false, false, false, 0, 0) -- normal
font_height = WindowFontInfo (win, font_id, 1) -- height
local window_width = GetInfo(274) - GetInfo(272) -- size specified by TextRectangle
local window_height = font_height + 10
-- make window correct size
WindowCreate (win, windowinfo.window_left, windowinfo.window_top,
window_width, window_height,
0, miniwin.create_absolute_location, ColourNameToRGB "white")
WindowRectOp (win, 5, 0, 0, 0, 0, 5, 15 + 0x1000)
movewindow.add_drag_handler (win, 0, 0, 0, 0, miniwin.cursor_both_arrow)
WindowShow (win)
end -- OnPluginInstall
function OnPluginSaveState ()
-- save window current location for next time
movewindow.save_state (win)
end -- function OnPluginSaveState
function OnPluginCommandChanged ()
WindowRectOp (win, miniwin.rect_fill, 0, 0, 0, 0, ColourNameToRGB ("white")) -- clear existing content
WindowText (win, font_id, GetCommand(), 5, 5, 0, 0, ColourNameToRGB ("black"))
Repaint ()
end -- function
]]>
</script>
</muclient>
If you are not using Aardwolf replace:
local window_width = GetInfo(274) - GetInfo(272) -- size specified by TextRectangle
by:
local window_width = GetInfo(281) -- use whole output window width
You can change the font name by editing this line:
font_name = "Courier New" -- input font name
You can change the font size by editing this line and changing "12" to something else:
WindowFont (win, font_id, font_name, 12, false, false, false, false, 0, 0) -- normal
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|