[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]  General
. . -> [Subject]  Need help with a macro/trigger/what ever...
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Need help with a macro/trigger/what ever...

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


Posted by FireFigtnCowby   (1 post)  [Biography] bio
Date Tue 17 Oct 2017 11:09 PM (UTC)
Message
Ok now I havnt played a mud/mush is a blue moon and just started back up on one using Mushclient using version 5.03.

I decided I wanted to make a simple macro to cast my buff spells on me... *headdesks*

Ok well after fighting with it for a bit then looking through forums posts and the faq I now have a massive headache and questioning my sanity..

So im turning to you all for some help. Maybe if I see what it looks like properly setup ill understand how it should be done in the future, instead of trying to figure it out from someone else's display where I dont seem to understand what there trying to do in the first place.

Ok what im trying to do is get a spellbook out of a pouch, hold it, cast the spells with a delay between them, this is what kicked my rear, and then put the spellbook back and rehold the one I had. Like this,

get white pouch
hold white
cast shield
cast armor
hold red
put white pouch

But ya... its been a mess. Appreciate any help you can give.
[Go to top] top

Posted by Marco   (36 posts)  [Biography] bio
Date Reply #1 on Wed 18 Oct 2017 09:21 AM (UTC)

Amended on Wed 18 Oct 2017 02:49 PM (UTC) by Marco

Message
=== EDIT ==== (in the original post there were several mistakes)

FireFigtnCowby said:

get white pouch
hold white
cast shield
cast armor
hold red
put white pouch


Is not difficult. I would like giving you an optimized version but i don't know how your MUD behaves.
In mine, insted of saying:
remove book
hold pouch
that works but you have to know which obj actually you hold and if (for any reason) it is different in respect of the one you put in the alias, you'll get errors or the alias won't work as expected, in Tempora Sanguinis the item worn are numbered.

So, if i were in you, i start Calling your first alias like 'rem' (or everything please you more)
^rem\s(.*)$
in the Alias box
Check the optional 'Regular Expression' on the right
In the Send box
Send ("remove %1")
SetVariable ("removed", "%1")

and SendTo Script in the box just below.

When you first will remove something, in the variable windows, you'll see appear your variable with the actual value.

Then you create your main alias, let's say something like 'wcast' (or everything pleased you more)
^wcast$
Check the optional 'Regular Expression' on the right.
in the send box you'll put
rem red-book 
get white pouch
hold white
cast 'shield'
cast 'armor'
remove white  -- remove here! if not variable change again!
hold @removed
put white pouch

Check the optional 'Regular Expression' on the right.
Check the optional 'Expand Variables' on the right.
Set SendTo Execute -- this because you need ' rem ' to be re-evaluated and fire as alias
Should work.
--- BUT ----

IF, instead, you want the alias take place and work regardless what you are holding (a red book or something else) then:
rem red-book  -- <- here you don't want to specify 

In this case the alias should be:
^wcast\s?(.*?)$
and the following code should be better written as a Script, so SendTo Script in the way that, if you don't specify the optional wildcard %1 it works like previously; otherwise it remove the %1 object.
Therefore the code will be:
if "%1" ~= nil then
  Execute ("rem %1")
else
  Execute ("rem red-book")
end -- if
Send ("get white pouch")
Send ("hold white")
Send ("cast 'shield'")
Send ("cast 'armor'")
Send ("remove white")
Send ("hold @removed")
Send ("put white pouch")

Only one question... are you sure that after ' Cast ' instructions there is no the target of the spell?

Let us know if there are issue and sorry for every mispelled word (even in the code)

In any case NICK Gammon covered this topic in a video

https://vimeo.com/80326272

take a look and enjoy
[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.


288 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]