Skip to content

Commit

Permalink
Merge pull request #13 from 11BelowStudio/develop
Browse files Browse the repository at this point in the history
MUDKIP 1.3.0!
  • Loading branch information
11BelowStudio authored Jun 18, 2024
2 parents 5dd5a7a + ec89c48 commit 819d28a
Show file tree
Hide file tree
Showing 15 changed files with 254 additions and 15 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 1.3.0

*18/6/2024*

* The output of `map` is now on 3 lines (not 11) and is now ***CLICKABLE!*** so you can go in a certain direction *without* needing to type stuff in (just click on the appropriate thingy!)
* Remember that MUD2 allows you to use `auto map` to automagically send a `map` command whenever you move to a new room!
* (note: only the most recent `map` output has clickable directions, to avoid potential misclicks whilst scrolling up)
* also added a couple more typo-correction aliases
* auto-fes timer is now 15 seconds (was 20)

## 1.2.0

*17/6/2024*
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ whistles like speedwalking, fancy maps, re-fighting, etc.
* Everything's contained within the global `MUDKIP_Mud2` table.
* The stats etc with the current state of your persona are
in the `MUDKIP_Mud2.stats` table.
* Misc utils are in `MUDKIP_Mud2.utils`.
* UI stuff is held in `MUDKIP_Mud2.ui`
* Auto-update stuff is held in `MUDKIP_Mud2.updates`
* Stuff related to the enhanced `map` command output is in `MUDKIP_Mud2.map`

## Final thoughts, how to contribute, thanks, things like that

Expand All @@ -88,17 +90,15 @@ if you wish to contribute to the development of *MUDKIP*.

## CHANGELOG

* **1.2.0** (`17/6/2024)
* Rewrote the automatic update code a little bit.
* Using the `dword` alias will clear the known dreamword.
* Also added a `DWORD` alias for saying the dreamword IN CAPITALS (for personae who tend to say things in capitals)
* Added an alias to fix accidentally putting an 's' at the end of emote-y commands whilst in game (correcting `smiles` to `smile`, `waves` into `wave`, `laughs` into `laugh` etc).
* Slight rebrand for the package (P stands for 'Package' instead of 'Panels' now)
* **1.3.0** (`18/6/2024`)
* The output of `map` is now on 3 lines (not 11) and is now ***CLICKABLE!*** so you can go in a certain direction *without* needing to type stuff in (just click on the appropriate thingy!)
* Remember that MUD2 allows you to use `auto map` to automagically send a `map` command whenever you move to a new room!
* (note: only the most recent `map` output has clickable directions, to avoid potential misclicks whilst scrolling up)
* also added a couple more typo-correction aliases

See [CHANGELOG.md](https://github.com/11BelowStudio/MUDKIP_Mud2/blob/main/CHANGELOG.md) for the full changelog.

## TODO

* see what people want I guess
* get the auto-update to check the tag on the latest release on git or something like that instead of the release version.txt(?)

2 changes: 1 addition & 1 deletion mfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"package": "MUDKIP_Mud2",
"version": "1.2.0",
"version": "1.3.0",
"author": "11BelowStudio",
"title": "Multi User Dungeon Kool Informational Package (for playing MUD2 with Mudlet)",
"outputFile": true,
Expand Down
2 changes: 1 addition & 1 deletion release.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"package": "MUDKIP_Mud2",
"version": "1.2.0",
"version": "1.3.0",
"author": "11BelowStudio",
"title": "Multi User Dungeon Kool Informational Package (for playing MUD2 with Mudlet)",
"outputFile": true,
Expand Down
2 changes: 1 addition & 1 deletion src/aliases/MUDKIP_Mud2/aliases.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
{
"name":"emotes_with_s",
"isActive":"true",
"regex":"(?i)^(?<emote>bay|bark|blink|cackle|cheer|chuckle|drool|duck|flip|frown|gasp|giggle|glare|grin|groan|growl|gurgle|howl|laugh|leer|nod|point|ponder|pounce|pucker|purr|quack|roar|scream|shake|shiver|shout|shrug|sing|smile|smirk|spin|stammer|think|twiddle|wait|(re)?wave|whisper|wink|woof|yodel|yawn)s$"
"regex":"(?i)^(?<emote>bay|bark|blink|cackle|cheer|chuckle|drool|duck|flip|frown|gasp|giggle|glare|grimace|grin|groan|growl|gurgle|howl|laugh|leer|nod|point|ponder|pounce|pucker|purr|quack|roar|scream|shake|shiver|shout|shrug|sing|smile|smirk|spin|stammer|think|twiddle|wait|(re)?wave|whisper|wink|woof|yodel|yawn)s$"
}
]
99 changes: 99 additions & 0 deletions src/scripts/MUDKIP_Mud2/clickable_map.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
--[[
This file contains most of the code for the very cool
CLICKABLE OUTPUT OF THE 'map' COMMAND
provided by MUDKIP_Mud2.
(very epic, I know)
]]--


local M2Map = MUDKIP_Mud2.map

-- initialization of stuff

M2Map.nw = "<128,0,0:0,0,0>nw<r>"
M2Map.n="<128,0,0:0,0,0>nn<r>"
M2Map.ne="<128,0,0:0,0,0>ne<r>"
M2Map.up="<128,0,0:0,0,0>up<r>"
M2Map.w="<128,0,0:0,0,0>ww<r>"
M2Map.e="<128,0,0:0,0,0>ee<r>"
M2Map.sw="<128,0,0:0,0,0>sw<r>"
M2Map.s="<128,0,0:0,0,0>ss<r>"
M2Map.se="<128,0,0:0,0,0>se<r>"
M2Map.down="<128,0,0:0,0,0>dn<r>"
M2Map._space = "<0,0,0:0,0,0> <r>"

M2Map.mapLine = 0

M2Map.validMapId = 0 -- you need to click the most recent map.

function M2Map:updateMap()

self.validMapId = self.validMapId + 1
local thisMapId = self.validMapId

decho("\n"..self._space)
dechoLink(self.nw,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'nw')","move nw",true)
decho(self._space)
dechoLink(self.n,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'n')","move n",true)
decho(self._space)
dechoLink(self.ne,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'ne')","move ne",true)
decho(self._space)
dechoLink(self.up,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'up')","move up",true)
decho("\n")

decho(self._space)
dechoLink(self.w,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'w')","move w",true)
decho(self._space)
decho(self._space .. self._space)
decho(self._space)
dechoLink(self.e,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'e')","move e",true)
decho("\n")

decho(self._space)
dechoLink(self.sw,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'sw')","move sw",true)
decho(self._space)
dechoLink(self.s,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'s')","move s",true)
decho(self._space)
dechoLink(self.se,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'se')","move se",true)
decho(self._space)
dechoLink(self.down,"MUDKIP_Mud2.map:attemptMove("..thisMapId..",'down')","move down",true)
decho("\n")

end

function M2Map:attemptMove(mapId, direction)
if (mapId == self.validMapId) then
send(direction)
end
end

function M2Map:resetMapLine()
self.mapLine = 0
end

function M2Map:setUpOrDown(mapDir)
if self.mapLine == 0 then
self.up = mapDir
else
self.down = mapDir
self:updateMap()
self.mapLine = 0
end
end

function M2Map:setCompassDirs(wDir,nsDir,eDir)
if self.mapLine == 0 then
self.nw = wDir
self.n = nsDir
self.ne = eDir
elseif self.mapLine == 1 then
self.w = wDir
self.e = eDir
else
self.sw = wDir
self.s = nsDir
self.se = eDir
end
self.mapLine = self.mapLine + 1
end
7 changes: 7 additions & 0 deletions src/scripts/MUDKIP_Mud2/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ if not MUDKIP_Mud2 then

MUDKIP_Mud2.updates = M2Updates

local M2Utils = {}

MUDKIP_Mud2.utils = {}

local M2Map = {}

MUDKIP_Mud2.map = M2Map

local M2UI = {}

Expand Down
10 changes: 10 additions & 0 deletions src/scripts/MUDKIP_Mud2/scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"isActive":"yes",
"eventHandlerList": []
},
{
"name":"utils",
"isActive":"yes",
"eventHandlerList": []
},
{
"name":"UI",
"isActive":"yes",
Expand All @@ -13,5 +18,10 @@
"name":"updates",
"isActive":"yes",
"eventHandlerList": []
},
{
"name":"clickable_map",
"isActive":"yes",
"eventHandlerList": []
}
]
7 changes: 7 additions & 0 deletions src/scripts/MUDKIP_Mud2/updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ local function load_package_xml(path)


if path ~= defaults.temp_file_path .. defaults.package_name.. ".xml" then
-- if this isn't the updated version of MUDKIP_Mud2, we don't do anything.
return
--[[
if MUDKIP_Mud2 then
MUDKIP_Mud2:mcecho("Given unexpected .xml file (".. path .."), aborting! (please install the update manually.)", "error")
else
cecho("\n<b><ansiLightRed>ERROR</b><reset> - Given unexpected .xml file (".. path .."), aborting! (please install the update manually.)\n")
return
end
]]
end


Expand All @@ -157,12 +161,15 @@ end
local function load_package_mpackage(path)

if path ~= defaults.temp_file_path .. defaults.package_name.. ".mpackage" then
-- if this isn't the updated version of MUDKIP_Mud2, we don't do anything.
--[[
if MUDKIP_Mud2 then
MUDKIP_Mud2:mcecho("Given unexpected .mpackage file (".. path .."), aborting! (please install the update manually.)", "error")
else
cecho("\n<b><ansiLightRed>ERROR</b><reset> - Given unexpected .mpackage file (".. path .."), aborting! (please install the update manually.)\n")
return
end
--]]
end

-- uninstall old package
Expand Down
32 changes: 32 additions & 0 deletions src/scripts/MUDKIP_Mud2/utils.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--[[
Some utilities related to MUDKIP_Mud2
]]--

local M2Utils = MUDKIP_Mud2.utils


function M2Utils:clearBlankAndDupeLines()
local thisLine = getCurrentLine()
local thisLineNumber = getLineNumber()
local blankLine = MUDKIP_Mud2:getBlankReplacePlaceholder()
local foundNonDuplicateLine = false
--local thisUnformatted = copy2decho()
--display(thisUnformatted)
moveCursor(0, getLineNumber() - 1)

repeat
local tempLine = getCurrentLine()
--local thisUnformatted = copy2decho()
--display(thisUnformatted .. "\n")
if (tempLine ~= "") and (tempLine ~= thisLine) and (thisLine ~= blankLine) then
foundNonDuplicateLine = true
--display("\nfound non-dupe!")
else
replaceLine(blankLine)
deleteLine()
moveCursor(0, getLineNumber() - 1)
end
until foundNonDuplicateLine

moveCursor(0, thisLineNumber)
end
2 changes: 1 addition & 1 deletion src/timers/MUDKIP_Mud2/timers.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"name": "MUDKIP_Mud2_autofes",
"seconds": "20",
"seconds": "15",
"isActive": "true"
},
{
Expand Down
11 changes: 10 additions & 1 deletion src/triggers/MUDKIP_Mud2/MUDKIP_Mud2_on_prompt.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
if copy2decho() ~= "<0,0,255:0,0,0>*<r>" then
return
end

raiseEvent("MUDKIP_Mud2 on prompt")

MUDKIP_Mud2.map:resetMapLine()
MUDKIP_Mud2.utils:clearBlankAndDupeLines()

--[[
local thisLine = getCurrentLine()
local thisLineNumber = getLineNumber()
local blankLine = MUDKIP_Mud2:getBlankReplacePlaceholder()
Expand All @@ -12,7 +20,7 @@ repeat
local tempLine = getCurrentLine()
--local thisUnformatted = copy2decho()
--display(thisUnformatted .. "\n")
if (tempLine ~= thisLine) and (thisLine ~= blankLine) then
if (tempLine ~= "") and (tempLine ~= thisLine) and (thisLine ~= blankLine) then
foundNonDuplicateLine = true
--display("\nfound non-dupe!")
else
Expand All @@ -23,3 +31,4 @@ repeat
until foundNonDuplicateLine
moveCursor(0, thisLineNumber)
--]]
7 changes: 7 additions & 0 deletions src/triggers/MUDKIP_Mud2/map_middle_lines.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--display("ns:" .. copy2decho())
--display("w:"..copy2decho(matches.w)..",ns:"..copy2decho(matches.ns)..",e:"..copy2decho(matches.e))

MUDKIP_Mud2.map:setCompassDirs(copy2decho(matches.w),copy2decho(matches.ns),copy2decho(matches.e))
local blankLine = MUDKIP_Mud2:getBlankReplacePlaceholder()
replaceLine(blankLine)
deleteLine()
32 changes: 32 additions & 0 deletions src/triggers/MUDKIP_Mud2/map_start_end_line.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--display("updown:" .. copy2decho())
--display("updown:" .. copy2decho(matches.updown))
local updown = copy2decho(matches.updown)

local thisLine = getCurrentLine()
local thisLineNumber = getLineNumber()
local blankLine = MUDKIP_Mud2:getBlankReplacePlaceholder()
replaceLine(blankLine)
deleteLine()
MUDKIP_Mud2.utils:clearBlankAndDupeLines()
--[[
local foundNonDuplicateLine = false
--local thisUnformatted = copy2decho()
--display(thisUnformatted)
moveCursor(0, getLineNumber() - 1)
repeat
local tempLine = getCurrentLine()
--local thisUnformatted = copy2decho()
--display(thisUnformatted .. "\n")
if (tempLine ~= "") and (tempLine ~= thisLine) and (thisLine ~= blankLine) then
foundNonDuplicateLine = true
--display("\nfound non-dupe!")
else
replaceLine(blankLine)
deleteLine()
moveCursor(0, getLineNumber() - 1)
end
until foundNonDuplicateLine
]]--

MUDKIP_Mud2.map:setUpOrDown(updown)
Loading

0 comments on commit 819d28a

Please sign in to comment.