Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ballegator
Novice


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: 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.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
ballegator
Novice


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
ballegator
Novice


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: 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.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
ballegator
Novice


Joined: 19 Jun 2001
Posts: 30
Location: USA

PostPosted: Fri Aug 16, 2002 2:26 am   
 
I fixed it. Thanks to you both for helping me.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net