|
ballegator Novice
Joined: 19 Jun 2001 Posts: 30 Location: USA
|
Posted: Thu Aug 15, 2002 11:45 pm
Help w/Trigger |
This is the latter part of an output from the mud I play on:
The only obvious exit with a door is: north (door open).
Two bulldogs
Then, if the monsters are aggresive and attack, it shows:
Bulldog attacks you!
Bulldog attacks you!
I want to make it so that if it shows they are attacking me, I rush each one (rush being a command like rush bulldog). If I did it manually, I would type it in like this:
rush bulldog
rush bulldog 2
I've tried numerous things but obviously i'm lame when it comes to this. Thanks in advance. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Aug 16, 2002 12:23 am |
#TRIGGER {^(%w) attacks you!$} {#IF %null(@{V_RushList_%1}) {#VAR V_RushList_%1 1} {#ADD V_RushList_%1 1);rush %1 @{V_RushList_%1};#EXEC %concat("#ALARM +2 {#VAR V_RushList_",%1," 0}")}
The alarm could unvar it as well.
Ton Diening |
|
|
|
ballegator Novice
Joined: 19 Jun 2001 Posts: 30 Location: USA
|
Posted: Fri Aug 16, 2002 1:51 am |
I put it in and this was the response I got on the first try:
Rat attacks you!
{#IF 1 {#VAR V_RushList_Rat 1} {#ADD V_RushList_Rat 1);rush Rat ;#EXEC #ALARM +2 {#VAR V_RushList_Rat 0}}
Rat attacks you!
{#IF 1 {#VAR V_RushList_Rat 1} {#ADD V_RushList_Rat 1);rush Rat ;#EXEC #ALARM +2 {#VAR V_RushList_Rat 0}}
I looked at the trigger and this is what was in the error area:
{#IF %null(@{V_RushList_%1}) {#VAR V_RushList_%1 1} {#ADD V_RushList_%1 1);rush %1 @{V_RushList_%1};#EXEC %concat("#ALARM +2 {#VAR V_RushList_",%1," 0}")}
^ syntax error |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Aug 16, 2002 2:04 am |
This is very easy to troubleshoot. Compare the {'s to the }'s and the ('s to the )'s. You will undoubtedly find they don't match. Fix them so they do.
#TRIGGER {^(%w) attacks you!$} {#IF %null(@{V_RushList_%1}) {#VAR V_RushList_%1 1} {#ADD V_RushList_%1 1);rush %1 @{V_RushList_%1};#EXEC %concat("#ALARM +2 {#VAR V_RushList_",%1," 0}")}}
LightBulb
Senior Member |
|
|
|
ballegator Novice
Joined: 19 Jun 2001 Posts: 30 Location: USA
|
Posted: Fri Aug 16, 2002 2:23 am |
Thanks, Lightbulb. It worked with one exception... I had 4 bulldogs attack me and it only rushed 3. And i'm not knowledgable enough to figure out how to fix it in this trigger.
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Aug 16, 2002 2:24 am |
Oops sorry, missed those typos. Thanks Lightbulb for catching them.
Increase the alarm delay for the 4 dogs.
#ALARM +5 maybe.
Ton Diening |
|
|
|
ballegator Novice
Joined: 19 Jun 2001 Posts: 30 Location: USA
|
Posted: Fri Aug 16, 2002 2:26 am |
I fixed it. Thanks to you both for helping me.
|
|
|
|
|
|