Multiline Alias

Posted by Malek on Wed 29 Nov 2006 09:20 PM — 9 posts, 29,398 views.

USA #0
I am having a slight problem getting this alias to work properly. I have part of it working and I keep removing the other part because it is not working properly
This is what works so far:

<aliases>
<alias
match="tar *"
group="pk"
send_to="12"
ignore_case="y"
keep_evaluating="y"
sequence="100"
>
<send>world.SetVariable("target", "%1")
world.Note("Target set to: %1" )</send>
</alias>
</aliases>

That works great, but here's my issue. I also have a variable set called (target).I have the target set to this variable after I type (tar blah). I am trying to make a multiline alias that will automaticlly set a mud level trigger from the variable. despite all my attempts so far I have had no such luck. Any suggestions?
Australia Forum Administrator #1
Do you mean a multiline trigger? Can you post what you have tried so far?
USA #2
Thats all I have that is still in there. I take the rest out when it doesn't work and I start all over again. I may be talking about a trigger but I have also not figured out how to trigger off a output. As the Target set to: (blah) above is sent to script and I have tried to trigger off it and can not get it to work either.. I am dumb...
Australia Forum Administrator #3
An alias responds to what you type. For example:


Match: ef
Send: eat food


That would send "eat food" when you type "ef" and hit <enter>.

A trigger responds to what is received from the MUD. For example:


Match: You are hungry.
Send: eat food


This would send "eat food" whenever "You are hungry." arrives from the MUD.

It still isn't clear to me what is the multi-line part of whatever you are trying to do. Maybe an example would help.
Amended on Thu 30 Nov 2006 04:44 AM by Nick Gammon
USA #4
the alias that follows is what I am trying to get my client to set a mud based trigger to hunt the name typed.

Alias:
<aliases>
<alias
match="tar *"
group="pk"
send_to="12"
ignore_case="y"
keep_evaluating="y"
sequence="100"
>
<send>world.SetVariable("target", "%1")
world.Note("Target set to: %1" )</send>
</alias>
</aliases>

I have a variable setup name target. which follows now
<variables>
<variable name="target">Annie</variable>
</variables>

What I am trying to do is make a trigger off the name from the variable mentioned, to set a mud lvl trigger in this syntax ( trigger Annie todo hunt annie ). So far I have had no luck in getting this to work.
could anyone help out?
Australia Forum Administrator #5
With "expand variables" checked, triggers can match on variables. eg.

Match: @target leaves the room
USA #6
Yes this I am aware of but I want the client to pull the name out of the @target variable and make a mud level trigger with the @target name in it.
Australia #7
You might something in what I use to hunt mobs in my mud;

1. To turn the auto hunt off if you get stuck or change your mind;

<aliases>
<alias
name="huntoff"
match="huntoff"
enabled="y"
group="hunt"
send_to="12"
sequence="100"
>
<send>EnableTrigger("hunttrigger",false)
Note ("Hunt is now OFF!")</send>

2. To turn it back on if you want to resume autohunt for the last mob hunted;

</alias>
<alias
match="hunton"
enabled="y"
send_to="12"
sequence="100"
>
<send>EnableTrigger ("hunttrigger", true)
Note ("hunt is now ON!")</send>

3. To set the target mob name, and start the hunt command;

</alias>
<alias
match="huntt *"
enabled="y"
group="hunt"
send_to="12"
sequence="100"
>
<send>EnableTrigger ("hunttrigger", true)
SetVariable ("target","%1")
Note ("Target is now %1")
Send ("hunt %1")</send>
</alias>
</aliases>

4. To read the mud reply from the hunt command and then go that direction (Note: you'd have to change the trigger to match your mud);

<triggers>
<trigger
expand_variables="y"
group="hunt"
match="The trail of * is confusing, but you're reasonable sure she headed *."
name="hunttrigger"
send_to="12"
sequence="90"
>
<send>Send ("%2")
Send ("hunt @target")</send>
</trigger>
</triggers>

5. To turn of autohunt when the mob is found;

<triggers>
<trigger
enabled="y"
match="A * is here!"
send_to="12"
sequence="100"
>
<send>EnableTrigger ("hunttrigger", false)</send>
</trigger>
</triggers>
<triggers>
<trigger
enabled="y"
match="The * is here!"
send_to="12"
sequence="100"
>
<send>EnableTrigger ("hunttrigger", false)</send>
</trigger>
</triggers>

(Note: these last two could be combined of course, but depends on how your mud refers to the mob name as an it,he,she,the etc, issues with grammar for personal pronouns, and definite/indefinite articles etc)

Hope this helps with ideas, these work well for me. I should tidy them up into a group and think about a plugin :)

Fletchling aka Cuddlepie
USA #8
Fletchling,
Thats pretty much what I was trying to accomplish.. Thanks for the input..