Achaea/Iron realms map downloader

Share your scripts and packages with other Mudlet users.
Post Reply
Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Achaea/Iron realms map downloader

Post by Wyd »

Hi all,

I've just finished version 1 of a script which downloads and saves the maps that Iron Realms provides for the flash client.

At the moment, it doesn't do much more then download a map if you don't already have it (only only if you ask it to - though it easy to make a ATCP callback for it so it'll download a map if you go into a area you don't have a map for). I'm working on a window to display the maps, and will put the code here once its finished.

You requires the LuaSocket libraries, which don't currently come with Mudlet, so you will need to download it from here and place the files in the correct folders for the script to work.

If you want to use it for another IRE mud other then achaea, you will need to change the following:

The IP address in the downloadMap function, since it points to Achaea (the IP address needs to be used, because the DNS lookup can cause mudlet to freeze while it converts the host to a IP). This needs to be changed to the IP address of your MUD

The URL in the createMap function needs to be changed to use your MUD, instead of Achaea

The "host" key in the table inside the getDefaultHeaders function will need to be changed to suit your MUD.


Code: Select all

Usage:

MapDownloader.downloadMap(mapID, buildingID, zNum[, force) - Download a map and save it in 'Maps' inside your profile folder (which you will need to create in order for the script to save the maps properly)

MapDownloader.getMapHere() - will automatically parse the ClientMap atcp value and download the map for the area you are in if you don't have it already.



The downloader supports downloading more then one map at a time, so you don't have to wait for one to finish before starting the next one.

If you want the map to automatically download maps as you go between areas, then you need to create a event callback for the ClientMap event, and add the following code
Code: [show] | [select all] lua
function ClientMap(event, args)
  MapDownloader.getMapHere()
end
Feel free to post any questions/suggestions/etc

Wyd
Attachments
MapDownloader.xml
(11.31 KiB) Downloaded 516 times

Post Reply