Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
OTClient Code

These are codes that I have posted on various forums/discord.

Get Position from Shift-Click Look #1
onTextMessage(function(mode, text)
    if mode == 20 then
        if not modules.game_interface.gameMapPanel.mousePos then return end
        local tile = modules.game_interface.gameMapPanel:getTile(modules.game_interface.gameMapPanel.mousePos)
        if tile then
            local loc = tile:getPosition()
            error("Position: " .. loc.x.. ", "..loc.y..", "..loc.z)
            if not modules.game_textmessage then return end
            modules.game_textmessage.displayMessage(16, "position: " .. loc.x.. ", "..loc.y..", "..loc.z)
        end
    end
end)

Look messages are generated server side, but the message for look is mode 20, so you can listen for mode 20 textmessages and then just get the position from the tile under your cursor.

#LUA
01/01/2021