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


Joined: 20 Mar 2005
Posts: 4

PostPosted: Sun Mar 20, 2005 11:24 pm   

Trouble with variable
 
I'm trying to create a simple script that enables my map to move when I follow someone on the mud. What I have is a set of two triggers and for some reason it doesn't work.

#TRIGGER {You now follow %w.} {#VAR leader %1} {leader}
#TRIGGER {^@leader leaves %w.} {#MOVE %1} {leader}

Anyone know why this doesn't work or can give me a script that does work?
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sun Mar 20, 2005 11:50 pm   
 
You need parenthesis around the %w's. Also, brackets around the variable are good.

#TRIGGER {You now follow (%w).} {#VAR leader %1} {leader}
#TRIGGER {^{@leader} leaves (%w).} {#MOVE %1} {leader}
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
bajella2
Newbie


Joined: 20 Mar 2005
Posts: 4

PostPosted: Mon Mar 21, 2005 12:09 am   
 
Awesome now it works perfectly! Thanks!
Reply with quote
Spartacus
Wanderer


Joined: 23 Apr 2001
Posts: 53
Location: USA

PostPosted: Mon Mar 21, 2005 5:27 pm   
 
A quick recommendation: Most muds send a line that matches something like "You follow (%w) ({north|south|east|west}) to (*)" after they send the line that said the leader left. If there's any possibility of the leader going and you not going (your leg is broken, you're stuck, you're in combat, etc..) then you should use that second message as the trigger pattern for moving your map pointer.

Achaea is a lot like this, though I think you don't see that your leader left if you actually follow them. Here is the trigger that I use to make my maps follow me on Achaea:

Code:
#TRIGGER {you follow * ({@refDirections}) to (*)} {
  #move %1
  #if (%left( %roomname( ), %len( %2)) != %2) {#echo ~<color red~>~<bold~>MAP IS OUT OF SYNC~</bold~>~</color~>}
  }
#VAR refDirections {north|northeast|east|southeast|south|southwest|west|northwest|up|down|in|out} {north|northeast|east|southeast|south|southwest|west|northwest|up|down|in|out}


I don't restrict the pattern match on who I'm following for a couple reasons:
    sometimes Achaea gives titles plus names, which we all know messes things up.
    It's possible to get forced to follow someone in Achaea and I want my map in sync so that I can run away quickly.


There is a deficiency in this trigger that I will fix someday (or I'll post it here and let Vij or Dhark fix it for me): If the mud output spills onto the next line, it doesn't get captured and only the first bit of the room name is used for the match.
_________________
Spartacus
rm -rf .*
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