New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(release 30) update default scripts (IRE, 3k mappers) #400
(release 30) update default scripts (IRE, 3k mappers) #400
Conversation
Commit db579ba5595577a63875132609f0bdb279d61878 from https://github.com/Chris7/3k-Scripts
Commit 3b047fa18e4d91135d04aa97ede1dd85250e1df8 from https://github.com/IRE-Mudlet-Mapping/ire-mapping-script
@keneanung this'll bring up mudlet-mapper script from the version 5 years ago to latest as well. |
@@ -228,17 +229,19 @@ send("look")</script> | |||
<colorTriggerFgColor>#000000</colorTriggerFgColor> | |||
<colorTriggerBgColor>#000000</colorTriggerBgColor> | |||
<regexCodeList> | |||
<string>You cannot go</string> | |||
<string>You cannot go (west|east|south|north|up|down|northeast|northwest|southwest|southeast).$</string> | |||
<string>You cannot get it up.$</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, perhaps, an unfortunate phrase. 🤣
</regexCodePropertyList> | ||
</Trigger> | ||
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> | ||
<name>Too dark</name> | ||
<script>tmap.roomEntered = true | ||
if tmap:mapon() then | ||
tmap:echo("TURN ON A LIGHT!!!!!!!!") | ||
tmap:echo("\nMAPPING IN THE DARK. TURN ON A LIGHT!!!!!!!!\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
tmap:echo("\nYou can't see anything, yet you want to go MAPPING IN THE DARK? TURN ON A LIGHT!!!!!!!!\n")
😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a third-party that we include in Mudlet, won't be doing any modifications to it. Source is at https://github.com/Chris7/3k-Scripts if you're keen.
@@ -438,8 +443,12 @@ end</script> | |||
<Alias isActive="yes" isFolder="no"> | |||
<name>Show Exits</name> | |||
<script>--show room exits | |||
tmap:echo(getRoomExits(tmap.lastId)) | |||
tmap:echo("special exits:\n") | |||
local exits = getRoomExits(tmap.lastId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getRoomExits( roomId )
returns nothing if the room does not exist - so that means exits will be nil
in that case. Do you need to have a check for that?
for k,v in pairs(exits) do | ||
echo(" " .. k .. " -> " .. v .. "\n") | ||
end | ||
tmap:echo("Special Exits:\n") | ||
tmap:echo(getSpecialExitsSwap(tmap.lastId))</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, getSpecialExitsSwap( roomId )
also returns nil
on invalid roomId
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oy... all issues to file at https://github.com/Chris7/3k-Scripts if you'd like. I didn't write this script, just updating it to latest, we're already shipping it with Mudlet!
<script>--renames current area | ||
local Name = matches[2] | ||
local cArea = getRoomArea(tmap.lastId) | ||
setAreaName( cArea, Name )</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the enforced uniqueness of area names, setAreaName( oldArea, newArea )
now accepts an existing area name as a string for oldArea
BTW...
<script>local aid = getRoomArea(tmap.lastId) | ||
local rooms = getAreaRooms(aid) | ||
for i,v in pairs(rooms) do | ||
local stubs = getExitStubs(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getExitStubs( roomId )
starts its listing with a 0
- but there is now getExitStubs1( roomId )
which does the correct thing for a lua table and starts at 1 for the first entry.
It returns a list of numbers corresponding to the exit direction codes (1 to 12).
local stubs = getExitStubs(v) | ||
if stubs and type(stubs) == 'table' then | ||
for j,k in pairs(stubs) do | ||
connectExitStub(v,k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I note in comment 6 bug 1114594 this only works where the first argument is the fromRoomId and the second argument is a direction code (1 to 12) or a specific exit command string. In this case it IS so WILL work. 😌
<script>if not matches[2] then | ||
tmap:echo("Syntax: tmap deleteArea area name") | ||
else | ||
local atable = getAreaTableSwap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLuaInterpreter::deleteArea(...)
is now fully working and will take an existing area name as a string to delete. The code here is, I think, redundant.
🪲 However, there is a nasty corner case in that deleteArea(...)
called with the same string as TRoomDB::mDefaultAreaName
may delete the -1
area (I'll have to check more deeply), which does not sound good! 😱
elseif needed == "number" then | ||
return tonumber(val) | ||
elseif needed == "string" then | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something missing here? 😕
tmap:echo(string.format("Created new label #%d '%s' in %s.", lid, message, getRoomAreaName(getRoomArea(room)))) | ||
local labels = getRoomUserData(room, "mapLabels") | ||
local labelRep = tostring(getRoomArea(room))..'.'..tostring(lid) | ||
--labels is structured like: dir|||id|||label|||x,y,z offset|||fg|||bg!&!dir2|||id|||label|||xyz... | ||
-- local lTable = string.split(labels,'!&!') | ||
if labels ~= "" then | ||
if labels ~= "" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here?
</regexCodePropertyList> | ||
</Trigger> | ||
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> | ||
<name>Stop (angel presences</name> | ||
<script>setTriggerStayOpen("Angel presences", 0) | ||
<name>Stop (angel presences)</name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe should be <name>Stop (angel/demon) presences</name>
?
|
||
if not statusnum then mmp.echo("Unrecognized option - a door can be open, closed, locked or gone.") return end | ||
|
||
setDoor(room, direction, statusnum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now returns true
if a change was effected, false
if there was no actual change (but the command was valid e.g. setting an open door when there was already a door of that type set) or nil
+ error message if there is a problem...! This could make the following message only report if a change was made.
@@ -3186,58 +3769,131 @@ end | |||
|
|||
if not area then mmp.echo(matches[3].." isn't a known area. Which one do you want to set?") return end | |||
|
|||
local tmp = getRoomUserData(1, "areaContinents") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that data is not now being stored in roomId 1
at least here, has it moved to map or area userdata yet - or will it wait until we actually get to Release 3.0 (where we will update the default map format to a higher value that supports them)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how the script works to ensure maximum compatibility with most versions of Mudlet, using map userdata won't happen that soon.
|
||
local from, to = tonumber(matches[2]), tonumber(matches[3]) | ||
|
||
getPath(from, to) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget you now have the global speedWalkWeight
table as well now with the weights of each step and the getPath()
function also has a return value of the total weight of the route. 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't documented on the Mudlet wiki - will add documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -3549,6 +4231,112 @@ end</script> | |||
<packageName></packageName> | |||
<regex>^room marks$</regex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, I am giving up on looking through this, just too much to digest, I hope it all works, please indicate whether you'd prefer me to keep going... 😞
Yup... Noticed. Mind approving? This is blanket one.
…On Sat, 4 Mar 2017 10:54 pm Stephen Lyons, ***@***.***> wrote:
@vadi2 <https://github.com/vadi2> Didn't catch your indication that this
is really held over on @Chris7 <https://github.com/Chris7> repository
until I gave up - so didn't stop commenting until I *gave up*! 😊
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#400 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjMkapukRmF-QMvn6pcIfMcIcCtcIks5rid2FgaJpZM4MTFJs>
.
|
I've filed an issue at Chris7/3k-Scripts#7 to integrate your improvements. Sorry, tagging you for review was misleading - I just did that so you'd get a notification to approve the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must remember to check for what happens for a deleteArea("Default Area")
it might delete area -1 which could be bad.
OK, give it a look. Thanks! |
Updated scripts included with Mudlet to their latest versions from original source repositories.