• 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 [TFS 1.2] !commands full list of commands from talkactions.xml

Shadow Dan

Sh4dowDan
Joined
Jun 5, 2010
Messages
344
Reaction score
88
Location
Poland
Very useful command that shows you list of possible commands.
I didn't found a single script working with new TFS versions.
This type of coding is too hard for me for now. Could be nice if anyone have any ideas how to upgrade this script.


Old code from TFS with tibia version 8.6
Code:
local config = {
    ingameGuilds = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}

function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 555, 5)) then
    return true
end
    local playerAccess, t = getPlayerAccess(cid), {}
    for i, talk in ipairs(getTalkActionList()) do
        if(not talk.hidden and playerAccess >= talk.access) then
            if(config.ingameGuilds or (talk.functionName ~= "guildjoin" and talk.functionName ~= "guildcreate")) then
                table.insert(t, talk)
            end
        end
    end

    table.sort(t, function(a, b) return a.access > b.access end)
    local lastAccess, str = -1, ""
    for i, talk in ipairs(t) do
        local line = ""
        if(lastAccess ~= talk.access) then
            if(i ~= 1) then
                line = "\n"
            end
            lastAccess = talk.access
        end
        str = str .. line .. talk.words .. "\n"
    end

    doShowTextDialog(cid, 2160, str)
    return true
end
 
Solution
Xeraphus how to use this function?
I give it a try and there was an empty result.
put this function in your lib
https://otland.net/threads/getfilekeywords-file-keywords-requireall.247695/
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    local list = getFileKeywords([[data\talkations\talkactions.xml]], {{keyword= 'words', index = 'words'}})
    local t = {}
    for i = 1, #list do
        table.insert(t, list[i].words)
    end
    doShowTextDialog(player:getId(), 1950, table.concat(t, '\n'))
    return true
end
Back
Top