Auto-Loot System Automatico! Help

Luga03
Por Luga03
em Scripts
  • 1
  • 2

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Eae pessoa, estou precisando de um sistema de auto-loot, que ao usar o comando "/autoloot on", todo corpose que ele clicar, vai pegar todos os itens dentro, e se ele usar "/autoloot off" esta função para! o Gabrielbsales, postou este sistema, mas ele precisa colocar corpose por corpose, ai queria que fosse automático help plx

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Poderia postar o link deste sistema que você citou (do Gabrielbsales)?

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

aqui: http://www.xtibia.com/forum/topic/233245-pda-autoloot-igual-pxg/

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Talkaction:

function onSay(cid, words, param)
    if param == "" then
        return doPlayerSendCancel(cid, "/autoloot on/off")
    end
    local value = param:lower() == "on" and 1 or param:lower() == "off" and -1 or false
    if not value then
        return doPlayerSendCancel(cid, "/autoloot on/off")
    elseif getPlayerStorageValue(cid, 4919) == value then
        return doPlayerSendCancel(cid, "Your autoloot is already "..param..".")
    end
    setPlayerStorageValue(cid, 4919, value)
    doPlayerSendTextMessage(cid, 27, "Your autoloot is now "..param..".")
    return true
end
Tag da action:
<action actionid="9282" event="script" value="Autoloot.lua"/>
Novo código da action:
--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS
function onUse(cid, item, frompos, item2, topos)
    if getItemAttribute(item.uid, "corpseowner") ~= cid then
        doPlayerSendCancel(cid, "You're not the owner.")
        return true
    end
    if getPlayerStorageValue(cid, 4919) < 1 then
        return false
    else
        local items = {}
        for x=0, (getContainerSize(item.uid)) do
            local itens = getContainerItem(item.uid, x)
            --if isInArray(toloot, itens.itemid) then
            table.insert(items, {i=itens.itemid, q=itens.type})
            doRemoveItem(itens.uid)
            --break
            --end
        end
        for y=1, #items do
            doPlayerAddItemStacking(cid, items[y].i, items[y].q)
            doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
        end
        if #items > 0 then
            return true
        else
            return false
        end
    end
end
--[[
AUTO LOOT BY GABRIEL SALES
SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--).
--]]
Se a base de seu servidor for PDA:
Em data/creaturescripts/scripts, pokeexp.lua:
Abaixo de:
function onDeath(cid, corpse, deathList)
coloque:
doItemSetAttribute(corpse.uid, "aid", 9282)
Se a base do seu servidor não for PDA, avise.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Eu uso a source do Poke Dash V9, que não é PDA, mas um cara editou a base e tentou chegar bem perto do PDA, mas ele n conseguio, estou usando de base a Poke Dash Advanced 2015 Open Source Pelo Nextbr


está dando este erro:

 

[18/06/2015 08:23:01] [Error - Action Interface]
[18/06/2015 08:23:01] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 08:23:01] Description:
[18/06/2015 08:23:01] data/actions/scripts/Autoloot.lua:20: attempt to call global 'doPlayerAddItemStacking' (a nil value)
[18/06/2015 08:23:01] stack traceback:
[18/06/2015 08:23:01] data/actions/scripts/Autoloot.lua:20: in function <data/actions/scripts/Autoloot.lua:2>
ai eu removi esta função, ai agora está aparecendo a mensagem no default do player que deu autolooted no item, e na distro deu este erro:
[18/06/2015 08:29:37] [Error - Action Interface]
[18/06/2015 08:29:37] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 08:29:37] Description:
[18/06/2015 08:29:37] (luaDoRemoveItem) Item not found
[18/06/2015 08:29:37] [Error - Action Interface]
[18/06/2015 08:29:37] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 08:29:37] Description:
[18/06/2015 08:29:37] data/lib/050-function.lua:239: attempt to index a boolean value
[18/06/2015 08:29:37] stack traceback:
[18/06/2015 08:29:37] data/lib/050-function.lua:239: in function 'getItemNameById'
[18/06/2015 08:29:37] data/actions/scripts/Autoloot.lua:21: in function <data/actions/scripts/Autoloot.lua:2>

 

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Se você não colocar a função doPlayerAddItemStacking na lib, como indicado no tópico do sistema, é claro que não vai funcionar.

Também troque esta linha:

 

local itens = getContainerItem(item.uid, x)

por:

 

local itens = getContainerItem(item.uid, 0)

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

 

Se você não colocar a função doPlayerAddItemStacking na lib, como indicado no tópico do sistema, é claro que não vai funcionar.

Também troque esta linha:

local itens = getContainerItem(item.uid, x)

por:

local itens = getContainerItem(item.uid, 0)

eu n sei colocar esta função na lib, n tenho o código dela ¬¬

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

Bruno

Ousadia e Alegria
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 01/05/08Posts: 2571Gênero: Masculino

eu n sei colocar esta função na lib, n tenho o código dela ¬¬

Amigo, ele quis fizer no script.

 

Ficando assim:

--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS
function onUse(cid, item, frompos, item2, topos)
    if getItemAttribute(item.uid, "corpseowner") ~= cid then
        doPlayerSendCancel(cid, "You're not the owner.")
        return true
    end
    if getPlayerStorageValue(cid, 4919) < 1 then
        return false
    else
        local items = {}
        for x=0, (getContainerSize(item.uid)) do
            local itens = getContainerItem(item.uid, 0)
            --if isInArray(toloot, itens.itemid) then
            table.insert(items, {i=itens.itemid, q=itens.type})
            doRemoveItem(itens.uid)
            --break
            --end
        end
        for y=1, #items do
            doPlayerAddItemStacking(cid, items[y].i, items[y].q)
            doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
        end
        if #items > 0 then
            return true
        else
            return false
        end
    end
end
--[[
AUTO LOOT BY GABRIEL SALES
SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--).
--]]

Atenciosamente,
Bruno Minervino

 

Tibia Clients - Downloads Window

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

agora está apenas sumindo o item e dando este erro:

 

[18/06/2015 16:42:32] [Error - Action Interface]
[18/06/2015 16:42:32] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 16:42:32] Description:
[18/06/2015 16:42:32] (luaDoRemoveItem) Item not found
[18/06/2015 16:42:32] [Error - Action Interface]
[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 16:42:33] Description:
[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:20: attempt to call global 'doPlayerAddItemStacking' (a nil value)
[18/06/2015 16:42:33] stack traceback:
[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:20: in function <data/actions/scripts/Autoloot.lua:2>

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

Bruno

Ousadia e Alegria
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 01/05/08Posts: 2571Gênero: Masculino

agora está apenas sumindo o item e dando este erro:

 

[18/06/2015 16:42:32] [Error - Action Interface]

[18/06/2015 16:42:32] data/actions/scripts/Autoloot.lua:onUse

[18/06/2015 16:42:32] Description:

[18/06/2015 16:42:32] (luaDoRemoveItem) Item not found

 

[18/06/2015 16:42:32] [Error - Action Interface]

[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:onUse

[18/06/2015 16:42:33] Description:

[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:20: attempt to call global 'doPlayerAddItemStacking' (a nil value)

[18/06/2015 16:42:33] stack traceback:

[18/06/2015 16:42:33] data/actions/scripts/Autoloot.lua:20: in function <data/actions/scripts/Autoloot.lua:2>

Tenta assim:

 

--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS
function onUse(cid, item, frompos, item2, topos)
    if getItemAttribute(item.uid, "corpseowner") ~= cid then
        doPlayerSendCancel(cid, "You're not the owner.")
        return true
    end
    if getPlayerStorageValue(cid, 4919) < 1 then
        return false
    else
        local items = {}
        for x=0, (getContainerSize(item.uid)) do
            local itens = getContainerItem(item.uid, 0)
            --if isInArray(toloot, itens.itemid) then
            table.insert(items, {i=itens.itemid, q=itens.type})
            doRemoveItem(itens.uid)
            --break
            --end
        end
        if #items > 0 then
			for _, y in pairs(items) do
				doPlayerAddItemStacking(cid, items[y].i, items[y].q)
				doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
			end
            return true
        else
            return false
        end
    end
end
--[[
AUTO LOOT BY GABRIEL SALES
SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--).
--]]

 

Atenciosamente,
Bruno Minervino

 

Tibia Clients - Downloads Window

damiaotorres

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/11/11Posts: 93Char no Tibia: Deprex

Tem como fazer pra tibia 8.6 tfs 0.1.0?

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Tenta assim:

 

 

--local toloot = {11441, 11441, 11443, 11444, 11445, 11446, 11447, 11448, 11449,11450, 11451, 11452, 11453, 11454, 12618, 12232, 12244} -- PREFERENCIAL - SE QUISER APENAS COM ALGUNS ITENS
function onUse(cid, item, frompos, item2, topos)
    if getItemAttribute(item.uid, "corpseowner") ~= cid then
        doPlayerSendCancel(cid, "You're not the owner.")
        return true
    end
    if getPlayerStorageValue(cid, 4919) < 1 then
        return false
    else
        local items = {}
        for x=0, (getContainerSize(item.uid)) do
            local itens = getContainerItem(item.uid, 0)
            --if isInArray(toloot, itens.itemid) then
            table.insert(items, {i=itens.itemid, q=itens.type})
            doRemoveItem(itens.uid)
            --break
            --end
        end
        if #items > 0 then
			for _, y in pairs(items) do
				doPlayerAddItemStacking(cid, items[y].i, items[y].q)
				doPlayerSendTextMessage(cid, 20, "Looted "..items[y].q.."x "..getItemNameById(items[y].i)..".")
			end
            return true
        else
            return false
        end
    end
end
--[[
AUTO LOOT BY GABRIEL SALES
SE QUISER ATIVAR O AUTOLOOT APENAS PARA ALGUNS ITENS, ADICIONE OS IDS NA TABELA toloot E TIRE OS COMENTÁRIOS(--).
--]]

 

 

[18/06/2015 18:25:05] [Error - Action Interface]

[18/06/2015 18:25:05] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 18:25:05] Description:
[18/06/2015 18:25:05] (luaDoRemoveItem) Item not found
[18/06/2015 18:25:05] [Error - Action Interface]
[18/06/2015 18:25:05] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 18:25:05] Description:
[18/06/2015 18:25:05] data/actions/scripts/Autoloot.lua:21: attempt to index field '?' (a nil value)
[18/06/2015 18:25:05] stack traceback:
[18/06/2015 18:25:05] data/actions/scripts/Autoloot.lua:21: in function <data/actions/scripts/Autoloot.lua:2>

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Zet0N0Murmurouu, suponho que você não tenha lido o conteúdo do tópico que você mesmo enviou (do autoloot escrito pelo Gabrielbsales). Nele, o autor posta o código da função doPlayerAddItemStacking.

function doPlayerAddItemStacking(cid, itemid, quant) 
    local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid)
    local piles = 0
    if #item > 0 then
        for i,x in pairs(item) do
            if getThing(x).type < 100 then
                local it = getThing(x)
                doTransformItem(it.uid, itemid, it.type+quant)
                if it.type+quant > 100 then
                    doPlayerAddItem(cid, itemid, it.type+quant-100)
                end
            else
                piles = piles+1
            end
            break
        end
    else
        return doPlayerAddItem(cid, itemid, quant)
    end
    if piles == #item then
        doPlayerAddItem(cid, itemid, quant)
    end
end

Coloque este código em algum arquivo da lib e depois utilize os scripts que enviei anteriormente.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Luga03

Gabriel Lucena :D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/04/15Posts: 956Gênero: Masculino

Não tinha visto ._. malz aew, vo ter aq ´q pq eu sabia que ele tinha postado, ai peguei o primeiro link o sistema dele que achei e mande ^^ vo testar aq


está funcionando! mas ao clicar no corpose do pokémon da este erro:

 

[18/06/2015 19:04:52] [Error - Action Interface]
[18/06/2015 19:04:52] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 19:04:52] Description:
[18/06/2015 19:04:52] (luaDoRemoveItem) Item not found
[18/06/2015 19:04:52] [Error - Action Interface]
[18/06/2015 19:04:52] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 19:04:52] Description:
[18/06/2015 19:04:52] (luaDoPlayerAddItem) Item not found
[18/06/2015 19:04:52] [Error - Action Interface]
[18/06/2015 19:04:52] data/actions/scripts/Autoloot.lua:onUse
[18/06/2015 19:04:52] Description:
[18/06/2015 19:04:52] data/lib/050-function.lua:239: attempt to index a boolean value
[18/06/2015 19:04:52] stack traceback:
[18/06/2015 19:04:52] data/lib/050-function.lua:239: in function 'getItemNameById'
[18/06/2015 19:04:52] data/actions/scripts/Autoloot.lua:21: in function <data/actions/scripts/Autoloot.lua:2>

Hello! How are you? It's fine? 

 

Okay, so you like my helps? if yes, then do you can like my post, give-me a reputation, you can't?

 

Good morning for everyone! And have a good day!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Algum item, ao mínimo, é coletado pelo jogador?

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

  • 1
  • 2