4

回帖

295

金币

162

积分

积分
162
发表于 2023-9-3 18:08:05 | 显示全部楼层 |阅读模式

马上注册,下载996引擎,与更多游戏开发者交流。

您需要 登录 才可以下载或查看,没有账号?注册

×
如题,996 到底给了多少个lua事件变量可以给我们使用呢??直接把下面的代码放到可以执行的地方

local function writeFile(fileName, content)
        local f = assert(io.open(fileName, 'w+'))
        f:write(content)
        f:close()
    end

    local guinew = {}

    -- 转换为 JSON 格式的字符串
    local function tableToJson(tbl)
        guinew[tbl] = tbl
        local jsonString = "{"
        local isFirst = true
        if tbl == nil then return '{}' end
        for key, value in pairs(tbl) do
            if string.find(key,'LUA_EVENT') ~= nil  then
                if not isFirst then
                    jsonString = jsonString .. ","
                else
                    isFirst = false
                end
                jsonString = jsonString .. '"' .. key .. '":'
                jsonString = jsonString .. '"' .. tostring(value) .. '"'
            end
        end
        jsonString = jsonString .. "}"
        return jsonString
    end

    writeFile('aaaaaaaaaaaaaaaaa.json', tableToJson(_G))



回复

使用道具 举报

4

回帖

295

金币

162

积分

积分
162
 楼主| 发表于 2023-9-3 18:08:31 | 显示全部楼层
{
    "LUA_EVENT_SKILL_ADD": "LUA_EVENT_SKILL_ADD",
    "LUA_EVENT_PLAYER_ACTION_COMPLETE": "LUA_EVENT_PLAYER_ACTION_COMPLETE",
    "LUA_EVENT_HPMPCHANGE": "LUA_EVENT_HPMPCHANGE",
    "LUA_EVENT_RESPONSE_GUILD_CREATE_COST": "LUA_EVENT_RESPONSE_GUILD_CREATE_COST",
    "LUA_EVENT_ADDFIREND": "LUA_EVENT_ADDFIREND",
    "LUA_EVENT_HERO_ANGER_CAHNGE": "LUA_EVENT_HERO_ANGER_CAHNGE",
    "LUA_EVENT_NET_PLAYER_ACTION_BEGIN": "LUA_EVENT_NET_PLAYER_ACTION_BEGIN",
    "LUA_EVENT_RANK_SELECT_COLLECT": "LUA_EVENT_RANK_SELECT_COLLECT",
    "LUA_EVENT_GUILD_MEMBER_RANK_REFRESH": "LUA_EVENT_GUILD_MEMBER_RANK_REFRESH",
    "LUA_EVENT_EQUIP_STATE_CHANGE_HERO": "LUA_EVENT_EQUIP_STATE_CHANGE_HERO",
    "LUA_EVENT_TAKE_OFF_EQUIP": "LUA_EVENT_TAKE_OFF_EQUIP",
    "LUA_EVENT_NPC_STORAGE_UPDATE": "LUA_EVENT_NPC_STORAGE_UPDATE",
    "LUA_EVENT_HERO_BAG_ITEM_CAHNGE": "LUA_EVENT_HERO_BAG_ITEM_CAHNGE",
    "LUA_EVENT_DELETE_ROLE_STATE": "LUA_EVENT_DELETE_ROLE_STATE",
    "LUA_EVENT_PLAYER_ACTION_BEGIN": "LUA_EVENT_PLAYER_ACTION_BEGIN",
    "LUA_EVENT_RESPONSE_APPLY_LIST": "LUA_EVENT_RESPONSE_APPLY_LIST",
    "LUA_EVENT_EXPCHANGE": "LUA_EVENT_EXPCHANGE",
    "LUA_EVENT_ITEM_MOVING": "LUA_EVENT_ITEM_MOVING",
    "LUA_EVENT_AUTOPICKEND": "LUA_EVENT_AUTOPICKEND",
    "LUA_EVENT_MONEYCHANGE": "LUA_EVENT_MONEYCHANGE",
    "LUA_EVENT_ITEM_POS_CHANGE": "LUA_EVENT_ITEM_POS_CHANGE",
    "LUA_EVENT_CLOSEWIN": "LUA_EVENT_CLOSEWIN",
    "LUA_EVENT_HERO_TAKE_ON_EQUIP": "LUA_EVENT_HERO_TAKE_ON_EQUIP",
    "LUA_EVENT_EQUIP_STATE_CHANGE": "LUA_EVENT_EQUIP_STATE_CHANGE",
    "LUA_EVENT_MAP_STATE_CHANGE": "LUA_EVENT_MAP_STATE_CHANGE",
    "LUA_EVENT_HERO_ITEM_POS_CHANGE": "LUA_EVENT_HERO_ITEM_POS_CHANGE",
    "LUA_EVENT_BATTLE_STATE_CHANGE": "LUA_EVENT_BATTLE_STATE_CHANGE",
    "LUA_EVENT_ROLE_PROPERTY_INITED": "LUA_EVENT_ROLE_PROPERTY_INITED",
    "LUA_EVENT_MAIN_PLAYER_REVIVE": "LUA_EVENT_MAIN_PLAYER_REVIVE",
    "LUA_EVENT_MONSTER_ACTION_COMPLETE": "LUA_EVENT_MONSTER_ACTION_COMPLETE",
    "LUA_EVENT_LEAVE_WORLD": "LUA_EVENT_LEAVE_WORLD",
    "LUA_EVENT_BAG_ITEM_CHANGE": "LUA_EVENT_BAG_ITEM_CHANGE",
    "LUA_EVENT_NETCHANGE": "LUA_EVENT_NETCHANGE",
    "LUA_EVENT_SERVER_CUSTOM": "LUA_EVENT_SERVER_CUSTOM",
    "LUA_EVENT_LEAVE_GUILD": "LUA_EVENT_LEAVE_GUILD",
    "LUA_EVENT_SUMMON_ALIVE_CHANGE": "LUA_EVENT_SUMMON_ALIVE_CHANGE",
    "LUA_EVENT_SKILL_INIT": "LUA_EVENT_SKILL_INIT",
    "LUA_EVENT_RESPONSE_GUILD_LIST": "LUA_EVENT_RESPONSE_GUILD_LIST",
    "LUA_EVENT_RESPONSE_GUILD_INFO": "LUA_EVENT_RESPONSE_GUILD_INFO",
    "LUA_EVENT_RESPONSE_ALLY_APPLY_LIST": "LUA_EVENT_RESPONSE_ALLY_APPLY_LIST",
    "LUA_EVENT_TEST2": "LUA_EVENT_TEST2",
    "LUA_EVENT_TEST1": "LUA_EVENT_TEST1",
    "LUA_EVENT_CLICK_FLOOR": "LUA_EVENT_CLICK_FLOOR",
    "LUA_EVENT_MAINBUFFUPDATE": "LUA_EVENT_MAINBUFFUPDATE",
    "LUA_EVENT_GUILD_INFO_CHANGE": "LUA_EVENT_GUILD_INFO_CHANGE",
    "LUA_EVENT_GUILD_MEMBER_REFRESH": "LUA_EVENT_GUILD_MEMBER_REFRESH",
    "LUA_EVENT_DARK_STATE_CHANGE": "LUA_EVENT_DARK_STATE_CHANGE",
    "LUA_EVENT_RANK_UPDATE_MODEL": "LUA_EVENT_RANK_UPDATE_MODEL",
    "LUA_EVENT_RANK_UPDATE": "LUA_EVENT_RANK_UPDATE",
    "LUA_EVENT_EMBATTLE_CHANGE": "LUA_EVENT_EMBATTLE_CHANGE",
    "LUA_EVENT_PLAYER_BEHAVIOR_STATE_CAHNGE": "LUA_EVENT_PLAYER_BEHAVIOR_STATE_CAHNGE",
    "LUA_EVENT_BEST_RING_BOX_STATE": "LUA_EVENT_BEST_RING_BOX_STATE",
    "LUA_EVENT_PLAYER_EQUIP_CHANGE": "LUA_EVENT_PLAYER_EQUIP_CHANGE",
    "LUA_EVENT_ENTER_WORLD": "LUA_EVENT_ENTER_WORLD",
    "LUA_EVENT_MINI_MAP_CLICK": "LUA_EVENT_MINI_MAP_CLICK",
    "LUA_EVENT_SKILL_DELETE_KEY": "LUA_EVENT_SKILL_DELETE_KEY",
    "LUA_EVENT_SKILL_CHANGE_KEY": "LUA_EVENT_SKILL_CHANGE_KEY",
    "LUA_EVENT_DEVICE_ROTATION_CHANGED": "LUA_EVENT_DEVICE_ROTATION_CHANGED",
    "LUA_EVENT_SKILL_UPDATE": "LUA_EVENT_SKILL_UPDATE",
    "LUA_EVENT_SETTING_CAHNGE": "LUA_EVENT_SETTING_CAHNGE",
    "LUA_EVENT_MONSTER_ACTION_BEGIN": "LUA_EVENT_MONSTER_ACTION_BEGIN",
    "LUA_EVENT_NET_PLAYER_ACTION_COMPLETE": "LUA_EVENT_NET_PLAYER_ACTION_COMPLETE",
    "LUA_EVENT_TARGET_CAHNGE": "LUA_EVENT_TARGET_CAHNGE",
    "LUA_EVENT_PLAYER_OUT_OF_VIEW": "LUA_EVENT_PLAYER_OUT_OF_VIEW",
    "LUA_EVENT_PLAYER_IN_OF_VIEW": "LUA_EVENT_PLAYER_IN_OF_VIEW",
    "LUA_EVENT_NPC_STORAGE_PUTOUT_FAIL": "LUA_EVENT_NPC_STORAGE_PUTOUT_FAIL",
    "LUA_EVENT_SKILL_DEL": "LUA_EVENT_SKILL_DEL",
    "LUA_EVENT_TASK_CHANGE": "LUA_EVENT_TASK_CHANGE",
    "LUA_EVENT_HERO_TAKE_OFF_EQUIP": "LUA_EVENT_HERO_TAKE_OFF_EQUIP",
    "LUA_EVENT_HERO_EQUIP_CHANGE": "LUA_EVENT_HERO_EQUIP_CHANGE",
    "LUA_EVENT_ITEM_MOVE_END": "LUA_EVENT_ITEM_MOVE_END",
    "LUA_EVENT_REF_ITEM_LIST": "LUA_EVENT_REF_ITEM_LIST",
    "LUA_EVENT_JOINTEAM": "LUA_EVENT_JOINTEAM",
    "LUA_EVENT_REMFIREND": "LUA_EVENT_REMFIREND",
    "LUA_EVENT_MAPINFOINIT": "LUA_EVENT_MAPINFOINIT",
    "LUA_EVENT_MAPINFOCHANGE": "LUA_EVENT_MAPINFOCHANGE",
    "LUA_EVENT_AUTOMOVEEND": "LUA_EVENT_AUTOMOVEEND",
    "LUA_EVENT_PETPKMODECHANGE": "LUA_EVENT_PETPKMODECHANGE",
    "LUA_EVENT_TALKTONPC": "LUA_EVENT_TALKTONPC",
    "LUA_EVENT_AUTOPICKBEGIN": "LUA_EVENT_AUTOPICKBEGIN",
    "LUA_EVENT_AUTOMOVEBEGIN": "LUA_EVENT_AUTOMOVEBEGIN",
    "LUA_EVENT_AFKBEGIN": "LUA_EVENT_AFKBEGIN",
    "LUA_EVENT_AFKEND": "LUA_EVENT_AFKEND",
    "LUA_EVENT_PKMODECHANGE": "LUA_EVENT_PKMODECHANGE",
    "LUA_EVENT_REFBASEATTR": "LUA_EVENT_REFBASEATTR",
    "LUA_EVENT_BATTERYCHANGE": "LUA_EVENT_BATTERYCHANGE",
    "LUA_EVENT_REF_HERO_ITEM_LIST": "LUA_EVENT_REF_HERO_ITEM_LIST",
    "LUA_EVENT_ROLE_PROPERTY_CHANGE": "LUA_EVENT_ROLE_PROPERTY_CHANGE",
    "LUA_EVENT_SUMMON_MODE_CHANGE": "LUA_EVENT_SUMMON_MODE_CHANGE",
    "LUA_EVENT_TARGET_HP_CHANGE": "LUA_EVENT_TARGET_HP_CHANGE",
    "LUA_EVENT_LEAVETEAM": "LUA_EVENT_LEAVETEAM",
    "LUA_EVENT_RECONNECT": "LUA_EVENT_RECONNECT",
    "LUA_EVENT_BUFFUPDATE": "LUA_EVENT_BUFFUPDATE",
    "LUA_EVENT_WINDOW_CHANGE": "LUA_EVENT_WINDOW_CHANGE",
    "LUA_EVENT_LEVELCHANGE": "LUA_EVENT_LEVELCHANGE",
    "LUA_EVENT_DISCONNECT": "LUA_EVENT_DISCONNECT",
    "LUA_EVENT_CHANGESCENE": "LUA_EVENT_CHANGESCENE",
    "LUA_EVENT_ACTOR_OWNER_CHANGE": "LUA_EVENT_ACTOR_OWNER_CHANGE",
    "LUA_EVENT_JOIN_GUILD": "LUA_EVENT_JOIN_GUILD",
    "LUA_EVENT_TAKE_ON_EQUIP": "LUA_EVENT_TAKE_ON_EQUIP",
    "LUA_EVENT_MAIN_PLAYER_DIE": "LUA_EVENT_MAIN_PLAYER_DIE"
}
回复

使用道具 举报

4

回帖

295

金币

162

积分

积分
162
 楼主| 发表于 2023-9-3 18:09:24 | 显示全部楼层
上面就是所有的lua的996引擎提供的事件了。   哈哈。你们用到了哪些??  能给个注释吗??
回复

使用道具 举报