[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  setting up a macro
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

setting up a macro

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


Posted by Dragonlord   (24 posts)  [Biography] 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
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] 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
[Go to top] top

Posted by Dragonlord   (24 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] 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
[Go to top] top

Posted by Dragonlord   (24 posts)  [Biography] 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
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] 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
[Go to top] top

Posted by Dragonlord   (24 posts)  [Biography] 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>
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] 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
[Go to top] 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.


4,108 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]