|
DarkFang Newbie
Joined: 14 Sep 2012 Posts: 3
|
Posted: Fri Sep 14, 2012 7:59 am
Assist trigger |
I was trying to create an assist trigger, and searching the forums, I did find one that seemed like it would do what I needed. It mostly works, I can add different attack messages, and group members, but when it comes to the actual assist, all it does is make me hit myself. Any ideas?
<class name="AutoAssist" id="947">
<alias name="addatkmsg" id="948">
<value>#ADDITEM attackmsgs %-1</value>
</alias>
<alias name="delatkmsg" id="949">
<value>#DELITEM attackmsgs %-2</value>
</alias>
<alias name="addassist" id="950">
<value>#ADDITEM group %1</value>
</alias>
<alias name="delassist" id="951">
<value>#DELITEM group %1</value>
</alias>
<var name="group" type="StringList" id="952">
<value>Kiria</value>
<json>["Kiria"]</json>
</var>
<var name="attackmsgs" type="StringList" id="953">
<value>is killing</value>
<json>["is killing"]</json>
</var>
<trigger priority="9540" id="954">
<pattern>(%w) {@attackmsgs}</pattern>
<value>#IF (%ismember( %1, @group) > 0) {kill %1}</value>
</trigger>
<trigger priority="9550" id="955">
<pattern>{@attackmsgs} (%w)</pattern>
<value>#IF (%ismember( %1, @group) > 0) {kill %1}</value>
</trigger>
</class> |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Sep 14, 2012 12:38 pm |
We need more information about what exactly you want to happen, and what this code isn't doing. Include all relevant MUD output and commands, please.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Sep 14, 2012 1:35 pm |
Here is an explanation of what this code will do, with the variables you have entered.
If the mud sends any text that contains "Kiria is killing" or "is killing Kiria", it will cause you to execute the command 'kill Kiria'.
Is that what you expected to happen? |
|
|
|
DarkFang Newbie
Joined: 14 Sep 2012 Posts: 3
|
Posted: Fri Sep 14, 2012 3:05 pm |
This is what I currently have, and what I would like the new one to do
<trigger name="Kill" priority="9090" id="613">
<pattern>is killing (%w)</pattern>
<value>kill %1</value>
</trigger>
When the tank starts combat, he emotes and it looks like Kiria is killing mouse. I want it to initiate combat when it sees that. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Fri Sep 14, 2012 3:15 pm |
Try to make the trigger more precise (add the tanks name into the pattern) or do some error checking within the body of your code
#IF (%1=%lower(%1)) {//not a proper name, attack} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Sep 14, 2012 6:30 pm |
I'm afraid your explanation is still unclear. You say you "want to initiate combat", but you don't say who you want to attack, Kiria or mouse. I will assume that Kiria is the person you want to assist, and you want to attack the target that Kiria is killing.
One problem the code you included in your first post is that there are _two_ triggers, one looking for "Kiria is killing" and the other looking for "is killing Kiria". The second problem is that in both cases, you are executing "kill Kiria" instead of killing Kiria's target.
Replace the following code:
Code: |
<trigger priority="9540" id="954">
<pattern>(%w) {@attackmsgs}</pattern>
<value>#IF (%ismember( %1, @group) > 0) {kill %1}</value>
</trigger>
<trigger priority="9550" id="955">
<pattern>{@attackmsgs} (%w)</pattern>
<value>#IF (%ismember( %1, @group) > 0) {kill %1}</value>
</trigger>
|
with:
Code: |
<trigger priority="9540" id="954">
<pattern>{@group} {@attackmsgs} (%w)</pattern>
<value>kill %1</value>
</trigger>
|
|
|
|
|
DarkFang Newbie
Joined: 14 Sep 2012 Posts: 3
|
Posted: Fri Sep 14, 2012 6:51 pm |
That did it, it works perfectly. Thank you very much.
|
|
|
|
|
|