-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enhances the 'map' command by making the output only 3 lines (not 11) and also clickable to send you in the appropriate direction * added a couple of aliases I missed last time * auto fes timer is now only 15 seconds (was 20)
- Loading branch information
1 parent
b891bed
commit ec89c48
Showing
15 changed files
with
254 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
}, | ||
{ | ||
"name": "MUDKIP_Mud2_autofes", | ||
"seconds": "20", | ||
"seconds": "15", | ||
"isActive": "true" | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.