Code: Select all
||adjacent.mac
|
|Had this really cool idea to make a plugin that would tell you all the adjacent zones to the zone you are currently in.
|This will not only assist veterans in remembering not only where they are, but also where they are going, and it will help
|newbies learn the mapping of the world. The command to get your zone list is /mac adjacent which will list the nearby zones
|in KHiTS ini format... Basically:
|
| [Greater Faydark]
| 1=Butcherblock
| 2=Felwithe
| 3=Lesser Faydark
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#define INIPATH "d:\apps\mq2\Release\Macros"
Sub Main
|Name of the Zone you are currently in. Used to get the list of Adjacent Zones.
/declare zoneName string local NOT_SET
|Checks to see if you have the Current Zone in the list.
/declare zoneCheck string local NOT_SET
/declare currentZone string local NOT_SET
/declare zonesAdjacent string local NOT_SET
| Only declare outer variables once, this is in case you use this as an include
/if (${Defined[zones]}==FALSE) {
| Zone info
| Array of zones used to make the list
/declare zones[10] string outer
| The number of zones in this list
/declare adjacentCount int outer 0
/declare iZoneLoop int local 1
| The results of what we are making
/declare zoneList string outer NOT_SET
} else {
/deletevar zones
/declare zones[10]
}
|Get Current Zone Name
/varset currentZone ${Zone.Name}
/echo ${currentZone}
/echo Adjacent: Reading List
|Get the List of Adjacent Zones from the ini
/varset iZoneLoop 0
:adjacentZonesLoop
/varset zonesAdjacent ${Ini[INIPATH,${currentZone},Zone${iZoneLoop}]}
/if (${String[${zonesAdjacent}].NotEqual[null]}) {
/varcalc zoneLoop ${zoneLoop}+1
/echo ${zonesAdjacent}
/goto :adjacentZonesLoop
}
/varset adjacentCount ${zoneLoop}
:endmacro
/endmacroIts not working for me for reasons unknown. Thanks to Kaitain for KHiTS and the basic idea for using the ini in a similar fashion.

