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
kyros
Novice


Joined: 26 Jan 2005
Posts: 33

PostPosted: Wed Jul 18, 2007 2:16 pm   

I am lost, I need help with the script.
 
I am working on a sextant script.. I recently scripted it to know that the world was round... But when you get close to the edges of the world, it messes up because of the math. Can someone help please?

Code:
#CLASS {Scripts}
#CLASS 0
#CLASS {Scripts|SexLoc}
#ALIAS sexloc {
  #T+ {Striggers}
  #T+ {Salias}
  #T+ {Svariables}
  #if (@%1=%null) {
    #say " "
    #say %ansi( red, high)To set a location, type %ansi( white, high)sexloc destination%ansi( red, high) where as %ansi( white, high)destination%ansi( red, high) is the name of the location from the list as follows.
    #say @locations
    } {
    #var location "@%1"
    #var sex "%lower(@%1)"
    look sextant
    }
  #alarm +1 {#t- {Striggers}}
  #alarm +1 {#t- {Salias}}
  }
#CLASS 0
#CLASS {Scripts|SexLoc|Svariables}
#VAR sigil {%ansi( blue, high)Your destination is currently %ansi( green, high)Sigil%ansi( blue, high), located at %ansi( defcol)435%ansi( blue, high),%ansi( defcol) 1226%ansi( blue, high).}
#VAR rune {%ansi( blue, high)Your destination is currently %ansi( green, high)Rune%ansi( blue, high), located at %ansi( defcol)695%ansi( blue, high),%ansi( defcol) 770%ansi( blue, high).}
#VAR arcane {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Arcane Archipelago%ansi( blue, high), located at %ansi( defcol)926%ansi( blue, high),%ansi( defcol) 816%ansi( blue, high).}
#VAR vospire {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Vospire%ansi( blue, high), located at %ansi( defcol)312%ansi( blue, high),%ansi( defcol) 1177%ansi( blue, high).}
#VAR atlantis {%ansi( blue, high)Your destination is currently %ansi( cyan, high)the Lost City of Atlantis%ansi( blue, high), located at %ansi( defcol)1988%ansi( blue, high),%ansi( defcol) 1305%ansi( blue, high).}
#VAR decara {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Decara%ansi( blue, high), located at %ansi( defcol)1579%ansi( blue, high),%ansi( defcol) 486%ansi( blue, high).}
#VAR vir {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Vir%ansi( blue, high), located at %ansi( defcol)1439%ansi( blue, high),%ansi( defcol) 1052%ansi( blue, high).}
#VAR seahag {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Isle of the Seahag%ansi( blue, high), located at %ansi( defcol)1113%ansi( blue, high),%ansi( defcol) 873%ansi( blue, high).}
#VAR hotel {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Hotel Hello%ansi( blue, high), located at %ansi( defcol)1228%ansi( blue, high),%ansi( defcol) 768%ansi( blue, high).}
#VAR tellerium {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Tellerium%ansi( blue, high), located at %ansi( defcol)1724%ansi( blue, high),%ansi( defcol) 685%ansi( blue, high).}
#VAR templeton {%ansi( blue, high)Your destination is currently %ansi( green, high)Templeton%ansi( blue, high), located at %ansi( defcol)1619%ansi( blue, high),%ansi( defcol) 540%ansi( blue, high).}
#VAR nr {%ansi( blue, high)Your destination is currently %ansi( green, high)New Rigel%ansi( blue, high), located at %ansi( defcol)801%ansi( blue, high),%ansi( defcol) 545%ansi( blue, high).}
#VAR pg {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Proving Grounds Reef Entrance%ansi( blue, high), located at %ansi( defcol)1268%ansi( blue, high),%ansi( defcol) 748%ansi( blue, high).}
#VAR pc {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Pirate's Cove%ansi( blue, high), located at %ansi( defcol)1191%ansi( blue, high),%ansi( defcol) 968%ansi( blue, high).}
#VAR keep {%ansi( blue, high)Your destination is currently %ansi( red, high)Maldra's Keep%ansi( blue, high), located at %ansi( defcol)1304%ansi( blue, high),%ansi( defcol) 1092%ansi( blue, high).}
#VAR toa {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Tower of Art%ansi( blue, high), located at %ansi( defcol)1271%ansi( blue, high),%ansi( defcol) 211%ansi( blue, high).}
#VAR nk {%ansi( blue, high)Your destination is currently %ansi( red, high)New Kolvir%ansi( blue, high), located at %ansi( defcol)571%ansi( blue, high),%ansi( defcol) 984%ansi( blue, high).}
#VAR bazaar {%ansi( blue, high)Your destination is currently %ansi( cyan, high)the Bazaar%ansi( blue, high), located at %ansi( defcol)818%ansi( blue, high),%ansi( defcol) 386%ansi( blue, high).}
#VAR dio {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Diocletian%ansi( blue, high), located at %ansi( defcol)553%ansi( blue, high),%ansi( defcol) 1360%ansi( blue, high).}
#VAR low {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Lowangen%ansi( blue, high), located at %ansi( defcol)1159%ansi( blue, high),%ansi( defcol) 421%ansi( blue, high).}
#VAR ov {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Ogre Village%ansi( blue, high), located at %ansi( defcol)1885%ansi( blue, high),%ansi( defcol) 459%ansi( blue, high).}
#VAR cavhfail {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Cavhfail%ansi( blue, high), located at %ansi( defcol)355%ansi( blue, high),%ansi( defcol) 284%ansi( blue, high).}
#VAR ctf {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Capture The Flag Arena%ansi( blue, high), located at %ansi( defcol)993%ansi( blue, high),%ansi( defcol) 893%ansi( blue, high).}
#VAR deceit {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Dungeon Deceit%ansi( blue, high), located at %ansi( defcol)1254%ansi( blue, high),%ansi( defcol) 1071%ansi( blue, high).}
#VAR thorne {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Desert Thorne%ansi( blue, high), located at %ansi( defcol)1031%ansi( blue, high),%ansi( defcol) 316%ansi( blue, high).}
#VAR eanoss {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Eanoss Azelmar%ansi( blue, high), located at %ansi( defcol)130%ansi( blue, high),%ansi( defcol) 65%ansi( blue, high).}
#VAR fgk {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Frost Giant's Keep%ansi( blue, high), located at %ansi( defcol)1689%ansi( blue, high),%ansi( defcol) 389%ansi( blue, high).}
#VAR hellbentfp {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Hellbent Faerie Plane%ansi( blue, high), located at %ansi( defcol)255%ansi( blue, high),%ansi( defcol) 163%ansi( blue, high).}
#VAR hellbentuw {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Hellbent Underworld%ansi( blue, high), located at %ansi( defcol)1341%ansi( blue, high),%ansi( defcol) 364%ansi( blue, high).}
#VAR kessarian {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Kessarian's Dungeon%ansi( blue, high), located at %ansi( defcol)1590%ansi( blue, high),%ansi( defcol) 985%ansi( blue, high).}
#VAR lonelydragon {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Lonely Dragon Inn%ansi( blue, high), located at %ansi( defcol)600%ansi( blue, high),%ansi( defcol) 700%ansi( blue, high).}
#VAR maelstrom {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Maelstrom%ansi( blue, high), located at %ansi( defcol)1540%ansi( blue, high),%ansi( defcol) 742%ansi( blue, high).}
#VAR magencia {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Magencia%ansi( blue, high), located at %ansi( defcol)865%ansi( blue, high),%ansi( defcol) 834%ansi( blue, high).}
#VAR mandrake {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Mandrake Woods%ansi( blue, high), located at %ansi( defcol)654%ansi( blue, high),%ansi( defcol) 365%ansi( blue, high).}
#VAR rahdiyr {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Rahdiyr%ansi( blue, high), located at %ansi( defcol)102%ansi( blue, high),%ansi( defcol) 69%ansi( blue, high).}
#VAR relic {%ansi( blue, high)Your destination is currently %ansi( yellow, high)Relic Binding Gate%ansi( blue, high), located at %ansi( defcol)1804%ansi( blue, high),%ansi( defcol) 924%ansi( blue, high).}
#VAR runeforest {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Rune Forest%ansi( blue, high), located at %ansi( defcol)701%ansi( blue, high),%ansi( defcol) 680%ansi( blue, high).}
#VAR seelie {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Seelie Castle%ansi( blue, high), located at %ansi( defcol)43%ansi( blue, high),%ansi( defcol) 55%ansi( blue, high).}
#VAR boars {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Tavern of the Boars%ansi( blue, high), located at %ansi( defcol)797%ansi( blue, high),%ansi( defcol) 445%ansi( blue, high).}
#VAR aroxa {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Tower of Aroxa%ansi( blue, high), located at %ansi( defcol)1759%ansi( blue, high),%ansi( defcol) 730%ansi( blue, high).}
#VAR retreat {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Traveller's Retreat%ansi( blue, high), located at %ansi( defcol)776%ansi( blue, high),%ansi( defcol) 651%ansi( blue, high).}
#VAR vesuvius {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Vesuvius%ansi( blue, high), located at %ansi( defcol)295%ansi( blue, high),%ansi( defcol) 1160%ansi( blue, high).}
#VAR twinmoons {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Twin Moons Inn%ansi( blue, high), located at %ansi( defcol)1007%ansi( blue, high),%ansi( defcol) 306%ansi( blue, high).}
#VAR unseelie {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Unseelie Castle%ansi( blue, high), located at %ansi( defcol)438%ansi( blue, high),%ansi( defcol) 299%ansi( blue, high).}
#VAR wroth {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Dungeon Wroth%ansi( blue, high), located at %ansi( defcol)736%ansi( blue, high),%ansi( defcol) 391%ansi( blue, high).}
#VAR xaventry {%ansi( blue, high)Your destination is currently %ansi( white, high)Xaventry%ansi( blue, high), located at %ansi( defcol)602%ansi( blue, high),%ansi( defcol) 454%ansi( blue, high).}
#VAR hellbent {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Hellbent Mountain%ansi( blue, high), located at %ansi( defcol)1342%ansi( blue, high),%ansi( defcol) 365%ansi( blue, high).}
#VAR colyon {%ansi( blue, high)Your destination is currently %ansi( cyan, high)The Village of Colyon%ansi( blue, high), located at %ansi( defcol)1383%ansi( blue, high),%ansi( defcol) 1029%ansi( blue, high).}
#VAR jalur {%ansi( blue, high)Your destination is currently %ansi( cyan, high)Jalur Lumber Camp%ansi( blue, high), located at %ansi( defcol)1814%ansi( blue, high),%ansi( defcol) 255%ansi( blue, high).}
#VAR mulak {%ansi( blue, high)Your destination is currently %ansi( cyan, high)The Village of Mulakanathos%ansi( blue, high), located at %ansi( defcol)1554%ansi( blue, high),%ansi( defcol) 1234%ansi( blue, high).}
#VAR winton {%ansi( blue, high)Your destination is currently %ansi( cyan, high)The Hamlet of Winton%ansi( blue, high), located at %ansi( defcol)1582%ansi( blue, high),%ansi( defcol) 392%ansi( blue, high).}
#VAR locations {%ansi( blue, high)Valid destinations are: %ansi( defcol)Arcane%ansi( blue, high), %ansi( defcol)Aroxa%ansi( blue, high), %ansi( defcol)Atlantis%ansi( blue, high), %ansi( defcol)Bazaar%ansi( blue, high), %ansi( defcol)Boars%ansi( blue, high), %ansi( defcol)Cavhfail%ansi( blue, high), %ansi( defcol)Colyon%ansi( blue, high), %ansi( defcol)CTF%ansi( blue, high), %ansi( defcol)Decara%ansi( blue, high), %ansi( defcol)Deceit%ansi( blue, high), %ansi( defcol)Dio%ansi( blue, high), %ansi( defcol)Eanoss%ansi( blue, high), %ansi( defcol)FGK%ansi( blue, high), %ansi( defcol)Hellbent%ansi( blue, high), %ansi( defcol)HellbentFP%ansi( blue, high), %ansi( defcol)HellbentUW%ansi( blue, high), %ansi( defcol)Hotel%ansi( blue, high), %ansi( defcol)Jalur%ansi( blue, high), %ansi( defcol)Keep%ansi( blue, high), %ansi( defcol)Kessarian%ansi( blue, high), %ansi( defcol)LonelyDragon%ansi( blue, high), %ansi( defcol)Low%ansi( blue, high), %ansi( defcol)Maelstrom%ansi( blue, high), %ansi( defcol)Magencia%ansi( blue, high), %ansi( defcol)Mandrake%ansi( blue, high), %ansi( defcol)Mulak%ansi( blue, high), %ansi( defcol)NK%ansi( blue, high), %ansi( defcol)NR%ansi( blue, high), %ansi( defcol)OV%ansi( blue, high), %ansi( defcol)PC%ansi( blue, high), %ansi( defcol)PG%ansi( blue, high), %ansi( defcol)Rahdiyr%ansi( blue, high), %ansi( defcol)Relic%ansi( blue, high), %ansi( defcol)Retreat%ansi( blue, high), %ansi( defcol)Rune%ansi( blue, high), %ansi( defcol)RuneForest%ansi( blue, high), %ansi( defcol)Seahag%ansi( blue, high), %ansi( defcol)Seelie%ansi( blue, high), %ansi( defcol)Sigil%ansi( blue, high), %ansi( defcol)Tellerium%ansi( blue, high), %ansi( defcol)Templeton%ansi( blue, high), %ansi( defcol)ToA%ansi( blue, high), %ansi( defcol)TwinMoons%ansi( blue, high), %ansi( defcol)Thorne%ansi( blue, high), %ansi( defcol)Unseelie%ansi( blue, high), %ansi( defcol)Vesuvius%ansi( blue, high), %ansi( defcol)Vospire%ansi( blue, high), %ansi( defcol)Vir%ansi( blue, high), %ansi( defcol)Winton%ansi( blue, high), %ansi( defcol)Wroth%ansi( blue, high), and %ansi( defcol)Xaventry%ansi( blue, high).}
#VAR location {@atlantis}
#VAR sex {%lower( @atlantis)}
#VAR MATHVALUE2 {1988}
#VAR MATHVALUE3 {1305}
#VAR MATHVALUE0 {801}
#VAR MATHVALUE1 {545}
#VAR VALUE0 {-1187}
#VAR VALUE1 {-760}
#VAR VALUELAT {1187 West}
#VAR VALUELONG {760 North}
#VAR VALUE2 {1187}
#VAR VALUE4 {1187}
#VAR VALUE5 {760}
#VAR VALUE3 {760}
#CLASS 0
#CLASS {Scripts|SexLoc|Striggers}
#TRIGGER {You are currently at position (%n), (%n)} {#say @location}
#TRIGGER {You are currently at position %1, %2 in} {
  #VAR MATHVALUE0 %1
  #VAR MATHVALUE1 %2
  math
  }
#TRIGGER {, located at %3, %4.} {
  #var MATHVALUE2 %3
  #var MATHVALUE3 %4
  }
#CLASS 0
#CLASS {Scripts|SexLoc|Salias}
#ALIAS howfar {
  #if (0>@value0) {
    #math VALUE2 {@value0*-1}
    #if (@value2>1150) {#if (0>@value4) {
        #math VALUE6 {@value4*-1}
        #var VALUELAT {@value6 East}
        } {#var VALUELAT {@value4 West}}} {#if (0>@value0) {
        #math VALUE2 {@value0*-1}
        #var VALUELAT {@value2 East}
        } {#var VALUELAT {@value0 West}}}
    }
  #if (0<@value0) {#if (@value0>1150) {#if (0>@value4) {
        #math VALUE6 {@value4*-1}
        #var VALUELAT {@value6 East}
        } {#var VALUELAT {@value4 West}}} {#if (0>@value0) {
        #math VALUE2 {@value0*-1}
        #var VALUELAT {@value2 East}
        } {#var VALUELAT {@value0 West}}}}
  #if (0=@value0) {#var VALUELAT {"0 East or West"}}
  #if (0>@value1) {
    #math VALUE3 {@value1*-1}
    #if (@value3>750) {#if (0>@value5) {
        #math VALUE7 {@value5*-1}
        #var VALUELONG {@value7 South}
        } {#var VALUELONG {@value5 North}}} {#if (0>@value1) {
        #math VALUE3 {@value1*-1}
        #var VALUELONG {@value3 South}
        } {#var VALUELONG {@value1 North}}}
    }
  #if (0<@value1) {#if (@value1>750) {#if (0>@value5) {
        #math VALUE7 {@value5*-1}
        #var VALUELONG {@value7 South}
        } {#var VALUELONG {@value5 North}}} {#if (0>@value1) {
        #math VALUE3 {@value1*-1}
        #var VALUELONG {@value3 South}
        } {#var VALUELONG {@value1 North}}}}
  #if (0=@value1) {#var VALUELONG {"0 North or South"}}
  #if (0=@value1 and 0=@value0) {#ECHO %ansi( blue, high)Estimated rooms to travel: %ansi( defcol)You have reached your chosen destination.} {#ECHO %ansi( blue, high)Estimated rooms to travel: %ansi( defcol)@valuelat%ansi( blue, high),%ansi( defcol) @valuelong%ansi( blue, high).}
  }
#ALIAS math {
  #MATH VALUE0 @MATHVALUE0-@MATHVALUE2
  #MATH VALUE1 @MATHVALUE1-@MATHVALUE3
  #MATH VALUE4 @MATHVALUE2-@MATHVALUE0
  #MATH VALUE5 @MATHVALUE3-@MATHVALUE1
  howfar
  }
#CLASS 0


See this works correctly..

Code:


You focus your powers of observation on a steel sextant:
Item 'a steel sextant' is type sextant, alignment 0, made of steel,
has keywords 'steel sextant'.
This item weighs 0 stones and 5 pebbles, and is valued at 100,000 gp.
This level 60 item has the attributes: identified
A steel sextant is in excellent condition.
You are currently at position 801, 545 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 248 West, 815 North.
*This item may be repaired 3 times.
The sextant is a navigational tool used by the navigator of the Magencia
to pinpoint the ships location on a map.  It is triangular and made of
steel, with measurement notches on the bottom piece.  Considered a lucky
charm by the navigator, the sextant glows and provides reading light for the
navigator at night.  You smile as you feel that this sextant will help you
guide your way around when used. 


But when I am at the edge of the world... The code is supposed to reverse if the number is above 750...

Code:
You are currently at position 0, 0 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 553 East, 1360 North.


Then when I go one northwest.

Code:
You are currently at position 2299, 1499 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 1746 East, 139 North.


Works in correctly.. What am I doing wrong here.
Reply with quote
luggage
Novice


Joined: 20 Jul 2004
Posts: 38
Location: Australia

PostPosted: Sat Jul 21, 2007 3:02 pm   
 
Sorry, I don't have a lot of time to wade through the script, maybe someone else can do it, but I can give a few pointers to tidy it up a little, as you could use the %ABS function for in the howfar alias.
It would change:

#if (0>@value1) {
#math VALUE3 {@value1*-1}
#var VALUELONG {@value3 South} }

into:

#IF (0<@value1) {#var VALUELONG {%abs(value1) South}

The other thing I noticed is that when checking, you use the figure 1150 and 750. Since your rooms start at 0 and end at 2499, you should be checking to see if it is above 1149 and 749.

By looking at the results given, it seems to me that it always gives and East and North, as the first example gave the long way round for the Northing, and the second gave the long way round for the Easting.

Luggage
Reply with quote
kyros
Novice


Joined: 26 Jan 2005
Posts: 33

PostPosted: Sat Aug 18, 2007 1:34 pm   
 
can any one else help?
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Sat Aug 18, 2007 4:44 pm   
 
First of all, a programming tip: use descriptive names for variables. All those generic names makes it tough to decipher, and to detect errors. (And BTW, longitude is typically east/west, and latitude north/south, which is reversed in your naming scheme.)

Also, part of your "correct" output is in fact wrong:
Code:
You are currently at position 801, 545 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 248 West, 815 North.

815 North is over halfway around the "globe", so you should instead be going 685 South.

You have two triggers with almost the same pattern:
Code:
#TRIGGER {You are currently at position (%n), (%n)} {#say @location}
#TRIGGER {You are currently at position %1, %2 in} {
  #VAR MATHVALUE0 %1
  #VAR MATHVALUE1 %2
  math
  }

And the second uses syntax that seems to work, but is wrong. And calling "math" here initiates the calculation, which it shouldn't because the calculation relies on data coming from the "location" #SAY.

Combine these to:
Code:
#TRIGGER {^You are currently at position (%n), (%n) in} {
#VAR CUR_X %1
#VAR CUR_Y %2
#say @location
}


Your destination trigger also uses incorrect syntax, and there's no need for a separate math step anymore, so do:
Code:
#TRIGGER {^Your destination is currently *, located at (%n), (%n).} {
#var DEST_X %1
#var DEST_Y %2
howfar
}


Delete the math alias, since I've coded it into the howfar alias.

And for the howfar alias, you had an incorrect algorithm to do the wrapping of the x/y coordinates. Try this:
Code:
#ALIAS howfar {
#MATH DELTA_X (@DEST_X - @CUR_X)
#MATH DELTA_Y (@DEST_Y - @CUR_Y)
#IF (@DELTA_X > 1150) {#MATH DELTA_X (@DELTA_X - 2300)} {#IF (@DELTA_X < -1150) {#MATH DELTA_X (@DELTA_X + 2300)}}
#IF (@DELTA_Y > 750) {#MATH DELTA_Y (@DELTA_Y - 1500)} {#IF (@DELTA_Y < -750) {#MATH DELTA_Y (@DELTA_Y + 1500)}}
#VAR DIR_X {%if(@DELTA_X <> 0, %if(@DELTA_X > 0, " East", " West"))}
#MATH DELTA_X (%abs(@DELTA_X))
#VAR DIR_Y {%if(@DELTA_Y <> 0, %if(@DELTA_Y > 0, " South", " North"))}
#MATH DELTA_Y (%abs(@DELTA_Y))
#IF (@DELTA_X = 0 and @DELTA_Y = 0) {#ECHO %ansi( blue, high)Estimated rooms to travel: %ansi( defcol)You have reached your chosen destination.} {#ECHO %ansi( blue, high)Estimated rooms to travel: %if(@DELTA_X > 0, %ansi( defcol)@DELTA_X@DIR_X%ansi( blue, high))%if(@DELTA_Y > 0, %if(@DELTA_X > 0, ", ")%ansi( defcol)@DELTA_Y@DIR_Y%ansi( blue, high)).}
}


Here's some test output:
Code:
You are currently at position 552, 1359 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 1 East, 1 South.

You are currently at position 554, 1361 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 1 West, 1 North.

You are currently at position 554, 1360 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 1 West.

You are currently at position 801, 545 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 248 West, 685 North.

You are currently at position 0, 0 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 553 East, 140 North.

You are currently at position 2299, 1499 in Alyria.
Your destination is currently Diocletian, located at 553, 1360.
Estimated rooms to travel: 554 East, 139 North.
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