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
tejing
Wanderer


Joined: 21 Dec 2001
Posts: 59
Location: USA

PostPosted: Sat May 15, 2004 3:41 am   

travelling alias
 
I have the following class created (i editted it a bit, took out some shortcut aliases), and it works great, but i wish i could cause a script that used this alias to wait until it was done to continue the script as in:

.w3ne;r br ri rh;.es

should wait until i get to my destination(rhosgobel) before continuing on and doing ".es"

anybody know how i could do this? if not that, at least some way to make an argument to the alias that executes some more code after the traveling is completed?

this is the code:

Code:

#CLASS {travelto} {enable}
#ALIAS r {
  #IF (@TravelQueue!="") {getstops} {
    travelling = "1"
    #LOOP %numitems( %replace( "%-1", " ", "|")) {
      #if (@trav( %item( %replace( "%-1", " ", "|") , %i)) = "No such destination!") {
        travelling = 0
        #echo %item( %replace( "%-1", " ", "|") , %i): No such destination!
        }
      }
    #IF (@travelling!="1") {#echo Travelling aborted!} {
      #IF (%numparams) {
        TravelQueue=%replace( "%-1", " ", "|")
        #exec @travc( %item( @TravelQueue, 1))
        #move @travc( %item( @TravelQueue, 1))
        getstops
        #DELNITEM TravelQueue 1
        }
      }
    }
  }
#ALIAS getstops {
  #if (@travelling) {
    #if (%numitems( @TravelQueue) = 0) {
      #ECHO Final destination achieved for %char. Thank you travelling the friendly AliasExpress
      #beep
      travelling = 0
      }
    #if (%numitems( @TravelQueue) = 1) {#echo Approaching final destination for %char: @travn( %item( @TravelQueue, %numitems( @TravelQueue)))}
    #if (%numitems( @TravelQueue) > 1) {
      #echo Travelling for %char, Final destination: @travn( %item( @TravelQueue, %numitems( @travelQueue)))
      #echo with stops at:
      #loop [%numitems( @TravelQueue) - 1] {#echo @travn( %item( @TravelQueue, %i))}
      #echo %numitems( @TravelQueue) hops remaining.
      }
    }
  }
#VAR trav {%if( (%1 != "ri") AND (%1 != "br") AND (%1 != "by") AND (%1 != "gh") AND (%1 != "be") AND (%1 != "os") AND (%1 != "mt") AND (%1 != "rh") AND (%1 != "th") AND (%1 != "ad") AND (%1 != "lo") AND (%1 != "da") AND (%1 != "ed") AND (%1 != "es") AND (%1 != "er") AND (%1 != "dl") AND (%1 != "li"), "No such destination!", "")}
#VAR travc {%if( %1 = "ri", "travelto rivendell")%if( %1 = "br", "travelto bree")%if( %1 = "by", "travelto bywater")%if( %1 = "gh", "travelto greyhavens")%if( %1 = "be", "travelto belegost")%if( %1 = "os", "travelto osgiliath")%if( %1 = "mt", "travelto minastirith")%if( %1 = "rh", "travelto rhosgobel")%if( %1 = "th", "travelto thranduils")%if( %1 = "ad", "travelto adornas")%if( %1 = "lo", "travelto lothlorien")%if( %1 = "da", "travelto dolamroth")%if( %1 = "ed", "travelto edoras")%if( %1 = "es", "travelto esgaroth")%if( %1 = "er", "travelto erebor")%if( %1 = "dl", "travelto dale")%if( %1 = "li", "travelto linhir")}
#VAR travn {%if( %1 = "ri", "Rivendell")%if( %1 = "br", "Bree")%if( %1 = "by", "Bywater")%if( %1 = "gh", "Grey Havens")%if( %1 = "be", "Belegost")%if( %1 = "os", "Osgiliath")%if( %1 = "mt", "Minas Tirith")%if( %1 = "rh", "Rhosgobel")%if( %1 = "th", "Thranduils")%if( %1 = "ad", "Adornas")%if( %1 = "lo", "Lothlorien")%if( %1 = "da", "Dol Amroth")%if( %1 = "ed", "Edoras")%if( %1 = "es", "Esgaroth")%if( %1 = "er", "Erebor")%if( %1 = "dl", "Dale")%if( %1 = "li", "Linhir")}
#VAR travelling {0}
#VAR TravelQueue {}
#TRIGGER {{Travelto: Destination reached!|You're already there!}$} {
  getstops
  #IF (@TravelQueue!="") {
    #exec @travc( %item( @TravelQueue, 1))
    #move @travc( %item( @TravelQueue, 1))
    #DELNITEM TravelQueue 1
    }
  }
#TRIGGER {Travelto can only be used at a signpost.} {@travelqueue = ""}
#TRIGGER {^Travelto: no such destination from here.$} {TravelQueue = ""}
#CLASS 0
Reply with quote
tejing
Wanderer


Joined: 21 Dec 2001
Posts: 59
Location: USA

PostPosted: Sat May 15, 2004 8:38 pm   
 
I got it, all i had to do was add this to the bottom of the "r" alias
Code:
#until (@travelling=0) {#noop}
Reply with quote
Oracle
Apprentice


Joined: 29 May 2002
Posts: 121

PostPosted: Sat May 15, 2004 9:49 pm   
 
How does the script handle roundtime?
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