  | 
	
	
	
		parrotslave Wanderer
  
  Joined: 01 Jul 2002 Posts: 81 Location: USA
  | 
		
		  
			
			   Posted: Wed Jul 07, 2004 3:31 pm   
  trigger help please   | 
			 
			
				How do I create a trigger to move me to the next room if there are no mobs in the room I just entered?
 
 
Is there some sort of command to execute a script upon entering a room?  I couldn't find anything in the help files.
 
 
I tried using the timer to move that would be deactivated if there was a mob in the room, but if a lag burst hit things got messed up.
 
 
The room description when a mob is in the room looks something like this:
 
 
You are wandering on a foggy moor.
 
There are two obvious exits: north, south
 
There is a dog standing here.
 
 
The room description when there is no mob in the room looks like this:
 
 
You are wandering on a foggy moor.
 
There are two obvious exits: north, south
 
 
Thanks! | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		LightBulb MASTER
 
  Joined: 28 Nov 2000 Posts: 4817 Location: USA
  | 
		
		  
			
			   Posted: Wed Jul 07, 2004 4:24 pm      | 
			 
			
				1. Use the #TRIGGER command, the Settings Editor, or the Command Wizard. Think about the information you receive when entering or looking at a room, and how you tell whether or not there is a mob present, then make triggers to duplicate your thinking.
 
 
In this case, I'm assuming you know there's not a mob when you get a blank line before you see one.
 
 
#TR {There are * obvious exit} {#VAR nomob 1}
 
#COND {^$} {#IF (@nomob) {move to the next room}}
 
#TR {standing here.$} {#VAR nomob 0}
 
 
2. There are several different ways of executing scripts when entering a room. Most of them are pretty obvious. Use the onroomenter alias. Make aliases for your movement commands. Use a trigger based on the text you receive when entering a room, such as the Exits line. Modify your movement macros to include the script. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		parrotslave Wanderer
  
  Joined: 01 Jul 2002 Posts: 81 Location: USA
  | 
		
		  
			
			   Posted: Wed Jul 07, 2004 6:15 pm      | 
			 
			
				Thanks!
 
 
That helped a lot. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		| 
		
		 | 
	
	
		 |