Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Add a command to history?

Add a command to history?

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


Posted by Kahenraz   (75 posts)  Bio
Date Mon 02 Apr 2018 03:55 PM (UTC)
Message
Is there a way to add a command directly to the the history?

I have a script which runs and sends a particular command to the world but I want a different command to appear in the history.

For example:

I can use SendPush() to send a command "do something now" but I want the command history to "dsn" in the command history to run the alias for this command rather than same command exactly.

Send/SendPush does not pass the command to be processed as an alias so I'm looking at the possibility to just to Send() and add my own command directly to the history but I don't see a way to do this.
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #1 on Mon 02 Apr 2018 05:10 PM (UTC)
Message
Use SelectCommand(), PasteCommand("foo"), PushCommand().

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Kahenraz   (75 posts)  Bio
Date Reply #2 on Tue 03 Apr 2018 01:13 AM (UTC)
Message
I don't know if there is a race condition or what but this doesn't seem to work.

SelectCommand() -- confirmed working
PasteCommand("foo") -- confirmed working

And then when PushCommand() is called, the command window blanks but nothing else happens. Even if I just want it to sent text like "north" it will blank out the command window but nothing gets sent to the world.

I also tried SetCommand() with the same result.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 03 Apr 2018 02:32 AM (UTC)
Message
It seems to work for me:


<aliases>
  <alias
   match="test"
   enabled="y"
   omit_from_command_history="y"
   send_to="12"
   sequence="100"
  >
  <send>

  Send ("sigh")
  SelectCommand()
  PasteCommand("foo")
  PushCommand()

</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Now typing "test" sends "sigh" to the world but "foo" ends up in the command history.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


14,087 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.