Hello,
There seems to be an issue with the speedwalking stuff in the IRE mapper script if you have sprint enabled. Basically if the final destination room is in the middle of a straight path of rooms, rather than walk you to the destination (if it were to sprint, it would run past the room), it simply moves you 1 room and thinks it's finished. So for example if the rooms are:
[a]-
-[c]-[d]-[e] and you start from room a and try to 'goto d', it simply moves you to room b and stops because, I think, the dashing logic is interfering somehow.
The code that I think has the problem is below, maybe someone can see a problem?
function doSpeedWalk(dashtype)
resetStopWatch(speedWalkWatch)
startStopWatch(speedWalkWatch)
if mmp.settings["gallop"] or mmp.settings["dash"] or mmp.settings.sprint or dashtype then
mmp.fixPath(mmp.currentroom, speedWalkPath[#speedWalkPath],
(mmp.settings["gallop"] and "gallop") or (mmp.settings["dash"] and "dash") or (mmp.settings.sprint and "sprint") or (mmp.settings.runaway and "runaway") or dashtype)
end
mmp.fixSpecialExits(speedWalkDir)
if #speedWalkPath == 0 then
mmp.echo("Couldn't find a path to the destination :(")
raiseEvent("mmapper failed path")
return
end
mmp.autowalking = true
-- this is a fix: convert nums to actual numbers
for i = 1, #speedWalkPath do
speedWalkPath[i] = tonumber(speedWalkPath[i])
end
if not mmp.paused then
mmp.echon("Starting speedwalk from "..(atcp.RoomNum or gmcp.Room.Info.num).." to ") echoLink(speedWalkPath[#speedWalkPath], 'gotoRoom "' .. speedWalkPath[#speedWalkPath].. '"', 'Go to ' .. speedWalkPath[#speedWalkPath]) echo(": ")
speedWalkCounter = 1
if mmp.canmove() then mmp.move() else echo("(when we get balance back / aren't hindered)") end
else
mmp.echo("Will go to "..speedWalkPath[#speedWalkPath].." as soon as the mapper is unpaused.")
end
end
function mmp.fixPath(rFrom,rTo,dashtype)
local currentPath, currentIds = {}, {}
local dRef = {["n"] = "north", ["e"] = "east", ["s"] = "south", ["w"] = "west"}
if not getPath(rFrom,rTo) then return false end
-- Logic: Look for a direction repeated at least two times.
-- count the number of times it repeats, then look that many rooms ahead.
-- if that room also contains the direction we're headed, just travel that many directions.
-- otherwise, dash.
local repCount = 1
local index = 1
local dashExaust = false
while speedWalkDir[index] do
dashExaust = false
repCount = 1
while speedWalkDir[index+repCount] == speedWalkDir[index] do
repCount = repCount + 1
if repCount == 11 then
dashExaust = true
break
end
end
if repCount > 1 then
-- Found direction repitition. Calculate dash path.
local exits = getRoomExits(speedWalkPath[index+(repCount-1)])
local pname = ""
for word in speedWalkDir[index]:gmatch("%w") do pname = pname .. (dRef[word] or word) end
if not exits[pname] or dashExaust then
-- Final room in this direction does not continue, dash!
table.insert(currentPath,string.format("%s %s",dashtype,speedWalkDir[index]))
currentIds[#currentIds+1] = speedWalkPath[index+repCount-1]
else
-- Final room in this direction continues onwards, don't dash
for i = 1,repCount do
table.insert(currentPath,speedWalkDir[index])
currentIds[#currentIds+1] = speedWalkPath[index]
end
end
index = index + repCount
else
-- No repetition, just add the direction.
table.insert(currentPath,speedWalkDir[index])
currentIds[#currentIds+1] = speedWalkPath[index]
index = index + 1
end
end
speedWalkDir = currentPath
speedWalkPath = currentIds
return true
end