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

Lua 034-exhaustion field 'day' missing in date table

seleo

Active Member
Joined
Jun 6, 2012
Messages
498
Reaction score
33
Location
Egypt
Hello
i got an error in my talkactions
im using a talkaction in war server to change between towns but i have a problem as you can see in this error log

Code:
[Error - TalkAction Interface]
data/talkactions/scripts/towns2.lua:onSay
Description:
data/lib/034-exhaustion.lua:8: field 'day' missing in date table
stack traceback:
   [C]: in function 'time'
   data/lib/034-exhaustion.lua:8: in function 'check'
   data/talkactions/scripts/towns2.lua:9: in function <data/talkactions/scripts/towns2.lua:1>
[Error - TalkAction Interface]
data/talkactions/scripts/towns.lua:onSay
Description:
data/lib/034-exhaustion.lua:8: field 'day' missing in date table
stack traceback:
   [C]: in function 'time'
   data/lib/034-exhaustion.lua:8: in function 'check'
   data/talkactions/scripts/towns.lua:9: in function <data/talkactions/scripts/towns.lua:1>

this is my 034-exhaustion.lua file

Code:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

and this is the talkaction script.

Code:
function onSay(cid, words, param)
local pos = {x = 994, y = 896, z = 6}

if hasCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "You Can't Teleport In Fight")
return true
end

if exhaustion.check(cid, 9002) then
doPlayerSendCancel(cid, "Count Down System Please Wait "..exhaustion.get(cid,9002).." Second.")
return true
end

if not isPlayer(getTopCreature(pos).uid) then
doTeleportThing(cid, pos)
doCreatureSay(cid, 'Have Fun.', 19, false, cid)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
exhaustion.set(cid, 9002, 1*60)
return
end
end

Please help me to fix that im using TFS 0.4 tibia 8.6
 
ur 034-exhaustion.lua without error and ur script without error idk maybe and i tested script in tfs 0.4 and it work very good without errors
 
I had same problem but restart fixed it.
It happens to me every time i try to use this old script:
Code:
accessneeded = 5
talktype = 1
-- /Config --
function onSay(cid, words, param)
    t = string.explode(param, ",")
    player = getCreatureByName(t[1])
    if getPlayerAccess(cid) == accessneeded then
        if isCreature(player) then
            doCreatureSay(player, t[2], talktype, getCreaturePosition(player))
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")
        end
    end
    return true
end
talkactions/lib/talkactions.lua
Code:
function checkExhausted(cid, storage, seconds)
    local v = exhaustion.get(cid, storage)
    if(not v) then
        exhaustion.set(cid, storage, seconds)
    else
        doPlayerSendCancel(cid, "Please wait " .. v .. " seconds before use that command again.")
        return false
    end

    return true
end
When i use this script, every time i use script with exhaust there is error in console like yours.
But after restart everything is ok till i use this old script again.
Maybe better scripter will find out what is going on.
 
i'm having this problem aswell... no idea how is it happening
use this in your lib instead
Code:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}
 
Back
Top