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


Joined: 26 Oct 2006
Posts: 2

PostPosted: Thu Oct 26, 2006 11:16 am   

Messed up trigger..help appreciated
 
Hi, i have a few triggers that when it reads a mob is x rooms to a direction, my character will move x rooms towards the direction.

eg.
i will do a 'scan'

Code:
A turtle is 3 rooms to the south.


My character will automatically move 3 rooms south and initiates combat with it(another trigger)

But there will be times when i scan i will receive

Quote:
A turtle is 4 rooms to the south
A turtle is 2 rooms southeast


My character will then move 4 rooms to the south and 2 rooms southeast and end up in a room with no turtles to kill.

So how do i set it that my triggers will only capture the first line and ignore the other turtles down the list when i scan?

TIA
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Thu Oct 26, 2006 11:30 am   
 
Replace the trigger action with something like

Code:
#if (@scan = 0) {
  scan = 1
  move 3 south
  #alarm scanWait {+5} {scan = 0}
  }


You need to create the scan variable and give it initial value 0.

What then happens is if you see something then it'll move and set scan to 1, then wait 5 seconds and put scan back to 0. If during that 5 seconds you scan anything else then it'll not move you anywhere.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Haru
Newbie


Joined: 26 Oct 2006
Posts: 2

PostPosted: Thu Oct 26, 2006 11:54 am   
 
works great, thanks!
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