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 ➜ Lua ➜ setting up a macro

setting up a macro

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


Posted by Dragonlord   (24 posts)  Bio
Date Wed 17 Dec 2014 03:38 AM (UTC)
Message
Hello,

I am try to set up a macro that casts a spell but it needs to wait for several seconds while it casts before it removes the spellbook and stores it in my locker or pouch

open pouch
get viol pouch
wear viol
c 'enhanced strength'

DoAfter (10, "remove viol") --- this is the line i am having issues with so any ideas on what my problem is?

put voil pouch
close pouch
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #1 on Wed 17 Dec 2014 05:02 AM (UTC)
Message
What's the problem exactly? Is it trying to put the voil away before the doafter removes it or is there something else going on?

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Dragonlord   (24 posts)  Bio
Date Reply #2 on Wed 17 Dec 2014 05:11 AM (UTC)

Amended on Wed 17 Dec 2014 05:13 AM (UTC) by Dragonlord

Message
That is what is happening, I thought it was supposed to wait 10 seconds before trying to remove the voil.. I am really new to this program I used to do zmud/cmud when i played before
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 17 Dec 2014 05:29 AM (UTC)
Message
Please post your exact alias.

What you have there seems to be a combination of scripting and MUD commands.

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.

- Nick Gammon

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

Posted by Dragonlord   (24 posts)  Bio
Date Reply #4 on Wed 17 Dec 2014 06:01 AM (UTC)
Message
Macro type: F1+Shift

open pouch
get viol pouch
wear viol
c 'enhanced strength'
DoAfter (10, "remove viol")
put voil pouch
close pouch
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #5 on Wed 17 Dec 2014 06:55 AM (UTC)
Message
Off the top of my head, do you have timers enabled? Is the DoAfter actually firing to remove the spellbook? Have you tried using incremental DoAfter steps to putting the spellbook in the bag and closing the bag? Pretty sure the rest of the trigger evaluates immediately when you drop a doafter in the middle of things like that.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 17 Dec 2014 04:28 PM (UTC)
Message
DoAfter is a script function.

You cannot mix script functions and things you want to send to the MUD like that.

- Nick Gammon

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

Posted by Dragonlord   (24 posts)  Bio
Date Reply #7 on Wed 17 Dec 2014 04:33 PM (UTC)
Message
okay I placed the main part of the script into an aliase named "ces"

<aliases>
<alias
match="ces"
enabled="y"
regexp="y"
send_to="10"
ignore_case="y"
sequence="100"
>
<send>open pouch
get viol pouch
wear viol
c 'enhanced strength'
DoAfter (10, "remove viol")
put voil pouch
close pouch</send>
</alias>
</aliases>
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #8 on Wed 17 Dec 2014 05:27 PM (UTC)
Message
More reliable approach would probably be to set a trigger against whatever your returned message from a successful enhanced strength cast is to handle the removal and storage of the spellbook. That would allow you to send the entire thing to script and set your delays on everything accordingly.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #9 on Wed 17 Dec 2014 06:07 PM (UTC)
Message
Quote:

Put voil pouch


Spelling!

You need to "send to script" and then send the MUD commands using the send function.

E.g.


Send "open pouch"

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


28,136 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.