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 ➜ send command to command line

send command to command line

You need to log onto the forum to reply or create new threads.

  Refresh page


Posted by Aardwanderer   (8 posts)  Bio
Date Thu 20 Nov 2025 01:32 AM (UTC)

Amended on Thu 20 Nov 2025 03:24 AM (UTC) by Aardwanderer

Message
I am having issues sending a command to the command line.

I have Auto-repeat Command on and I use it quit often, so I don't want to turn it off. The issue I'm having is that the functions: DoAfterSpecial(.1, "", sendto.command) and SetCommand("") don't seem to work if there is already text in the command line. I confirmed that they do work if the command line is empty. I also tried creating a trigger and an alias with send_to="1" with the same result (worked if Auto-repeat Command is off, but not when on).

I tried inserting: SetOption("auto_repeat", 0) before the above functions hoping that would let them overwrite the command line text, but that didn't work.

Is there a command that will clear the command line or something I'm missing so those commands would work even with Auto-repeat Command on?

Here is my alias:

  <alias
   match="mgt *"
   enabled="y"
   group="mapper_alias"
   send_to="12"
   sequence="100"
  >
  <send>
  if "%1" == "mob" then
    Execute("mapper goto 1234")
    Execute("where mob")
    DoAfterSpecial(.1, "kill mob", sendto.command)
    --SetCommand("kill mob") --should do the same as line above, but without the .1 wait
  else
    Execute("mapper goto %1")
  end --if
  </send>
  </alias>
Top

Posted by Fiendish   USA  (2,550 posts)  Bio   Global Moderator
Date Reply #1 on Tue 25 Nov 2025 08:55 PM (UTC)
Message
This is the documented behavior of SetCommand. Try instead using SetCommandSelection followed by PasteCommand.

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

Posted by Aardwanderer   (8 posts)  Bio
Date Reply #2 on Tue 02 Dec 2025 08:46 PM (UTC)

Amended on Tue 02 Dec 2025 08:47 PM (UTC) by Aardwanderer

Message
Thank you for the response. I indeed did not read the page for SetCommand() carefully.

With those commands, I was able to get my script to work. However, I wasn't able to get them to work directly. Instead, I had to combine them with DoAfterSpecial(). I am using these inside a plugin not directly in Mushclient.


<alias
   match="mgt *"
   enabled="y"
   group="mapper_alias"
   send_to="12"
   sequence="100"
  >
  <send>
  if "%1" == "mob1" then
    Execute("mapper goto 12345")
    DoAfterSpecial(.1, "SetCommandSelection (1, -1)", sendto.script)
    DoAfterSpecial(.1, "s = PasteCommand ('kill mob1')", sendto.script)
  else
    Note("Error in 'mgt *' alias")
  end
 </send>
 </alias>

The above works.

I'm unsure why, but the following does not work.

<alias
   match="mgt *"
   enabled="y"
   group="mapper_alias"
   send_to="12"
   sequence="100"
  >
  <send>
  if "%1" == "mob1" then
    Execute("mapper goto 12345")
    SetCommandSelection (1, -1)
    PasteCommand("kill mob1")
  else
    Note("Error in 'mgt *' alias")
  end
 </send>
 </alias>


I tried removing the 'mapper goto' command to see if there was a delay issue, but that was not the case. The below only works after the .3 second pause, again, not sure why not unless using DoAfterSpecial().

<alias
   match="pc test"
   enabled="y"
   group="mapper_alias"
   send_to="12"
   sequence="100"
  >
  <send>
    SetCommandSelection (1, -1)
    PasteCommand("kill mob1")
    Note("command: 'kill mob1' entered?")
    DoAfterSpecial(.3, "SetCommandSelection (1, -1)", sendto.script)
    DoAfterSpecial(.3, "PasteCommand ('kill mob1')", sendto.script)
  </send>
</alias>

Again, thank you for your help.
Top

Posted by Fiendish   USA  (2,550 posts)  Bio   Global Moderator
Date Reply #3 on Wed 03 Dec 2025 07:28 PM (UTC)

Amended on Wed 03 Dec 2025 07:29 PM (UTC) by Fiendish

Message
Just remember that stacking a combat command after a movement command is not allowed on Aardwolf, so your movement had better be complete before you hit enter again.

https://github.com/fiendish/aardwolfclientpackage
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.


1,002 views.

You need to log onto the forum to reply or create new threads.

  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.