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
Jdawg
Newbie


Joined: 17 Jan 2002
Posts: 5
Location: Sweden

PostPosted: Mon Mar 25, 2002 1:23 am   

Script and trigger problems
 
Hi, I'm REALLY new to scripting, just started fiddling a bit today. I'm trying to make a simple script that makes me walk around autokilling stuff.
The first problem I faced was this:
after I've made the mud read the line, and I enter a room with for example 4 guards and start bashing them, I want to be able to #read 1 after the fourth guard has died. But since the guards all have the same description, if I make a trigger on "You killed the %1 guard.", it will make me walk away after killing the first one. How do I make the trigger execute after the fourth guard has died?

I'll probably run into more problems, I'll post them later :)
Thanks guys.
FYI, I'm using zmud 6.25 and playing Genesis LPmud.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Mar 25, 2002 2:08 am   
 
Create a variable for that room that tracks
how many guards are there when you enter
and decrements it after every death.

A la concept:

#VAR V_Guards 0

You enter the room:

#TRIGGER {A Guard is here.} {#ADD V_Guard 1}

You kill a guard:

#TRIGGER {A guard dies.} {#ADD V_Guard -1;#IF (@V_Guard == 0) {go to next toom} {kill guard}}

TonDiening
Lazily converting scripts to beta 6.26
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