• 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!

Debug Client 8.6

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
188
Reaction score
9
GitHub
Jarek123
Hello Guys I have Ots 8.6 Otc and normal client Players write to me have debug and use Client tibia How I can find problem?I use Otc and I dont have problem
Post automatically merged:

tfs 1.5 by nekiro
Post automatically merged:

Lua:
Debug Assertion 8.60 Network.cpp 921
Thu Dec 07 23:55:36 2023
Graphic Engine: DirectX9 (2)
Operating System: Windows Vista Home Premium Edition 64 Bit in POL
Processor: Intel CORE I3-5
Video Card: Intel (R) HD GR
Last Packet Types: 031 108 162 143 162 162 040 161 160 180
Last Packet: 031 113 077 114 101 123 000 000 000 000 000 000 000 000 000 000
Player Position: [1538,148,5]
Player Name: Main'two (Santera 8.6)
Player Action: 053 052 046 051 055 046 050 051 051 046 057 056 058 055 049 055 050
Player.cpp 361: exception occurred, reason:
Network.cpp 946: exception occurred (ErrorCode = 0), reason:
Network.cpp 921: assertion failed (BufferSize = 0) (NextToWrite = 16394), reason:
BufferSize>0
Comment:
Post automatically merged:

Lua:
Debug Assertion 8.60 Objects.cpp 277
Thu Dec 07 23:12:08 2023
Graphic Engine: DirectX9 (2)
Operating System: Windows Vista Family in POL
Processor: AMD E2-1800 A
Video Card: ATI Radeon HD AMD 7340
Last Packet Types: 140 132 131 106 108 170 160 162 131 170
Last Packet: 108 173 000 061 000 006 001 106 173 000 061 000 006 001 073 011
Player Position: [171,65,7]
Player Name: Mayor (Santera 8.6)
Player Action: 053 052 046 051 055 046 050 051 051 046 057 056 058 055 049 055 050
Player.cpp 361: exception occurred, reason:
MainFrm.cpp 827: exception occurred (nChar = 112) (nFlags = 59), reason:
Control.cpp 1119: exception occurred (Key = 256), reason:
MainWindow.cpp 214: exception occurred (Key = 256), reason:
ConsoleWindow.cpp 1888: exception occurred (Key = 256), reason:
ConsoleWindow.cpp 1862: exception occurred (ObjectType = 12463) (ObjectData = 0), reason:
Objects.cpp 280: exception occurred (Type = 12463) (Flag = 7), reason:
Objects.cpp 277: assertion failed (Type = 12463) (ObjectProperties->high() = 11703), reason:
In(Type,ObjectProperties->low(),ObjectProperties->high())
Post automatically merged:

Lua:
----- 07/12/2023 18:03:07 - Main'ed (217.96.242.152) -----
Debug Assertion 8.60 NWin32Exception.cpp 50
Thu Dec 07 19:02:29 2023
Graphic Engine: DirectX9 (2)
Operating System: Windows Vista Home Premium Edition 64 Bit in POL
Processor: Intel CORE I3-5
Video Card: Intel (R) HD GR
Last Packet Types: 110 180 180 162 162 143 162 143 162 143
Last Packet: 110 000 110 025 013 000 077 097 103 101 032 066 097 099 107 112
Player Position: [16346,847,5]
Player Name: Main'ed (Santera 8.6)
Player Action: 053 052 046 051 055 046 050 051 051 046 057 056 058 055 049 055 050
Player.cpp 361: exception occurred, reason:
Player.cpp 465: exception occurred, reason:
Control.cpp 1728: exception occurred (MessageType: 0 MaW: 3466060 MoW: 907E8D8), reason:
Control.cpp 1723: exception occurred, reason:
NWin32Exception.cpp 50: win32 exception occurred, reason:
access violation (read attempt at FFB08BC0)
Comment:
 
Last edited:
Is one bug When You Have on !autoloot gold You can not logoaut is write "You can not logoaut because you are in event from script event from safezone
Safezone Sripts:
LIB
Lua:
if not SAFEZONE then
    SAFEZONE = {
        positionTeleportOpen = Position(158, 49, 7),
        teleportTimeClose = 5,
        positionEnterEvent = Position(366, 11, 11),
        storage = Storage.safezoneEvent,
        actionId = 9618,
        protectionTileId = {9562, 9563, 9564, 9565},
        levelMin = 50,
        maxPlayers = 30,
        reward = {6527, 25},
        lifeColor = {
            [1] = 94, -- red
            [2] = 77, -- orange
            [3] = 79 -- yellow
        },
        positionEvent = {firstTile = {x = 367, y = 22, z = 11}, tilesX = 12, tilesY = 14}
    }
end

function safezone_teleportCheck()
    local tile = Tile(SAFEZONE.positionTeleportOpen)
    if tile then
        local item = tile:getItemById(1387)
        if item then
            item:remove()

            local totalPlayers = safezone_totalPlayers()
            if totalPlayers > 0 then
                Game.broadcastMessage("The safezone event will begin now with ".. totalPlayers .." participants!", MESSAGE_STATUS_WARNING)
                print(">>> Safezone Event will begin now [".. totalPlayers .."].")
                
                safezone_createProtectionTiles()
            else
                -- print(">>> Safezone Event ended up not having the participation of players.")
            end
        else
            safezone_openMsg(SAFEZONE.teleportTimeClose)

            local teleport = Game.createItem(1387, 1, SAFEZONE.positionTeleportOpen)
            if teleport then
                teleport:setActionId(SAFEZONE.actionId)
                eventsOutfit = {}
                addEvent(safezone_teleportCheck, SAFEZONE.teleportTimeClose * 60000)
            end
        end
    end
end

function safezone_openMsg(minutes)
    local totalPlayers = safezone_totalPlayers()

    if minutes == SAFEZONE.teleportTimeClose then
        Game.broadcastMessage("The safezone event was opened and will close in ".. minutes .." "..(minutes == 1 and "minute" or "minutes") ..".", MESSAGE_STATUS_WARNING)
    else
        Game.broadcastMessage("The safezone event was opened and will close in ".. minutes .." ".. (minutes == 1 and "minute" or "minutes") ..". The event has ".. totalPlayers .." ".. (totalPlayers > 1 and "participants" or "participant") ..".", MESSAGE_STATUS_WARNING)
    end

    local minutesTime = minutes - 1
    if minutesTime > 0 then
        addEvent(safezone_openMsg, 60000, minutesTime)
    end
end

function safezone_removePlayer(uid)
    local player = Player(uid)
    if player then
        player:teleportTo(player:getTown():getTemplePosition())
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:setStorageValue(SAFEZONE.storage, 0)
        player:setOutfit(eventsOutfit[player:getGuid()])
    end   
end

function safezone_totalPlayers()
    local x = 0
    for _, player in ipairs(Game.getPlayers()) do
        if player:getStorageValue(SAFEZONE.storage) > 0 then
            x = x + 1
        end
    end
    return x
end

local function safezone_totalProtectionTile()
    local totalPlayers = safezone_totalPlayers()
    if totalPlayers >= 5 then
        return totalPlayers - 3
    else
        return totalPlayers - 1
    end
end

function safezone_createProtectionTiles()
    local totalPlayers = safezone_totalPlayers()
    if totalPlayers == 1 then
        for _, player in ipairs(Game.getPlayers()) do
            if player:getStorageValue(SAFEZONE.storage) > 0 then
                local itemType = ItemType(SAFEZONE.reward[1])
                if itemType:getId() ~= 0 then
                    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received ".. SAFEZONE.reward[2] .." ".. itemType:getName() .. " as a reward for first place in the safezone event.")
                    player:addItem(itemType:getId(), SAFEZONE.reward[2])
                end

                safezone_removePlayer(player:getGuid())

                Game.broadcastMessage("Safezone Event is finish. Congratulation to the player ".. player:getName() .." for being the event champion!", MESSAGE_STATUS_WARNING)
                print(">>> Safezone Event is finish. Congratulation to the player ".. player:getName() .." for being the event champion!")
            end
        end

    elseif totalPlayers > 1 then
        local createTiles, totalTiles = 0, safezone_totalProtectionTile()
        local tileX = SAFEZONE.positionEvent.firstTile.x
        local tileY = SAFEZONE.positionEvent.firstTile.y
        local tileZ = SAFEZONE.positionEvent.firstTile.z
        local tilesX = SAFEZONE.positionEvent.tilesX
        local tilesY = SAFEZONE.positionEvent.tilesY
        local protectionTileId = SAFEZONE.protectionTileId
        while createTiles < totalTiles do
            local randomX = math.random(tileX, tileX + tilesX)
            local randomY = math.random(tileY, tileY + tilesY)
            local newPosition = Position({x = randomX, y = randomY, z = tileZ})
            local tile = Tile(newPosition)
            if tile then
                local item1 = tile:getItemById(protectionTileId[1])
                local item2 = tile:getItemById(protectionTileId[2])
                local item3 = tile:getItemById(protectionTileId[3])
                local item4 = tile:getItemById(protectionTileId[4])
                if not item1 and not item2 and not item3 and not item4 then
                    local randomTile = math.random(protectionTileId[1], protectionTileId[4])
                    local tileProtection = Game.createItem(randomTile, 1, newPosition)
                    if tileProtection then
                        tileProtection:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
                        addEvent(safezone_deleteProtectionTiles, 5500, newPosition, randomTile)
                        createTiles = createTiles + 1
                    end
                end
            end
        end
        addEvent(safezone_effectArea, 5000, SAFEZONE.positionEvent.firstTile, SAFEZONE.positionEvent.tilesX, SAFEZONE.positionEvent.tilesY)
        addEvent(safezone_checkPlayersinProtectionTiles, 5000)
        addEvent(safezone_createProtectionTiles, 6000)
    end
end

function safezone_deleteProtectionTiles(position, tileId)
    local tile = Tile(position)
    if tile then
        local item = tile:getItemById(tileId)
        if item then
            item:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            item:remove()
        end
    end
end

function safezone_checkPlayersinProtectionTiles()
    local protectionTileId = SAFEZONE.protectionTileId
    for _, player in ipairs(Game.getPlayers()) do
        if player:getStorageValue(SAFEZONE.storage) > 0 then
            local tile = Tile(player:getPosition())
            if tile then
                local item1 = tile:getItemById(protectionTileId[1])
                local item2 = tile:getItemById(protectionTileId[2])
                local item3 = tile:getItemById(protectionTileId[3])
                local item4 = tile:getItemById(protectionTileId[4])
                if not item1 and not item2 and not item3 and not item4 then
                    if player:getStorageValue(SAFEZONE.storage) > 1 then

                        player:setStorageValue(SAFEZONE.storage, player:getStorageValue(SAFEZONE.storage) - 1)
                        local lifes = player:getStorageValue(SAFEZONE.storage)
                        player:setStorageValue(SAFEZONE.storage, 0)
                        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)

                        local outfit = player:getSex() == 0 and 136 or 128
                        if lifes == 1 then
                            local lifeColor = SAFEZONE.lifeColor[1]
                            player:setOutfit({lookType = outfit, lookHead = lifeColor, lookBody = lifeColor, lookLegs = lifeColor, lookFeet = lifeColor})
                        elseif lifes == 2 then
                            local lifeColor = SAFEZONE.lifeColor[2]
                            player:setOutfit({lookType = outfit, lookHead = lifeColor, lookBody = lifeColor, lookLegs = lifeColor, lookFeet = lifeColor})
                        end
                        
                        player:setStorageValue(SAFEZONE.storage, lifes)
                    else
                        player:getPosition():sendMagicEffect(CONST_ME_SMALLPLANTS)
                        safezone_removePlayer(player:getGuid())
                    end
                end
            end
        end
    end
end

function safezone_effectArea(firstTile, tilesX, tilesY)
    local fromPosition = firstTile
    local toPositionX = fromPosition.x + tilesX
    local toPositionY = fromPosition.y + tilesY
    for x = fromPosition.x, toPositionX do
        for y = fromPosition.y, toPositionY do
            local position = Position({x = x, y = y, z = fromPosition.z})
            if position then
                position:sendMagicEffect(CONST_ME_SMALLPLANTS)
            end
        end
    end
end
CREATURESCRIPTS
Code:
local safezoneModule = "data/lib/custom/safezone.lua"

local function isPlayerInSafezoneEvent(player)
    return player:getStorageValue(SAFEZONE.storage) > 0
end

local function resetSafezoneEvent(player)
    player:setStorageValue(SAFEZONE.storage, 0)
    player:teleportTo(player:getTown():getTemplePosition())
end

local function cancelLogoutInSafezoneEvent(player)
    player:sendCancelMessage("If you want logout turn off your loot say !autoloot gold")
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    return false
end

function onLogin(player)
    if isPlayerInSafezoneEvent(player) then
        resetSafezoneEvent(player)
    end
    return true
end

function onLogout(player)
    if isPlayerInSafezoneEvent(player) then
        return cancelLogoutInSafezoneEvent(player)
    end
    return true
end

function onEnterSafezone(player)
    if isPlayerInSafezoneEvent(player) then
    end
    return true
end

function onLeaveSafezone(player)
    if isPlayerInSafezoneEvent(player) then
    end
    return true
end

dofile(safezoneModule)
MY AUTOLOOT SCRIPT
Code:
-- !autoloot clear
-- !autoloot list
-- !autoloot add, itemName          / ex: !autoloot add, fire sword
-- !autoloot remove, itemName       / ex: !autoloot remove, fire sword

local autoloot = {
    freeAccountLimit = 10,
    premiumAccountLimit = 20,
}

local autolootCache = {}

local function getPlayerLimit(player)
    if player then
        return player:isPremium() and autoloot.premiumAccountLimit or autoloot.freeAccountLimit
    end
    return false
end

local function getPlayerAutolootItems(player)
    local limits = getPlayerLimit(player)
    if limits then
        local guid = player:getGuid()
        if guid then
            local itemsCache = autolootCache[guid]
            if itemsCache then
                if #itemsCache > limits then
                    local newChache = { unpack(itemsCache, 1, limits) }
                    autolootCache[guid] = newChache
                    return newChache
                end
                return itemsCache
            end

            local items = {}
            for i = 1, limits do
                local itemType = ItemType(math.max(player:getStorageValue(Storage.autolootBase + i)), 0)
                if itemType then
                    if itemType:getId() ~= 0 then
                        items[#items + 1] = itemType:getId()
                    end
                end
            end

            autolootCache[guid] = items
            return items
        end
    end
    return false
end

local function setPlayerAutolootItems(player, items)
    if items then
        local limit = getPlayerLimit(player)
        if limit then
            for i = limit, 1, -1 do
                player:setStorageValue(Storage.autolootBase + i, (items[i] and items[i] or -1))
            end
        end
        return true
    end
    return false
end

local function addPlayerAutolootItem(player, itemId)
    local items = getPlayerAutolootItems(player)
    if items then
        for _, id in pairs(items) do
            if itemId == id then
                return false
            end
        end
        items[#items + 1] = itemId
        return setPlayerAutolootItems(player, items)
    end
    return false
end

local function removePlayerAutoAlllootItem(player)
    local items = getPlayerAutolootItems(player)
    if items then
        for i, id in pairs(items) do
            table.remove(items, i)
        end
        return setPlayerAutolootItems(player, items)
    end
    return false
end

local function removePlayerAutolootItem(player, itemId)
    local items = getPlayerAutolootItems(player)
    if items then
        for i, id in pairs(items) do
            if itemId == id then
                table.remove(items, i)
                return setPlayerAutolootItems(player, items)
            end
        end
    end
    return false
end

local function hasPlayerAutolootItem(player, itemId)
    local items = getPlayerAutolootItems(player)
    if items then
        for _, id in pairs(items) do
            if itemId then
                if itemId == id then
                    return true
                end
            end
        end
    end
    return false
end

local ec = EventCallback

function ec.onDropLoot(monster, corpse)
    if not corpse:getType():isContainer() then
        return
    end

    local corpseOwner = Player(corpse:getCorpseOwner())
    if not corpseOwner then
        return
    end

    local items = corpse:getItems()
    local mType = monster:getType()
    local text = "Autoloot from " .. mType:getNameDescription() .. ":"

    if items then
        for _, item in pairs(items) do
            if item:getId() == 1987 then  -- Zmiana na ID reprezentujące plecak
                local bagItems = item:getItems()
                if bagItems then
                    for _, bagItem in pairs(bagItems) do
                        handleItem(corpseOwner, bagItem, text)
                    end
                end
            else
                handleItem(corpseOwner, item, text)
            end
        end
    end
end

function handleItem(player, item, text)
    local itemId = item:getId()
    local itemAmount = item:getCount()

    if table.contains({ ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN, 10559 }, itemId) and player:getStorageValue(Storage.autolootGoldAtive) == 1 then
        if itemAmount then
            item:remove(itemAmount)
            local amount = itemAmount
            if itemId == ITEM_PLATINUM_COIN then
                amount = amount * 100
            elseif itemId == ITEM_CRYSTAL_COIN then
                amount = amount * 10000
            elseif itemId == 10559 then
                amount = amount * 1000000
            end
            player:setBankBalance(player:getBankBalance() + amount)
            player:sendTextMessage(MESSAGE_INFO_DESCR, text .. " " .. amount .. " gold " .. (amount > 1 and "coins were transferred" or "coin has been transferred") .. " to your bank account.")
        end
    else
        if hasPlayerAutolootItem(player, itemId) then
            local itemName = itemAmount > 1 and item:getPluralName() or item:getName()
            local itemArticle = item:getArticle() ~= "" and item:getArticle() or "a"
            if not item:moveTo(player) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[AUTO LOOT] You don't have capacity.")
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, text .. " " .. (itemAmount > 1 and itemAmount or itemArticle) .. " " .. itemName .. ".")
            end
        end
    end
end

ec:register(3)
local talkAction = TalkAction("!autoloot")

function talkAction.onSay(player, words, param, type)
    local split = param:splitTrimmed(",")
    local action = split[1]
    if not action then
        player:showTextDialog(8977, "[AUTO LOOT] Commands:" .. "\n\n"
            .. "!autoloot clear" .. "\n"
            .. "!autoloot list" .. "\n"
            .. "!autoloot add, itemName" .. "\n"
            .. "!autoloot remove, itemName" .. "\n"
            .. "!autoloot gold" .. "\n\n"
            .. "Number of slots: " .. "\n"
            .. autoloot.freeAccountLimit .. " free account" .. "\n"
            .. autoloot.premiumAccountLimit .. " premium account")
        return false
    end

    if not table.contains({ "clear", "list", "add", "remove", "gold" }, action) then
        player:showTextDialog(8977, "[AUTO LOOT] Commands:" .. "\n\n"
            .. "!autoloot clear" .. "\n"
            .. "!autoloot list" .. "\n"
            .. "!autoloot add, itemName" .. "\n"
            .. "!autoloot remove, itemName" .. "\n"
            .. "!autoloot gold" .. "\n\n"
            .. "Quantidade de slots: " .. "\n"
            .. autoloot.freeAccountLimit .. " free account" .. "\n"
            .. autoloot.premiumAccountLimit .. " premium account")
        return false
    end

    -- !autoloot clear
    if action == "clear" then
        removePlayerAutoAlllootItem(player)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[AUTO LOOT] Clean autoloot list.")
        return false

        -- !autoloot list
    elseif action == "list" then
        local items = getPlayerAutolootItems(player)
        if items then
            local limit = getPlayerLimit(player)
            if limit then
                local description = { string.format('[AUTO LOOT] Capacity: %d/%d ~\n\nList of items:\n-----------------------------', #items, limit) }
                for i, itemId in pairs(items) do
                    description[#description + 1] = string.format("%d) %s", i, ItemType(itemId):getName())
                end
                player:showTextDialog(8977, table.concat(description, '\n'), false)
            end
        end
        return false
    end

    local function getItemType()
        local itemType = ItemType(split[2])
        if not itemType or itemType:getId() == 0 then
            itemType = ItemType(tonumber(split[2]) or 0)
            if not itemType or itemType:getId() == 0 then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] The item %s does not exist!", split[2]))
                return false
            end
        end
        return itemType
    end

    -- !autoloot add, itemName
    if action == "add" then
        local itemType = getItemType()
        if itemType then
            local limits = getPlayerLimit(player)
            if limits then
                local items = getPlayerAutolootItems(player)
                if items then
                    if #items >= limits then
                        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] Your autoloot only allows you to add %d items.", limits))
                        return false
                    end

                    if addPlayerAutolootItem(player, itemType:getId()) then
                        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] Perfect, you added the autoloot list: %s", itemType:getName()))
                    else
                        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] Item %s is already on the list!", itemType:getName()))
                    end
                end
            end
        end
        return false

        -- !autoloot remove, itemName
    elseif action == "remove" then
        local itemType = getItemType()
        if itemType then
            if removePlayerAutolootItem(player, itemType:getId()) then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] Perfect, you removed it from the autoloot list: %s", itemType:getName()))
            else
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("[AUTO LOOT] Item %s is not in your list.", itemType:getName()))
            end
        end
        return false

        -- !autoloot gold
    elseif action == "gold" then
        player:setStorageValue(Storage.autolootGoldAtive, player:getStorageValue(Storage.autolootGoldAtive) == 1 and 0 or 1)
        local check = player:getStorageValue(Storage.autolootGoldAtive) == 1 and "activated" or "disabled"
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[AUTO LOOT] You " .. check .. " collecting money by autoloot.")
        return false
    end

    return false
end

talkAction:separator(" ")
talkAction:register()

local creatureEvent = CreatureEvent("autolootCleanCache")

function creatureEvent.onLogout(player)
    if not player:isInEvent("collect gold") then
        local items = getPlayerAutolootItems(player)
        if items then
            setPlayerAutolootItems(player, items)
            autolootCache[player:getGuid()] = nil
        end
    end
    return true
end

Post automatically merged:

Can You help me?
 
unfortunately I can't help you, because the tibia client is different from the otserver client, any modification to it would be a lot of work, I think that even for a programmer to change the tibia client it would be difficult, what I recommend is that you just use otc because it editable.
I'm also not very good at programming, I'm learning little by little, but if the tibia client is causing a bug, it's because either it has sprites that don't exist on it, or your server has something that it isn't compatible with.
 

Similar threads

Back
Top