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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  trying to adapt to mushclient from mcl
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

trying to adapt to mushclient from mcl

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


Posted by Drenyx   (5 posts)  [Biography] bio
Date Wed 29 Sep 2010 05:01 AM (UTC)
Message
I've been using mcl on linux for a good 10 years or more, and still love it. The problems I was having is while it does have triggers/perl/python scripting, there is really no userbase I've found to seek support since the last update (maintanence release only) was 7 years ago (almost to the day!)

So far I've been really impressed with mushclient for having the forums it does, being free now and the general flexibility to make things the way you want it. I've been able to figure out a few things from the forums to make it 'close enough' to the habits I've picked up from 10 years on another client, but just a few things would be awesome if someone could help me out.

I had mcl setup where ESC would clear the input line (without saving in command history) and Ctrl-C would clear the input line with saving the command history. I have the ESC set to clear the input line but my fingers still prefer ctrl-c. I saw accelerator stuff should be able to bind to ctrl-c but how would I affect the input line?

My other major issue I would love to have worked with: I'm not used to jumping between keyboard and mouse for mud client, my hands stay on the keyboard. When I use the scrollback, pgup and pgdown work but jump by full pages..if I want to read something near the edge of the page, I have to use the mouse and scrollbar. I would like to be able to have the scrollback work in half pages if there's a way to set that.

I also note with mcl when in scrollback I was able to use arrow keys for fine scrolling and then reverted to controlling command history when scrollback was exited. I would put this 3rd part under the 'would be nice but not nessecary'

I'm working to make adjustments to a different environment but I'm sure I'm not the only one out there that's spent too many hours mudding and the fingers do things too directly to think about doing something different. Thanks in advance.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Wed 29 Sep 2010 05:10 AM (UTC)
Message
Hallos!

With regards to scrolling back, you can use Ctrl+Up and Ctrl+Down to move one line at a time in either direction.

'Soludra' on Achaea

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

Posted by Drenyx   (5 posts)  [Biography] bio
Date Reply #2 on Wed 29 Sep 2010 05:28 AM (UTC)
Message
Twisol said:

Hallos!

With regards to scrolling back, you can use Ctrl+Up and Ctrl+Down to move one line at a time in either direction.


That is extremely acceptable. This pretty much takes care of everything but the Ctrl-C for the input line :>

Thanks again
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #3 on Wed 29 Sep 2010 05:40 AM (UTC)

Amended on Wed 29 Sep 2010 05:46 AM (UTC) by Twisol

Message
AcceleratorTo("Ctrl+C", "PushCommand()", 12)


You'll need to put that line of script somewhere it can be executed. The best place, in my opinion, is in the "script file" that every world can be associated with. You can create one by going to Game -> Configure -> Scripting, clicking New File, and naming it something you want (like drenyx.lua). Then open the file and put that line in. Save, and you can manually execute the script file by going to Game -> Reload Script File.

If any part of setting up the script file doesn't work, you probably installed to Program Files under Windows Vista/7, which has annoying permissons set on the whole Program Files folder tree. It's easier to install MUSHclient to My Documents or somewhere similar, which (normally) doesn't have these permission problems.

[EDIT]: This, of course, assumes you're using Lua as your scripting language of choice. Other languages might differ in their syntax, but it's still the same basic method. I should point out that Lua is the suggested scripting language for MUSHclient, and it enjoys some semantic benefits due to its tight binding within MUSHclient. For example, CallPlugin() can pass multiple arguments between Lua scripts, whereas the other languages (the "WSH" languages, after the service used to enable their use) can only pass single strings.

'Soludra' on Achaea

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

Posted by Drenyx   (5 posts)  [Biography] bio
Date Reply #4 on Wed 29 Sep 2010 06:39 AM (UTC)

Amended on Wed 29 Sep 2010 07:25 AM (UTC) by Nick Gammon

Message
Twisol said:

AcceleratorTo("Ctrl+C", "PushCommand()", 12)




Works perfectly. I never have had such quick responses that was exactly the kind of answers I was looking for. Thanks again guys.

But since everyone seems so knowledgeable, I'll throw one more out there...

I'm used to connecting to a mud server/world with a command like

#open av-drenyx

and as many players on this mud we have multiple characters and switch between them sometimes rapidly (no multiplay, but as many characters as you want one at a time)

so I had configured before (in mcl) multiple connection profiles for auto-login and I could be on one connection, type 'quit' and immediately type #open av-drenyx or #open av-other etc...


so far what I've come up with is


<aliases>
  <alias
   match="#open av-*"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>world.Open ("worlds\\avatar_%1.MCL")</send>
  </alias>
</aliases>


and putting that in each 'world' for mushclient, which seems to work, and if I name my world file avatar_drenyx.MCL I can use #open av-drenyx.

The only difference between what I'm used to and what mushclient gives me is the multiple world bar, which isn't a problem, but I'd be interested if there's a better way to do this.

[EDIT] Edited by Nick to show you actually had two backslashes (the forum takes one out).
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #5 on Wed 29 Sep 2010 07:17 AM (UTC)
Message
Drenyx said:
Works perfectly. I never have had such quick responses that was exactly the kind of answers I was looking for. Thanks again guys.

Glad to help! :)

Drenyx said:
#open av-drenyx

I think that's a decent solution, myself, but I've never really needed quick-fire character changes. Maybe Nick or another regular can offer some better advice.

'Soludra' on Achaea

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

Posted by Nick Gammon   Australia  (21,644 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 29 Sep 2010 07:19 AM (UTC)
Message
Drenyx said:

My other major issue I would love to have worked with: I'm not used to jumping between keyboard and mouse for mud client, my hands stay on the keyboard. When I use the scrollback, pgup and pgdown work but jump by full pages..if I want to read something near the edge of the page, I have to use the mouse and scrollbar. I would like to be able to have the scrollback work in half pages if there's a way to set that.


Funnily enough, control over scrolling was recently added (version 4.60).

If you make a script file with this in it:


function scroll_lines (n)
  SetScroll (GetInfo (296) + GetInfo (212) * n)
end -- scroll_up_6_lines 

AcceleratorTo ("Ctrl+PageUp", "scroll_lines (-6)", sendto.script)
AcceleratorTo ("Ctrl+PageDown", "scroll_lines (6)", sendto.script)



That will let you use Ctrl+PgUp and Ctrl+PgDn for finer scrolling (in this case 6 lines but you can obviously adjust that).


- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,644 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Wed 29 Sep 2010 07:22 AM (UTC)

Amended on Wed 29 Sep 2010 07:23 AM (UTC) by Nick Gammon

Message
Drenyx said:


#open av-drenyx


How different are the avatars? You could make an alias to just change your character name, and then disconnect and reconnect.

Failing that, your solution looks OK on the face of it. Don't forget to put in the:


Send "quit"


so you don't multi-play.

Also you might throw in after the open:


DoCommand "close"


That queues up to close the current world file, so the net effect should be you quit the current world, open a new one, and close the existing one.

- Nick Gammon

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

Posted by Drenyx   (5 posts)  [Biography] bio
Date Reply #8 on Wed 29 Sep 2010 07:38 AM (UTC)
Message
Thanks for the info about the alternate pageup/pagedown, but I think the ctrl-up/down is good enough for me.

I normally send the 'quit' myself, if I wasn't clear mcl doesn't allow me more than one connection per instance of the program, and it wasn't as much of an issue...but that's not the side I'm worried about. I do have different sets of triggers depending on which character I'm playing, so seperate world files seems the best solution. I also do like to keep the scrollback from recent sessions, but not nessecarily log everything all the time. This leaves me to not want to close the world immediately on quit.

I guess the biggest improvement that could be made is after I open world A, quit then open world B, quit and go back to A, it no longer autoconnects. I see your

Docommand "close"

is there a similar

Docommand "connect"

or such that would make the world autoconnect again when I give the command?

Thanks again you guys are great
[Go to top] top

Posted by Nick Gammon   Australia  (21,644 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Wed 29 Sep 2010 07:48 AM (UTC)
Message
Template:function=Connect Connect

The documentation for the Connect script function is available online. It is also in the MUSHclient help file.



The DoCommand stuff really is for simulating menu choices by pushing through (queueing) a Windows message. Normally I wouldn't recommend it, but closing the world is a bit of special case.

- Nick Gammon

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

Posted by Drenyx   (5 posts)  [Biography] bio
Date Reply #10 on Fri 01 Oct 2010 11:25 PM (UTC)
Message
I'm still a bit confused as to how this happened, but in case it helps anyone else in a similar situation, here's what I've done.

When I started using

AcceleratorTo("Ctrl+C", "PushCommand()", 12)

which has been working perfectly, but somehow affected my alias to open another world. So after the errors I got and some 'playing around' I now have my alias as:

<aliases>
<alias
match="#open av-*"
enabled="y"
send_to="12"
sequence="100"
>
<send>Open ("worlds/avatar_%1.MCL")

DoCommand ("connect")</send>
</alias>
</aliases>

Somehow it likes a / instead of the \\ that it liked before for the world file under a directory. Adding the DoCommand gives me what I was looking for where after it switches to the different world it starts the connect to that one.

I did also use the suggested code from Nick and made

<aliases>
<alias
match="^\#close$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>DoCommand "close"</send>
</alias>
</aliases>

which does what I want there too.

I think this takes care of any client specific issues I needed to work around and it's down to some bits of triggers and scripting to fully settle in.

Thanks again.
[Go to top] top

Posted by Nick Gammon   Australia  (21,644 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Fri 01 Oct 2010 11:54 PM (UTC)
Message
Drenyx said:

Somehow it likes a / instead of the \\ that it liked before for the world file under a directory. Adding the DoCommand gives me what I was looking for where after it switches to the different world it starts the connect to that one.



In "send to script" the backslashes are pre-processed before the script engine, so to get a single backslash inside quotes you actually need four of them. If you had used a script file, the two would have been correct.

The DoCommand "connect" works because it is really queuing up a menu command, which then happens to the new 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.


5,258 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 FutureQuest]