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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Inline Editing and Cursor Placement
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Inline Editing and Cursor Placement

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Wahnsinn   USA  (8 posts)  [Biography] bio
Date Tue 21 Feb 2012 03:51 PM (UTC)  quote  ]
Message
Hi everyone! I'm incredibly impressed with Nick's MUSHclient, as well as the fact that it has such an active support community. I've rediscovered my long lost love of a game called MajorMUD recently and I'm hoping to build a configuration for MUSHclient that will allow people to benefit from its awesome capabilities while playing.

The biggest hurdle I have in feeling like I can run with this is a certain aspect of the game that I think it best summed up as using inline editing and cursor placement, which I saw WillFa mention in the Cisco telnet thread:
WillFa said:

IOS kind of expects vt100 emulation, and cursor placement and inline editting. While MC is great, it's not really the best tool for this job. As for triggers and switch maintenance, that's what SNMP is for.

While Telnet is the original configuration protocol for switches, these days you're pretty much going to use SSH for the security. Leaving Telnet open for administration is asking to get hacked and a man-in-the-middle attack.

MC is definitely great, and I don't need it to be the best tool for this job but I'd like to figure out if it's possible to make it passable at it. Right now the closest I can get it is pretty garbled. When a character levels up in MajorMUD they jump into a stats editor with the command train stats. It's the one aspect that really deviates from the linear flow of the rest of the mu* style games. Here you can use the arrow keys to navigate up and down among the stat fields to assign additional points to your stats. I think the best conveyance of the situation is with screenshots, so here's what it looks like in PuTTYtel:

http://mm.winkelmanndesigns.com/putty_mm_train01.jpg

And here's how it looks in the unzip-and-use MUSHclient 4.73 with the Telnet Terminal Type set to "ANSI" and the UTF-8 box checked:

http://mm.winkelmanndesigns.com/mc_mm_train01.jpg

And if you're really hardcore, this is the debug window output from MC starting when I type "train stats" and ending after I hit enter a few times (about 9-10) to get back to the regular game prompt:

http://mm.winkelmanndesigns.com/trainstats_debug.txt

Any suggestions for a user-friendly (or just plain workable) way to interact with this in MC are greatly appreciated. I'm not averse to creating a new window or something special from scratch to handle the unique situation, just hoping for some guidance from the experts on the possibilities and approach. Thank you!
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #1 on Tue 21 Feb 2012 04:47 PM (UTC)  quote  ]

Amended on Tue 21 Feb 2012 04:52 PM (UTC) by Twisol

Message
Unfortunately, MUSHclient doesn't natively support the cursor-movement ANSI codes that your MUD outputs here. All is not lost, however! You can try to capture the MUD output via triggers, gag it, and render it into a miniwindow yourself. Since MUSHclient doesn't support pure character-mode input, you won't be able to navigate with just the arrow keys either, but you might have some luck allowing userrs to click on what they want in the miniwindow, and sending appropriate sequences to the MUD to emulate the movement.

Depending on you level of comfort with scripting in MUSHclient, and programming in general really, you might find this challenging (read: "fun") or frustrating. MUSHclient just doesn't support cursor-movement or char-mode input natively, so you have to work around it with the tools available.

See here for an introduction to miniwindows: http://www.gammon.com.au/mushclient/mw_intro.htm

(Also, I would disable unicode in MUSHclient for this game. The A's-with-dots I see, coupled with the boxes MUSHclient renders instead, tell me that it's using the ASCII characters above 127 (i.e. the high bit is set), which are explicitly invalid in UTF-8. With the Unicode setting off, MUSHclient should hopefully revert to something that makes more sense.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Wahnsinn   USA  (8 posts)  [Biography] bio
Date Reply #2 on Tue 21 Feb 2012 05:57 PM (UTC)  quote  ]
Message
Thanks Twisol! I'm a software developer, so not afraid of putting together a decently complex solution... and super grateful to have such experts available instead of having to spend hours heading in a wrong direction. I'll have to see if I can make a miniwindow that can clear and repopulate itself as the stats are adjusted. Capturing the event and the incoming data for it are straightforward enough, but with the nature of that screen I'm concerned about sending the finished data back to it properly.

Lua is definitely easy enough to pick up, especially with all the examples of existing plugins. I've only begun reading about some of the advanced concepts, but what about the chances of creating a LuaCOM object that could render a miniwindow (or similar type) capable of inline editing with cursor movement?

I knew the output window wasn't quite right yet and really appreciate your feedback on adjusting the settings. I'll keep experimenting tonight :)
[Go to top] top

Posted by Nick Gammon   Australia  (19,433 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 22 Feb 2012 03:52 AM (UTC)  quote  ]
Message
One suggestion is to leave the game when you level, jump into PuTTY and adjust your stats. Then go back to MUSHclient.

There have been extensive discussions about this cursor-editing thing, and it just isn't going to be implemented. It's too complicated with things like triggers and logging (how *would* you log all those cursor movements?).

If you are keen you could make a miniwindow handle it, I'm not sure it's worth the effort.

- Nick Gammon

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

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Reply #4 on Wed 22 Feb 2012 04:10 AM (UTC)  quote  ]
Message
Wahnsinn said:
Lua is definitely easy enough to pick up, especially with all the examples of existing plugins. I've only begun reading about some of the advanced concepts, but what about the chances of creating a LuaCOM object that could render a miniwindow (or similar type) capable of inline editing with cursor movement?

Well, it seems that it may be possible to override the arrow keys. If you use the Input -> Key Name menu, you can hit a key and see what its "name" is as MUSHclient sees it. That can be used as a parameter to the Accelerator() function to create new keybindings, so you could conceivably make that work. You'd probably want those to be temporary and only last while in the editor though.

Not sure about LuaCOM, I'm not really familiar with COM in general.

Keep us posted (or even just me)! I'm really interested in seeing what people do with MC's miniwindows.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Wahnsinn   USA  (8 posts)  [Biography] bio
Date Reply #5 on Thu 23 Feb 2012 01:54 PM (UTC)  quote  ]
Message
Thank you both for the quick replies to my question. I'm really enjoying working with MUSHclient and had decided exactly as Nick put it - working with the stats screen is a low priority task so I'm going to get all the other aspects of MUSHclient up to speed for MajorMUD first. That should theoretically get me very comfortable in Lua too, so this topic will probably be revisited at some point in the future. In the meantime the stats screen can be used with PuTTY or the existing commercial-but-quirky-and-unsupported client that I'm making it a goal to replace :)
[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.


2,357 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]