Page 7 of 45

Re: Generic Mapping Script

Posted: Tue Feb 14, 2017 9:42 pm
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.

Re: Generic Mapping Script

Posted: Tue Feb 14, 2017 9:47 pm
by Vadi
That's the forum highlighter messing it up. Should not have any spans in there.

Re: Generic Mapping Script

Posted: Tue Feb 14, 2017 10:30 pm
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.

Re: Generic Mapping Script

Posted: Tue Feb 14, 2017 10:31 pm
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"?

Re: Generic Mapping Script

Posted: Tue Feb 14, 2017 10:38 pm
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.

Re: Generic Mapping Script

Posted: Sat Mar 04, 2017 6:23 pm
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.

Re: Generic Mapping Script

Posted: Wed May 24, 2017 10:55 am
by wtp
How do you install this?

Re: Generic Mapping Script

Posted: Thu May 25, 2017 12:27 pm
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")

Re: Generic Mapping Script

Posted: Fri May 26, 2017 5:21 pm
by wtp
Thank you for replying, but when I click the map, nothing appears to work, but it appears to have downloaded correctly

Re: Generic Mapping Script

Posted: Fri May 26, 2017 6:59 pm
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.