Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
tejing
Wanderer


Joined: 21 Dec 2001
Posts: 59
Location: USA

PostPosted: Tue May 18, 2004 4:25 am   

auto travelto on the two towers
 
this script creates an alias "r" which you can follow with a bunch
of 2 letter versions of the city names (one word city names are the
first 2 letters, 2 word city names are the first letter of the first
word, and the first letter of the second) and it will go through all
those traveltos in a row. so: "r by br ri rh th" at the greyhavens
signpost will take you all the way to thranduils. you can even
follow it with commands like so: "r by br ri;.3en" and it will
travel to rivendell (from greyhavens or belegost) then when it gets
there, it will execute ".3en"

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
        }
      }
    }
  #until (@travelling=0) {#noop}
  }
#ALIAS getstops {
  #if (@travelling) {
    #if (%numitems( @TravelQueue) = 0) {
      #beep
      travelling = 0
      }
    #if (%numitems( @TravelQueue) >= 1) {
      #loop [%numitems( @TravelQueue)] {#echo @travn( %item( @TravelQueue, %i))}
      #echo %numitems( @TravelQueue) 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 = ""
  @travelling = 0
  }
#TRIGGER {^Travelto: no such destination from here.$} {
  TravelQueue = ""
  @travelling = 0
  }
#CLASS 0
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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