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 ➜ how to execute commands in "{}"s

how to execute commands in "{}"s

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


Posted by Vls87   (3 posts)  Bio
Date Fri 02 Jun 2006 10:00 AM (UTC)

Amended on Fri 02 Jun 2006 10:02 AM (UTC) by Vls87

Message
example:wipe {123;wipe {456}}

how can i execute command "wipe" using "123;wipe {456}" as a parameter.
and then,execute command "wipe" again using "456" as a parameter

ps:"{}" can be replaced by other symbols

i'm a chinese.please forgive my poor english.^_^
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Fri 02 Jun 2006 10:17 AM (UTC)
Message
You'll need to provide more details. It would be best to just describe what it is you are trying to do in the end.

From the looks of it, I get an impression that you are trying to chain two commands, but are just taking a long way around to doing it. For example, if {} symbols can change, then are you sure you need them at all?
Top

Posted by Vls87   (3 posts)  Bio
Date Reply #2 on Sat 10 Jun 2006 01:12 PM (UTC)
Message
for example:"b {}" is a command
this command is used to check busy.After confirm I'm not busy(this will cost some seconds),it will execute commands in "{}"

eg2:b {get flower;b {tear cloth;b {jump river}}}
"get flower" & "tear cloth" will cause busy.

firstly ,I check busy,
if not,then execute "get flower;b {tear cloth;b {jump river}}"
after "get flower",I will be busy.
Secondly , I check busy again,
if not,then execute "tear cloth;b {jump river}"
and so on...
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 13 Jun 2006 02:23 AM (UTC)
Message
I'm not sure what you mean by "check busy" - is that a client or server thing?

Anyway, this alias will match things in {}:


<aliases>
  <alias
   match="*{*}"
   enabled="y"
   send_to="2"
   sequence="100"
  >
  <send>%%1 = %1
%%2 = %2</send>
  </alias>
</aliases>


Assuming you do not have ";" set up as a command stack character, if I enter:


b {get flower;b {tear cloth;b {jump river}}}


It echoes:


%1 = b
%2 = get flower;b {tear cloth;b {jump river}}


Re-entering the second part (if it isn't busy, however you test that) I get:


%1 = get flower;b
%2 = tear cloth;b {jump river}


Then re-entering the second part again:


%1 = tear cloth;b
%2 = jump river


I think you would need to split up the first part at the semicolon (eg. using utils.split) so you could send each command separately.

I hope this answers your question.

- 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.


13,694 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.