Difference between revisions of "IRE mapping script"
Line 33: | Line 33: | ||
* exact coordinates - ie 'rlc 1 -5 10' will create the room at those exact coordinates. | * exact coordinates - ie 'rlc 1 -5 10' will create the room at those exact coordinates. | ||
* partial coordinates - ie 'rlc 14x 5y' will create the room at 14x and 5y, but the same z-level you're on. You can can include all three of x,y,z coordinates or only one as you wish. | * partial coordinates - ie 'rlc 14x 5y' will create the room at 14x and 5y, but the same z-level you're on. You can can include all three of x,y,z coordinates or only one as you wish. | ||
+ | |||
+ | === rc - move a room === | ||
+ | Usage: *rc or room coords <option>*, where option will specify the new location of the room. Sample use: | ||
+ | * relative direction - ie 'rc nw' will move the room to be nw of the current location, 'rlc e s' will create the room east and south of the current location. | ||
+ | * exact coordinates - ie 'rc 1 -5 10' will move the room to those exact coordinates. | ||
+ | * partial coordinates - ie 'rc 14x 5y' will move the room to be at 14x and 5y, but the same z-level you're on. You can can include all three of x,y,z coordinates or only one as you wish. | ||
+ | |||
+ | === rld - delete a room === | ||
+ | Usage *rld or room delete <option>", where option is the location or ID of the room you'd like to delete. Sample use: | ||
+ | * relative direction - ie 'rld n' will delete the room that's north of you | ||
+ | * exact room ID - ie 'rld 513' will delete the room with ID 513 | ||
+ | * current room - ie 'rld' will delete the room you're currently in | ||
=== rlk - link rooms === | === rlk - link rooms === | ||
Line 38: | Line 50: | ||
* exact room ID and direction - ie 'rlk 351 n' will link the current room to room #351 via a north exit | * exact room ID and direction - ie 'rlk 351 n' will link the current room to room #351 via a north exit | ||
* relative direction - ie 'rlk n' will link, if there is, a room to the north of this one to the one you're in | * relative direction - ie 'rlk n' will link, if there is, a room to the north of this one to the one you're in | ||
+ | |||
+ | === urlk - unlink rooms == | ||
+ | Usage: *urlk or room unlink <option>*, where | ||
= API = | = API = |
Revision as of 13:32, 14 May 2011
This is the Lua component to make the Mudlet Mapper work for IRE games. You'll need to import the xml below in order for autowalking to work on Achaea, Aetolia, Lusternia, Imperian, or Midkemia Online.
Download
latest version (updated May 14th, 2011)
Installing
- make sure you're using a version of Mudlet that has a mapper (either a Map button or a Toolbox -> Show Map option)
- import this script
- done!
Updating
To update the xml, firstly delete all the Mudlet Mapper trigger, alias and script folders. Then, download the new xml and import it.
To make Mudlet re-download the map, close Mudlet, find the ~/.config/mudlet/profiles/<your profile>/map folder and delete it. ~ is your home folder. Start Mudlet again, click the Map button and it'll download the latest map.
Mapper changelog is available here.
Aliases
common
- goto <id> - goes to a room of that id
- mpp [on|off] - toggles or sets mapper to be paused
- mstop - stops the mapper completely
- rf <name>, room find <name> - searches for a room of a given name
- area list - shows the known area list
- room list <area> - shows the list of rooms in an area
- arealock, arealock <area> - displays a list of areas you can lock/unlock, can also give it an area name to filter by
- rl, rl <room name or room id>, room look, room look <room name or room id> - displays information about a room
mapping
rlc - create a room
Usage: *rlc or room create <option>*, where option will specify the location of the new room. You can specify the location via several ways:
- relative direction - ie 'rlc n' will create the room north of you, 'rlc se s' will create the room south-east and south of you.
- exact coordinates - ie 'rlc 1 -5 10' will create the room at those exact coordinates.
- partial coordinates - ie 'rlc 14x 5y' will create the room at 14x and 5y, but the same z-level you're on. You can can include all three of x,y,z coordinates or only one as you wish.
rc - move a room
Usage: *rc or room coords <option>*, where option will specify the new location of the room. Sample use:
- relative direction - ie 'rc nw' will move the room to be nw of the current location, 'rlc e s' will create the room east and south of the current location.
- exact coordinates - ie 'rc 1 -5 10' will move the room to those exact coordinates.
- partial coordinates - ie 'rc 14x 5y' will move the room to be at 14x and 5y, but the same z-level you're on. You can can include all three of x,y,z coordinates or only one as you wish.
rld - delete a room
Usage *rld or room delete <option>", where option is the location or ID of the room you'd like to delete. Sample use:
- relative direction - ie 'rld n' will delete the room that's north of you
- exact room ID - ie 'rld 513' will delete the room with ID 513
- current room - ie 'rld' will delete the room you're currently in
rlk - link rooms
Usage: *rlk or room link <option>*, where option will specify the room and exit to link with. You can do this in several ways:
- exact room ID and direction - ie 'rlk 351 n' will link the current room to room #351 via a north exit
- relative direction - ie 'rlk n' will link, if there is, a room to the north of this one to the one you're in
= urlk - unlink rooms
Usage: *urlk or room unlink <option>*, where
API
functions
mudlet events
- mmapper failed path - tried to go from A to B, but failed because there is no known path (or we were walking, got moved offcourse, and can't get to the destination anymore)
- mmapper arrived - arrived at our destination successfully
- mmapper stopped - mapper's stop function was called (this will be raised anytime it was, even if we weren't moving)
- mmapper updated pdb - mmp.pdb table was updated with new data
Developers
Code is hosted on a bzr branch in launchpad.net. If you'd like to help develop, please feel free to create a branch, add your changes, and then request a merge of your code
What else needs to be done
General things that need work are triggers for where room detection is necessary - player-locating abilities, shrine defilement warnings, mindsense area reports, etc. The general format is that the room ID should be prefixed to the line the room name is given + be made clickable - so the player can click on it and go. An example is provided for the Lusternian scent ability that implements this. Also needs to recognize the need to swim, right now if you don't have waterwalking - it'll loop trying to walk. Another small problem is that if it gets off the path once, it'll keep saying that it ended up off the path, and not realize when it arrived at the location properly (but it does arrive).
I've also started a bit on a person db - it stores the last known locations of players. This is something that is useful to everybody, so it's best that we don't have to keep reimplementing ourselves but use a common version. This requires more triggers to feed it's hunger for data as well!
Lastly, mapping aliases need to be added in along with some logic. The functions are already there, but need to be interfaced nicely.