Command History for Mudlet via AutoHotKey

Post Reply
Fo-Rum
Posts: 32
Joined: Fri May 21, 2010 7:38 pm

Command History for Mudlet via AutoHotKey

Post by Fo-Rum »

Hello!

I recently picked up Mudlet 2.0, June 12, 2011 release, and for me, the command history is completely missing! So, I made my own command history using a third party program, and I am here to share this temporary solution with others.

This command history implementation is provided with the limitations of AutoHotKey_L. I cannot guarantee that it will work for you. I have been toying with it for the last few hours, and it works fairly well.

It works by capturing what you send to the MUD when you press enter. It will select the text, put it in your clipboard, and then add it to the command history array. It does attempt to preserve your clipboard, but don't be surprised to find your clipboard replaced with something else, and to see your clipboard in your command history instead (this happens because the OS update is slow sometimes). If you happen to have any carriage-returns when that happens, it will get sent to the MUD. Currently, it stores up to 50 commands, and allows you to scroll up and down, with no wrapping, via the arrow keys. Pressing backspace or sending enter both put you back to the start of the command history.


If you too have a problem with the command history and are interested in this, feel free to use it. I have provided both a standalone version and the source code. This is not a perfect solution, but feel free to try and improve it for yourself if you want. To run the source code, you will need to download and install AutoHotKey_L. Most of the code is commented, the uncommented code is not commented because it would be redundant.

Hope this helps.
Attachments
mudletcommandhistorysource.zip
The source code
(1.49 KiB) Downloaded 405 times
mudletcommandhistory.zip
The standalone version
(347.18 KiB) Downloaded 445 times

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Command History for Mudlet via AutoHotKey

Post by Vadi »

Good one!

Fo-Rum
Posts: 32
Joined: Fri May 21, 2010 7:38 pm

Re: Command History for Mudlet via AutoHotKey

Post by Fo-Rum »

Yay! My command history is fixed with the latest release! My temporary solution wasn't perfect, but it did the job until this day.

If anyone is still having any trouble with their command history, I've actually explored the idea of making a Mudlet command history script instead of relying on the limits of Autohotkey. I'm more familiar with Mudlet now. This idea is only theoretical but I have no reason why it wouldn't work...

It would use the "sysDataSendRequest" event, which effectively allows you to capture and store everything sent to the game. To retrieve it, I would use something like an appropriately placed miniconsole to display what command you're on. Arrow keys should still work for browsing and enter should still be the primary send. Everything would work like a normal command history (without my autohotkey limitations!), except that the display for the command history would not be your input bar. Because it isn't relying on the clipboard, I imagine there would be no problems with losing history like with my autohotkey script.

So, I suggest you update your client if you're tired of using that dang autohotkey script as I like to think of it! If your command history is still broken, let me know and I'll consider building this idea to offer a different, and I'd say better, solution.

Post Reply