• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Eluna Error

Status
Not open for further replies.

Neccta

Exalted Member
Code:
[Eluna]: Ending event 18, stack top was 4 and was supposed to be 2. Report to devs
I'm don't know what this means at all. :eek:
I know event 18 is PLAYER_EVENT_ON_CHAT, and I do have a worldchat script, but I'm not to sure what "stack top" is.

Edit: I spoke to soon, I figured it out. Sorry for the useless post.
 
Last edited:

Tommy

Founder
No problem. Also, just to point out, there's other event Ids 18. Just for future clarification, it could've been referring to something else besides a player event.
 
Last edited:

Rochet2

Moderator / Eluna Dev
EDIT:

It is possible that this was fixed recently and (even though this is just a notice) will go away when updating eluna.
I just now also added the type of the event (for example ServerEvent) to the error messages for better error reports.

It is very important (for me personally at least) to get rid of these notices.

If you can, provide:
Eluna commit
the lua scripts with event 18 in use
 
Last edited:

Zero

Noble Member
Registered to provide some feedback, since I absolutely love using Lua alongside TrinityCore.

This message only seems to appear when two separate events are registered or being used which both use chat hooks. I've managed to work around this so far by combining all my scripts that use RegisterPlayerEvent(18, function) into one .lua file.

You can register multiple functions using PLAYER_EVENT_ON_CHAT, and eluna will reload without any errors/notifications (assume there's no errors) but when anyone sends a message in game the error will appear in the console for each message sent.
 

Zero

Noble Member
Updated to the new revision, still the same.

Using two separate registered chat hooks in two separate lua files:
'Ending event 18 for PlayerEvents, stack top was 4 and was supposed to be between 0 and 2. Report to devs'

Apart from the console report, the scripts seem to work side by side without any other problems.

Using three separate registered chat hooks in three separate lua files, console reports;
'Event ending in 18 for PlayerEvents, stack top was 6 and was supposed to be between 0 and 2. Report to devs'

Yet all 3 unique hooks work, and so do their respective functions.
 

dsy86

Enthusiast
I have the same problem. When using the chat type value, the error message "blabla stacktop ..." came out. If not, it works well and no error message.
Code:
function ChatSystem(event, player, msg, chattype, lang)
	if(chattype == 1 or 17) then  --if trying to use chattype value, error message comes out
		...
	end
 

Rochet2

Moderator / Eluna Dev
In case someone was wondering..
The error message was triggered invalidly, there was no real problem initially :)
The error was just a message / notification, so it doesnt stop code from running or anything.
It was triggered when 1 or more player or world or similar non entry bound hooks were used without returning the required amount of arguments back.

It should now be fixed.

I have the same problem. When using the chat type value, the error message "blabla stacktop ..." came out. If not, it works well and no error message.
Code:
function ChatSystem(event, player, msg, chattype, lang)
	if(chattype == 1 or 17) then  --if trying to use chattype value, error message comes out
		...
	end

Hmm ..
Note that this is not probably what you wanted if(chattype == 1 or 17) then
you need to check chattype each time: if(chattype == 1 or chattype == 17) then

On the very latest version the error msg should no longer appear when there is no error, if you do have the newest version, then we need more information.
For example the exact error message and possibly the full script.
 

Neccta

Exalted Member
Updated to the newest version still got:
Code:
 [Eluna]: Ending event 18 for PlayerEvents, stack top was 4 and was supposed to be between 0 and 2. Report to dev

Here is the full code.
Code:
    local ChatPrefix = ",w";
    local WorldChannelName = "World Channel";
    local CooldownTimer = 1; -- Cooldown in seconds. Set to 0 for no CD obviously.
     
    local Class = { -- Class colors :) Prettier and easier than the elseif crap :) THESE ARE HEX COLORS!
            [1] = "FEC1C0", -- Warrior
            [2] = "FEC1C0", -- Paladin
            [3] = "FEC1C0", -- Hunter
            [4] = "FEC1C0", -- Rogue
            [5] = "FEC1C0", -- Priest
            [6] = "FEC1C0", -- Death Knight
            [7] = "FEC1C0", -- Shaman
            [8] = "FEC1C0", -- Mage
            [9] = "FEC1C0", -- Warlock
            [11] = "FEC1C0" -- Druid
    };
     
    local Rank = {
            [0] = "FEC1C0", -- Player
            [1] = "005aff", -- Moderator
            [2] = "005aff", -- Game Master
            [3] = "005aff", -- Admin
            [4] = "FEC1C0" -- Console
    };
     
     -- Do not edit below unless you know what you're doing :)
    if (ChatPrefix:sub(-1) ~= " ") then
            ChatPrefix = ChatPrefix.." ";
    end
     
    local RCD = {};
    function ChatSystem(event, player, msg, _, lang)
            if (RCD[player:GetGUIDLow()] == nil) then
                    RCD[player:GetGUIDLow()] = 0;
            end
            if (msg:sub(1, ChatPrefix:len()) == ChatPrefix) then
                    local r = RCD[player:GetGUIDLow()] - os.clock();
                    if (0 < r and player:GetGMRank() == 0) then
                            local s = string.format("|cFFFF0000You must wait %i second(s) before sending another chat message!|r", math.floor(r));
                            player:SendAreaTriggerMessage(s);
                    else
                            RCD[player:GetGUIDLow()] = os.clock() + CooldownTimer;
                            local t = table.concat({"|cffFEC1C0[", WorldChannelName, "] [|r|cff", Rank[player:GetGMRank()] or Rank[0], "|Hplayer:", player:GetName(), "|h", player:GetName(), "|h|r|cffFEC1C0]: |r|cff", Class[player:GetClass()], msg:sub(ChatPrefix:len()+1), "|r"});
                            SendWorldMessage(t);
                    end
                    return false;
            end
    end
     
    RegisterPlayerEvent(18, ChatSystem);
    RegisterPlayerEvent(4, function(_, player) RCD[player:GetGUIDLow()] = 0; end);
 

Zero

Noble Member
Scripts work regardless of error, to avoid error just bang each separate script in its own subfolder. No more errors :)
 

Rochet2

Moderator / Eluna Dev
to avoid error just bang each separate script in its own subfolder. No more errors :)
This shouldnt be valid due to the way scripts are loaded and handled at all.
But its true that scripts regardless of errors.
Not a reason to ignore the error though.

Edit: fixed again : |
There was a logic fail when function top was decreased on function calls.
 
Last edited:

Foereaper

Founder
This shouldnt be valid due to the way scripts are loaded and handled at all.
But its true that scripts regardless of errors.
Not a reason to ignore the error though.

Edit: fixed again : |
There was a logic fail when function top was decreased on function calls.

Worst dev 2014, after you're done fixing every single error you're fired! For a few hours at least.
 

Rochet2

Moderator / Eluna Dev
Worst dev 2014, after you're done fixing every single error you're fired! For a few hours at least.

Funny thing is that none of this was an actual error : )

Make a new topic if something appears again.
Thanks a lot for the codes and info.
 
Status
Not open for further replies.
Top