Generic Mapping Script

All and any discussion and development of the Mudlet Mapper.
Post Reply
apelogic
Posts: 4
Joined: Sun Feb 12, 2017 7:03 am
Location: Austin, TX

Re: Generic Mapping Script

Post by apelogic »

I'm getting this when I copy your script over to Mudlet Scripts:
Lua syntax error:[string "-- Jor'Mox's Generic Map Script..."]:121 :']' expected near 'posthilit'
At first I thought it was the line 121:
["Start <span class="posthilit">Mapping</span> Alias"] = {[[^start <span class="posthilit">mapping</span>(?: (.*))?$]], [[map.start_mapping(matches[2])]]},
["Stop <span class="posthilit">Mapping</span> Alias"] = {[[^stop <span class="posthilit">mapping</span>$]], [[map.stop_mapping()]]},
I tried adding escapes to the quote characters around posthilit, but nothing would fix it and I gave up.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Generic Mapping Script

Post by Vadi »

That's the forum highlighter messing it up. Should not have any spans in there.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Yeah, it looks like what I would expect if you selected something beyond the code box. I recommend clicking the "Select" button at the top of the code box, and just copying that, rather than trying to select it manually. That way, you should avoid that sort of problem.

apelogic
Posts: 4
Joined: Sun Feb 12, 2017 7:03 am
Location: Austin, TX

Re: Generic Mapping Script

Post by apelogic »

is using the lua box same as using code box?

Code: Select all

[lua][/lua]
[code]
[/code]
I tried to reproduce the problem wihtout success is there some special character around "Script" and "Mapping"?

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Using the code tags doesn't impose Lua highlighting, using the Lua tags does, otherwise they are essentially the same thing. I'm not aware of any special characters.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Created a package, along with a single line command that can be used to download and install it for you. Added the command at the end of the first post. I included some basic triggers to help show what is needed. Let me know if there are any problems.

wtp
Posts: 5
Joined: Tue May 23, 2017 10:44 pm

Re: Generic Mapping Script

Post by wtp »

How do you install this?

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Take this as a single line of text. Copy and paste it into the command line in the Mudlet Profile you want to install this in, and hit enter. It uses an alias that Mudlet makes for you in new profiles to execute lua code from the command line (so if you deleted it, you need it back), and from there, it downloads and installs the necessary scripts.
Code: [show] | [select all] lua
lua function downloaded_package(a,b) if not b:find("generic_mapper",1,true) then return end installPackage(b) os.remove(b) end registerAnonymousEventHandler("sysDownloadDone","downloaded_package") downloadFile(getMudletHomeDir().."/generic_mapper.mpackage","http://dslpnp.altervista.org/Generic_Mapper.mpackage")

wtp
Posts: 5
Joined: Tue May 23, 2017 10:44 pm

Re: Generic Mapping Script

Post by wtp »

Thank you for replying, but when I click the map, nothing appears to work, but it appears to have downloaded correctly

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

What exactly are you expecting to happen that isn't happening? Because, in general, clicking the map is only used for making you walk to the targeted room (and you would need to tweak the code to make that happen, as right now it just echoes the directions to the main window, due to variations in how different games handle movement).

Note that for ANYTHING to happen, you need to make a number of triggers that are going to be specific to your game to capture information about the room (the room name, and the exits from the room, assuming this information isn't available in your prompt), one to capture the prompt (and store the room name and exits from here if not done before hand), as well as one that lets you know that a room was seen (if you have a trigger to capture the name and exits, then this part of it can be folded into one of those).

Once all those triggers have been made, then you need to use the already build in aliases (as described in the comments at the top of the script) to tell it to start mapping, and make assorted adjustments as necessary.

Post Reply