• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction Download In Game Map Files

pink_panther

Excellent OT User
Joined
Sep 10, 2016
Messages
1,171
Solutions
13
Reaction score
613
Location
Kazordoon
I wanted to be able to download all the uncovered map files for my server, but didn't know a way how to export them.

I made this admin talkaction that will teleport your player all over an area to reveal your minimap and save your map files.

I suggest running it on a local test server.

Lua:
local startpos = {x = 31734, y = 31225, z = 0} -- Top left pos
local endpos = {x = 33940, y = 33263, z = 15} -- Bottom right pos

local inc = 14 -- Toile increments
local interval = 100 -- Delay betwen teleporting, lower number might cause DC

local startx = startpos.x
local starty = startpos.y
local startz = startpos.z

local endx = endpos.x
local endy = endpos.y
local endz = endpos.z

local gotox = startx
local gotoy = starty
local gotoz = startz

local function LoopFunction()
    local plr = Player("Panther Two")
    if not plr then
        print("Player not found, aborting " .. gotox .. " " .. gotoy .. " " .. gotoz)
        return
    end

    if gotox > endx and gotoy > endy then
        if gotoz == endz then
            plr:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Finished")
            --print("Finished")
            gotox = startx
            gotoy = starty
            gotoz = startz
            return
        else
        plr:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Next floor" .. gotoz)
        --print("Dropdown to " .. gotox .. " " .. gotoy .. " " .. gotoz)
        gotox = startx
        gotoy = starty
        gotoz = gotoz + 1
        end
    end
    
    if gotox > endx then
    gotox = startx
    gotoy = gotoy + inc
    plr:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Dropdown to " .. gotoy)
    --print("Dropdown to " .. gotox .. " " .. gotoy .. " " .. gotoz)
    end


    --plr:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Trying " .. gotox .. "," .. gotoy .. "," .. gotoz)
    local position = {x = gotox, y = gotoy, z = gotoz}
    local tileinfo = getTileInfo(position)
    if not tileinfo then
        --print("This pos doesn't have a tile, looking for one near by")
        for i = 1,inc,2 do
            for j = 1,inc,2 do           
                local tmppos = Position({x = gotox + i, y = gotoy + j, z = gotoz})
                local t = Tile(tmppos)
                if t then
                    if t:getGround() then
                            --plr:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Found pos nearby, Going to " .. gotox + i .. " " .. gotoy + j .. " " .. gotoz)  
                            --print("Found pos nearby, Going to " .. gotox + i .. " " .. gotoy + j .. " " .. gotoz)
                            plr:teleportTo({x = gotox + i, y = gotoy + j, z = gotoz})
                            gotox = gotox + inc
                            addEvent(LoopFunction, interval)
                            return;
                    end
                end          
            end 
        end  
        --print("couldn't find anywhere to stand near by, moving on.")
    else
        local t = Tile(position)
        if t then
            if t:getGround() then
                    print("Going to " .. gotox .. " " .. gotoy .. " " .. gotoz)
                    plr:teleportTo(position)
                    gotox = gotox + inc
                    addEvent(LoopFunction, interval)
                    return;
            end
        end  
    end
  
    gotox = gotox + inc
    addEvent(LoopFunction, 1)
end

function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    LoopFunction()
end


showmap.gif
 
Last edited:
Well I use Nostalrius and this would also work on any server.

Might need to adjust lua accordingly, but yeah.

It'd be nice if it was built into RME, would be a real time saver.
 
 
Back
Top