Ir para conteúdo

Featured Replies

Postado

Pessoal estou com um problema no autoloot que eu adicionei no meu server. Se alguém puder por favor me ajude, estarei disponibilizando algumas prints a baixo. Como vc podem ver, quando eu uso o comando !autoloot ele aparece todas as informações normal, não da nenhum bug quando eu uso os comandos "!autoloot, !autoloot add, !autoloot gold, !autoloot power"

Mas quando eu mato um mob da um erro e o dinheiro do comando "!autoloot gold" não vai para o banco, também da erro quando eu uso o comando !autoloot goldinfo. Enfim, basicamente o sistema não está coletando nada

 

PS: Não sei se esse post esta no local correto. Se não estiver por favor movam! att

 

O sistema que eu usei foi um que o Jnetworks postou. 

 

As prints:

 

2097873497_print1.thumb.png.bc5f795a37ab8d6fa72db934166faddb.png2069684559_print2.thumb.png.55bf5059511630c1688f9668ed42abd7.png1041351471_print3.thumb.png.dc5a0b63cddf4de0dda21917ec0b8c66.png

 

Quando eu uso os comandos n da erro.

1922808069_print4.thumb.png.b81ccdba326916fe34fee33ed32c9a43.png

 

Quando eu mato um mob com os comandos ativo da esse erro 

1418192207_print5.thumb.png.d2c088baa93e5c03e838e9e24ebd5672.png1497841969_print6.thumb.png.155701225b8f6531d8552795eaf5521e.png

 

 

Editado por nizin (veja o histórico de edições)

Postado

O 3° erro talvez seja resolvido com essa libs 

 

 

Ja os dois primeiro a função,

getContainerItemsInfo(getThingFromPos(position).uid)

ta retornando nil, provavelmente ele não ta encontrando a uid por algum motivo, pesquisei rapidamente e alguns que vi falaram sobre loot dentro de bag. De qualquer forma autoloot por lua é bem chato...

  • 2 weeks later...
Postado

O meu também estava dando estes problemas...achei estas functions do Killua, inclusive já estão as funcóes com storage de tabelas...

 

Vá na pasta data/lib e no arquivo 050-function.lua cole o seguinte código

 


-- Functions library created by Vitor Bertolucci (Killua)
-- Functions used to store tables in storages
 
killua_functions = {
 
    filtrateString = function(str) -- By Killua
        local tb, x, old, last = {}, 0, 0, 0
        local first, second, final = 0, 0, 0
        if type(str) ~= "string" then
            return tb
        end
        for i = 2, #str-1 do
            if string.byte(str:sub(i,i)) == string.byte(':') then
                x, second, last = x+1, i-1, i+2
                for t = last,#str-1 do
                    if string.byte(str:sub(t,t)) == string.byte(',') then
                        first = x == 1 and 2 or old
                        old, final = t+2, t-1
                        local index, var = str:sub(first,second), str:sub(last,final)
                        tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var)
                        break
                    end
                end
            end
        end
        return tb
    end,
 
    translateIntoString = function(tb) -- By Killua
        local str = ""
        if type(tb) ~= "table" then
            return str
        end
        for i, t in pairs(tb) do
            str = str..i..": "..t..", "
        end
        str = "a"..str.."a"
        return tostring(str)
    end
}


function getContainerItemsInfo(containerUid) -- By Killua
    local table = {}
    if containerUid and containerUid > 0 then
        local a = 0
        for i = 0, getContainerSize(containerUid) do
            local item = getContainerItem(containerUid,i)
            a = a + 1
            table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type}
        end
        return table
    end
    return false
end

function countTable(table) -- By Killua
    local y = 0
    if type(table) == "table" then
        for _ in pairs(table) do
            y = y + 1
        end
        return y
    end
    return false
end
 
function setPlayerTableStorage(cid, key, value)
    return doPlayerSetStorageValue(cid, key, killua_functions.translateIntoString(value))
end
 
function getPlayerTableStorage(cid, key)
    return killua_functions.filtrateString(getPlayerStorageValue(cid, key))
end
 
function setGlobalTableStorage(key, value)
    return setGlobalStorageValue(key, killua_functions.translateIntoString(value))
end
 
function getGlobalTableStorage(key)
    return killua_functions.filtrateString(getGlobalStorageValue(key))
end
 
 
 function getPlayerStorageZero(cid, storage)
    local sto = getPlayerStorageValue(cid, storage)
    return sto > 0 and sto or 0
end

Os créditos do Killua estão no inicio do código.

Postado
  • Autor
2 horas atrás, Augusto disse:

O meu também estava dando estes problemas...achei estas functions do Killua, inclusive já estão as funcóes com storage de tabelas...

 

Vá na pasta data/lib e no arquivo 050-function.lua cole o seguinte código

 



-- Functions library created by Vitor Bertolucci (Killua)
-- Functions used to store tables in storages
 
killua_functions = {
 
    filtrateString = function(str) -- By Killua
        local tb, x, old, last = {}, 0, 0, 0
        local first, second, final = 0, 0, 0
        if type(str) ~= "string" then
            return tb
        end
        for i = 2, #str-1 do
            if string.byte(str:sub(i,i)) == string.byte(':') then
                x, second, last = x+1, i-1, i+2
                for t = last,#str-1 do
                    if string.byte(str:sub(t,t)) == string.byte(',') then
                        first = x == 1 and 2 or old
                        old, final = t+2, t-1
                        local index, var = str:sub(first,second), str:sub(last,final)
                        tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var)
                        break
                    end
                end
            end
        end
        return tb
    end,
 
    translateIntoString = function(tb) -- By Killua
        local str = ""
        if type(tb) ~= "table" then
            return str
        end
        for i, t in pairs(tb) do
            str = str..i..": "..t..", "
        end
        str = "a"..str.."a"
        return tostring(str)
    end
}


function getContainerItemsInfo(containerUid) -- By Killua
    local table = {}
    if containerUid and containerUid > 0 then
        local a = 0
        for i = 0, getContainerSize(containerUid) do
            local item = getContainerItem(containerUid,i)
            a = a + 1
            table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type}
        end
        return table
    end
    return false
end

function countTable(table) -- By Killua
    local y = 0
    if type(table) == "table" then
        for _ in pairs(table) do
            y = y + 1
        end
        return y
    end
    return false
end
 
function setPlayerTableStorage(cid, key, value)
    return doPlayerSetStorageValue(cid, key, killua_functions.translateIntoString(value))
end
 
function getPlayerTableStorage(cid, key)
    return killua_functions.filtrateString(getPlayerStorageValue(cid, key))
end
 
function setGlobalTableStorage(key, value)
    return setGlobalStorageValue(key, killua_functions.translateIntoString(value))
end
 
function getGlobalTableStorage(key)
    return killua_functions.filtrateString(getGlobalStorageValue(key))
end
 
 
 function getPlayerStorageZero(cid, storage)
    local sto = getPlayerStorageValue(cid, storage)
    return sto > 0 and sto or 0
end

Os créditos do Killua estão no inicio do código.

Funcionou PERFEITAMENTE! Obrigado meu querido. <3 rep+

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo