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
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Wed Mar 31, 2004 6:50 pm   

You killed %1. - trigger double.
 
Hmm. Ok. i could use some help here because this is annoying me ;)

I have a trigger:
You attack %1.
#VA enemy %1

And You killed %1

#IF ("orcish horde" = %1) {
get gold from corpse
get bow from corpse
get vest from corpse into pack
get vest from corpse into cloak
get all arrow from corpse into pack
} {#ABORT}
#IF (@enemy = %1) {
get gold from corpse
get all from corpse into pack
get all from corpse into cloak
get all from corpse into baldric 2
get all from corpse into baldric
get all from corpse
} {#ABORT}

Ok, the problem is i it's double sending the trigger. It is not working. Where is the fault?
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Mar 31, 2004 7:33 pm   
 
For a start, @enemy is always going to equal %1, Since you set #var enemy %1 anyway. I assume that when it goes off twice, %1 equals "Orcish Horde". Thus making both #IF statements true.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Mar 31, 2004 7:59 pm   
 
So, you don't want to loot anything you kill unless it is 'orcish horde' or the last thing you attacked? Okay, this will do it.

#TR {You attack (*)} {#VAR enemy {%1}}
#TR {You killed ({@enemy|orcish horde})} {
get gold from corpse
#IF ("%1" = "orcish horde") {
get bow from corpse
get vest from corpse into pack
get vest from corpse into cloak
get all arrow from corpse into pack
} {
get all from corpse into pack
get all from corpse into cloak
get all from corpse into baldric 2
get all from corpse into baldric
get all from corpse
}}

NOTE: Of course, it won't do anything if you kill 'the orcish horde' unless you just attacked it.
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Wed Mar 31, 2004 8:03 pm   
 
why bother with abort and more if? When you can just go

And You killed %1

#IF ("orcish horde" = %1) {
get gold from corpse
get bow from corpse
get vest from corpse into pack
get vest from corpse into cloak
get all arrow from corpse into pack
}
{
get gold from corpse
get all from corpse into pack
get all from corpse into cloak
get all from corpse into baldric 2
get all from corpse into baldric
get all from corpse
}

This way you use the if-then-else approach and will do the "orcish horde" part when it gets the orcish horde msg and anything else you kill will execute the "else" part.
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