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 ➜ Variables in a trigger

Variables in a trigger

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


Posted by Melanosol   (8 posts)  Bio
Date Wed 24 Apr 2013 12:09 PM (UTC)
Message
Hello there.

I'm trying to set up a series of aliases and triggers for weapon swapping/disarms, so that I don't have a tonne of needless spam going off. What I've reduced it to is; When I change to a different weapon set, it records the mainhand to variable MainHand, and offhand/shield to OffHand. Mostly it's working out, allowing me to specifically remove and wear what I need rather than having it spam to remove 5 items at once before it wears new things. Where I'm struggling is with having it not remove and re-wear my shield. An example trigger as follows;


<aliases>
  <alias
   match="^iced$"
   enabled="y"
   expand_variables="y"
   group="Frelia"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>OffHand = GetVariable("OffHand")

if OffHand == 'arcanium shield' then
  Send ("wear 'spirit whip'")
  SetVariable ("MainHand", "'spirit whip'")
else
  Send ("remove @OffHand")
  Send ("wear 'arcanium shield'")
  Send ("wear 'spirit whip'")
  SetVariable ("MainHand", "'spirit whip'")
  SetVariable ("OffHand", "'arcanium shield'")
end</send>
  </alias>
</aliases>


What I'm hoping for it to do is to check the OffHand variable, notice if it's my shield or not and then reduce the spam, because I'd rather it not remove and wear my shield again each time (potentially leaving me vulnerable if my timing sucks). I'm using apostrophes around the names as the MUD allows use of them to recognise the entire string, otherwise a space will have it recognise it as a secondary command on the line. Since I sucked at explaining that, an example would be:

<get 'potion of sanctuary' 'robe of pockets'> would have it look for 'potion of sanctuary' within a 'robe of pockets', without them it would tunicate to <get potion of> and simply look for item 'potion' inside 'of'. By using this, I can thus differentiate between multiple shields, whips, swords, whatever.

I appreciate any assistance anyone can offer!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 24 Apr 2013 10:36 PM (UTC)
Message
I can't see anything obviously wrong. Is it not working? If not, in what way?

- Nick Gammon

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

Posted by Melanosol   (8 posts)  Bio
Date Reply #2 on Wed 24 Apr 2013 11:33 PM (UTC)
Message
It was never meeting the condition to do the first set. Worked it out just now, the apostrophes around it were merely functioning as the quotation marks would have, so it was trying to detect arcanium shield instead of 'arcanium shield'.

Changing it to the following fixed it;

if OffHand == "'arcanium shield'" then
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.


12,790 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.