[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]  Tips and tricks
. . -> [Subject]  multiple variables in a line
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

multiple variables in a line

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


Posted by Natasi   (79 posts)  [Biography] bio
Date Sun 25 Jul 2004 03:16 AM (UTC)
Message
How can I make an alias, or even a trigger, with more than one variable in the line. Such as,....

"shoot @target %1"

I had this set with the alias, "aa *" to "shoot badguy sw" and it would send it, but after the first variable (@target) it would end the line and send "sw" on the next line
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Sun 25 Jul 2004 03:54 AM (UTC)
Message
Sounds like your target variable is picking up a line return somewhere or maybe has a command stacking ( ie ; ) character tacked onto the end of it.

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 Natasi   (79 posts)  [Biography] bio
Date Reply #2 on Sun 25 Jul 2004 12:18 PM (UTC)
Message
I don't use command stacking and I've tried it before, I'm thinking I am missing to click one of the boxes or something...I have expand variables clicked.....
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Sun 25 Jul 2004 06:32 PM (UTC)
Message
How are you setting your variable? you might have a carriage return afterwards in the variable, that seems like what it is. copy/paste your trigger/alias. (both to send the variable, and set the variable)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Reply #4 on Sun 25 Jul 2004 11:05 PM (UTC)
Message
<aliases>
<alias
match="sh *"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>shoot @target %1</send>
</alias>
</aliases>

also, ones set up like this don't work either....


<aliases>
<alias
match="nca"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>elicit changeheart @target ally
</send>
</alias>
</aliases>
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 25 Jul 2004 11:08 PM (UTC)
Message
Your variable is the problem, not the alias. Check that you don't have a carriage-return in the variable value. That is, don't have:

variable: target
value: badguy(cr)

If you put the cursor into the "edit variable" window at the end, it should be directly after "badguy" not at the start of the next line.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Sun 25 Jul 2004 11:10 PM (UTC)
Message
It should look like this, if you copy the variable:


<variables>
  <variable name="target">badguy</variable>
</variables>


Not like this:


<variables>
  <variable name="target">badguy
</variable>
</variables>


Notice the difference, of the extra line?


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Reply #7 on Sun 25 Jul 2004 11:59 PM (UTC)
Message
ohhh, I feel dumb, that fixed it, thanks
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Reply #8 on Mon 26 Jul 2004 05:56 AM (UTC)
Message
Thanks for the help everyone, but I got one more question....I need to have a line gagged, but it's random each time...such as,

You stare intently at Talinon, opening his mind to the unspeakable visions that spew from the bowels of hell.
Your head spins as your mind is drowned in chaos and confusion.



The second line **Your head spins as your mind is drowned in chaos and confusion.** needs to be gagged somehow, but it's always different...is there a way to set a trigegr off
"unspeakable visions that spew from the bowels of hell." to gag the next line to follow?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #9 on Mon 26 Jul 2004 06:13 AM (UTC)
Message
You stare intently at *, opening his mind to the unspeakable visions that spew from the bowels of hell.

Make it enable another trigger which then disables itself (upon firing) (or add a temporary trigger, either way, itll be send to script) and that trigger matches: ^.*$ (thats a regexp) and have it omit from output.

That will match the next line after your first trigger. (Itll match ANY one line, but since were only allowing it to be turned on after the first one, and then turning it off right away, Itll serve its purpose)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Reply #10 on Tue 27 Jul 2004 12:15 AM (UTC)
Message
That sounds good, but I am so lost in how to do that...
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #11 on Tue 27 Jul 2004 03:33 AM (UTC)

Amended on Tue 27 Jul 2004 03:34 AM (UTC) by Flannel

Message
Copy between <triggers> and </triggers> then click "paste" in the trigger dialog.

<triggers>
  <trigger
   ignore_case="y"
   match="^(.*)$"
   name="RandomLineTrigger"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>enabletrigger &quot;RandomLineTrigger&quot;, 0</send>
  </trigger>
  <trigger
   enabled="y"
   ignore_case="y"
   keep_evaluating="y"
   match="^you stare intently at (.*?)\, opening his mind to the unspeakable visions that spew from the bowels of hell\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>enabletrigger &quot;RandomLineTrigger&quot;, 1</send>
  </trigger>
</triggers>

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #12 on Tue 27 Jul 2004 04:42 PM (UTC)
Message
If you want to not only gag but also avoid matching any triggers on the second line, then you might want to set the sequence number for the RandomLineTrigger trigger to 1, instead of 100. Otherwise, there's a very good chance of your affliction triggers still matching on the second line.
[Go to top] top

Posted by Natasi   (79 posts)  [Biography] bio
Date Reply #13 on Thu 29 Jul 2004 03:32 AM (UTC)
Message
hmmm, here's another one I'm trying to figure out...I'm trying to set a trigger that will enable another trigger to fire once. Like, I'd want this trigger

"Sticky strands entrap * and inhibit their movement"

to activate this trigger for one fire (fire once?)

"You have recovered balance on all limbs"

this second trigger will be sending a command...soooo, if anyone understood what I just said, thanks for any help
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Thu 29 Jul 2004 06:52 AM (UTC)

Amended on Thu 29 Jul 2004 06:53 AM (UTC) by Nick Gammon

Message
You will have two triggers, give them names (labels) like "trigger_a" and "trigger_b". You can probably think of more descriptive ones.



First trigger, labelled trigger_a:

Match: Sticky strands entrap * and inhibit their movement

Send:

world.Send "do something"
world.EnableTrigger "trigger_b", 1

Send to: script




Second trigger, labelled trigger_b:

Match: You have recovered balance on all limbs

Send:

world.Send "do something else"
world.EnableTrigger "trigger_b", 0

Send to: script




The first trigger enables the second, the second disables itself when it fires.

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


8,974 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]