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 ➜ Can a Macro Key have multiple world.SendImmediate commands?

Can a Macro Key have multiple world.SendImmediate commands?

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


Posted by Weston   (28 posts)  Bio
Date Mon 14 Jun 2004 08:28 AM (UTC)
Message
Can a Macro Key have multiple world.SendImmediate commands?

I would like to immediately send two different commands without having to use two macro keys.

(If you need more information or don't know what I mean, please ask me a follow-up question.)
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Mon 14 Jun 2004 08:48 AM (UTC)

Amended on Mon 14 Jun 2004 08:49 AM (UTC) by Flannel

Message
Macros can be multi-line, so yes, you can send multiple things. Just type one, hit return, type the other. Just like aliases, or triggers that send more than one line.

And you shouldnt need to use the sendimmediate command, just type in whatever you want sent.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Weston   (28 posts)  Bio
Date Reply #2 on Mon 14 Jun 2004 04:13 PM (UTC)
Message
I tried that, but it doesn't work with world.SendImmediate commands.

When I put in:

/world.SendImmediate "command1"
/world.SendImmediate "command2"



In the space provided I get a 'Scripting Error'.

Error number: -2146827264
Event: Execution of line 2 column 1
Description: Expected statement
Line in error: /world.SendImmediate "command2"
Called by: Immediate execution


It does work if I remove the /world.SendImmediate "", but I want the macro key commands to bypass the queue.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Mon 14 Jun 2004 06:08 PM (UTC)
Message
It seems like there's actually a problem with sending 2 lines in one macro. You can go around that by either putting both commands on one line, using your scripting language's convention for doing so (think that won't work in vbscript though), or put your script in an alias and send that alias from a macro.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 14 Jun 2004 09:57 PM (UTC)
Message
Quote:

When I put in:

/world.SendImmediate "command1"
/world.SendImmediate "command2"



In the space provided I get a 'Scripting Error'.


The "script escape" character only needs to appear once. Thus for multiple lines it should read:


/world.SendImmediate "command1"
world.SendImmediate "command2"


That will work.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Weston   (28 posts)  Bio
Date Reply #5 on Tue 15 Jun 2004 05:53 AM (UTC)
Message
It works now! This is great!

Thanks for the help. I should have known it would be something that simple.
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.


17,746 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.