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
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Wed Oct 09, 2002 5:19 am   

Autoranking script
 
Ok so, I'm trying to work out this autoranking script and I'm using a slow walk to move around the area and attack things, the problem is I only want to attack when 1 of the creatures are in the room because they assist.
I'm getting stumped because I have a trigger
#TR X is here
#Add enemy 1
#If @enemy<2 {kill x} {#Step;#var enemy 0}

and when 2 of them are in the room it obviously fires twice and things get all messed up, does someone know a differant way to go about doing this?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Wed Oct 09, 2002 6:44 am   
 
Depending on how your MUD uses and abuses blank lines, you could try something like this:

#TR {X is here.} {#ADD enemy 1; #IF (@enemy = 1) {#TEMP {^$} {#IF (@enemy <2) {kill x} {#STEP; #VAR enemy 0}}}}

The first time you encounter X, a temporary trigger is created which will fire on the first blank line. This was not tested.

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Wed Oct 09, 2002 7:29 pm   
 
won't that just have the same problem of firing twice and creating 2 temporary triggers?
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Wed Oct 09, 2002 8:36 pm   
 
No, that if check will only fire when enemy is equal to 1. If the trigger were to fire twice, then the enemy var would be set to 2 and the 2nd part of the trigger would not be fired.

Iljhar
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