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

Solved Couldn't execute event: Run_Event_Days

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
Hi!

I ctrl c + ctrl V my server from windows to linux... compiled, ok.

When i open my server on linux, appear this error:

Code:
[Error - GlobalEvent Interface]
                        domodlib("config_run_event")
                        domodlib("lib_run_event")

                        local daysOpen = {}
                        for k, v in pairs(configRunEvent.days) do
                                table.insert(daysOpen, k)
                        end

                        function onThink(interval)
                                if isInArray(daysOpen, os.date("%A")) then
                                        if isInArray(configRunEvent.days[os.date("%A")], os.date("%X", os.time())) then
                                                if getStorage(configRunEvent.storages.joining) ~= 1 then
                                                        doSetStorage(configRunEvent.storages.joining, 1)
                                                        addEvent(doStartEventRun, configRunEvent.delayTime * 60 * 1000)
                                                        doStartCountingRunEvent(0)

                                                        for _, pid in ipairs(getPlayersOnline()) do
                                                                if getCreatureStorage(pid, configRunEvent.storages.player) > 0 then
                                                                        doCreatureSetStorage(pid, configRunEvent.storages.player, -1)

                                                                        doPlayerSetGroupId(pid, math.max(1, getCreatureStorage(pid, configRunEvent.storages.group)))
                                                                        doChangeSpeed(pid, getCreatureBaseSpeed(pid) - configRunEvent.players.speed)
                                                                        doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                                                                end
                                                        end
                                                end
                                        end
                                end
                                return true
                        end
                :onThink
Description:
[string "LuaInterface::loadBuffer"]:10: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [string "LuaInterface::loadBuffer"]:10: in function <[string "LuaInterface::loadBuffer"]:9>
[Error - GlobalEvents::think] Couldn't execute event: Run_Event_Days

[Error - GlobalEvent Interface]
                        domodlib("config_run_event")
                        domodlib("lib_run_event")

                        local daysOpen = {}
                        for k, v in pairs(configRunEvent.days) do
                                table.insert(daysOpen, k)
                        end

                        function onThink(interval)
                                if isInArray(daysOpen, os.date("%A")) then
                                        if isInArray(configRunEvent.days[os.date("%A")], os.date("%X", os.time())) then
                                                if getStorage(configRunEvent.storages.joining) ~= 1 then
                                                        doSetStorage(configRunEvent.storages.joining, 1)
                                                        addEvent(doStartEventRun, configRunEvent.delayTime * 60 * 1000)
                                                        doStartCountingRunEvent(0)

                                                        for _, pid in ipairs(getPlayersOnline()) do
                                                                if getCreatureStorage(pid, configRunEvent.storages.player) > 0 then
                                                                        doCreatureSetStorage(pid, configRunEvent.storages.player, -1)

                                                                        doPlayerSetGroupId(pid, math.max(1, getCreatureStorage(pid, configRunEvent.storages.group)))
                                                                        doChangeSpeed(pid, getCreatureBaseSpeed(pid) - configRunEvent.players.speed)
                                                                        doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true)
                                                                end
                                                        end
                                                end
                                        end
                                end
                                return true
                        end
                :onThink
Description:
[string "LuaInterface::loadBuffer"]:10: attempt to call global 'isInArray' (a nil value)
stack traceback:
        [string "LuaInterface::loadBuffer"]:10: in function <[string "LuaInterface::loadBuffer"]:9>
[Error - GlobalEvents::think] Couldn't execute event: Run_Event_Days
 
In your 050-functions.lua add this:
Code:
function isInArray(array, value, caseSensitive)
    if(caseSensitive == nil or caseSensitive == false) and type(value) == "string" then
        local lowerValue = value:lower()
        for _, _value in ipairs(array) do
            if type(_value) == "string" and lowerValue == _value:lower() then
                return true
            end
        end
    else
        for _, _value in ipairs(array) do
            if (value == _value) then return true end
        end
    end

    return false
end

Then restart the server.
 
Thanks @Limos for the code and @WibbenZ for the explanation! .. WORKED!

i have a secondary error:

Code:
[Error - GlobalEvents::think] Couldn't execute event: MagicEffect8

[Error - GlobalEvent Interface]
data/globalevents/scripts/placa8.lua:onThink
Description:
data/globalevents/scripts/placa8.lua:8: attempt to call global 'getThingFromPos' (a nil value)
stack traceback:
        data/globalevents/scripts/placa8.lua:8: in function <data/globalevents/scripts/placa8.lua:5>
 
@Limos , worked, thank you i love u to muchhhhhh <33

Problem solved. U should put a "donate botton" for u Limos.. people for sure would donate some time XDDDDDD

Edit: for people that dont know, compat.lua = data/lib/100-compat.lua
 
Last edited:
I have a question. Limos, why does these errors occur when you move to Linux? I am going soon to get a Linux host. :P
 
I have a question. Limos, why does these errors occur when you move to Linux? I am going soon to get a Linux host. :p
Which errors? The errors 1268995 posted is because the datapack was ment for a different server version, so some lib things aren't correct.
 
If you are talking about case sensitivity @Tarek1337 it is because if you write eg. a file name as MyScript.lua but the name is actually myScript.lua linux will say it can't find it while windows seraching for lower and upper cases etc till it finds the file.
About the error he listed it is most likely because the file isen't named properly, eg. Compat.lua insted of compat.lua, but it should throw an error in that case.

Windows does not serach deeper in function names, neither does linux so it would be the same about the compat function Limos wrote about.
One of the worst things with 0.x series is the function names, like doPlayerAddItem, getCreatureHealth, getPlayerMana etc etc

It's alot simpler now with Creature:getHealth(), Player:getHealth() etc
 
Haha, :p In my whole life i have been using 0.x series. Until i switched to 1.2 so i am still learning all the new functions. I am used to 0.x :P
 

Similar threads

Back
Top