Ir para conteúdo
  • Cadastre-se

Normal [PEDIDO] Autoloot gold para TFS 1.2


Posts Recomendados

Bom antes que me critique pois sem que tem vários tópicos sobre autoloot. Peço desculpas pois sou leigo em programação. 

 

Eu preciso de um Script de autoloot apenas para Gold Coin ir direto para o Banco. Porém esse sistema tem que ser ativado por um item e ter duração de 15 dias pois vou colocar para vender no Store.

Mas quero que seja um item que o jogador possa vender pra outros jogadores para girar o comércio do OT.

 

Bom se for possível isso agradeço e dou Rep++ e coloco os creditoseus pelo sistema em meu servidor.

Link para o post
Compartilhar em outros sites
  • 8 months later...
Em 20/06/2017 em 12:30, willks123 disse:

Bom antes que me critique pois sem que tem vários tópicos sobre autoloot. Peço desculpas pois sou leigo em programação. 

 

Eu preciso de um Script de autoloot apenas para Gold Coin ir direto para o Banco. Porém esse sistema tem que ser ativado por um item e ter duração de 15 dias pois vou colocar para vender no Store.

Mas quero que seja um item que o jogador possa vender pra outros jogadores para girar o comércio do OT.

 

Bom se for possível isso agradeço e dou Rep++ e coloco os creditoseus pelo sistema em meu servidor.

 

9 horas atrás, erimyth disse:

up tbm preciso....

 

Trouxe esse script do Printer,

testado e aprovado em TFS 1.x

todo credito de criação do mesmo é dele, segue o script:

 

!autoloot add, itemId or name -- Adding a item to the list
!autoloot remove, itemId or name -- Removing a item from the list
!autoloot show -- Show the autoLoot list
!autoloot clear -- Clears the autoLoot list

Vá em data/global.lua e no final do arquivo cole isso:

 

-- AutoLoot config
    AUTO_LOOT_MAX_ITEMS = 5
 
    -- Reserved storage
    AUTOLOOT_STORAGE_START = 10000
    AUTOLOOT_STORAGE_END = AUTOLOOT_STORAGE_START + AUTO_LOOT_MAX_ITEMS
-- AutoLoot config end

Agora vá em data/talkactions/talkactions.xml e coleque essa tag:

 

<talkaction words="!autoloot" separator=" " script="autoloot.lua"/>

Depois entre em /data/talkactions/scripts e crie um arquivo com o nome autoloot.lua, dentro dele coloque isso:

 

function onSay(player, words, param)
    local split = param:split(",")
 
    local action = split[1]
    if action == "add" then
        local item = split[2]:gsub("%s+", "", 1)
        local itemType = ItemType(item)
        if itemType:getId() == 0 then
            itemType = ItemType(tonumber(item))
            if itemType:getId() == 0 then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.")
                return false
            end
        end
 
        local itemName = tonumber(split[2]) and itemType:getName() or item
        local size = 0
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            local storage = player:getStorageValue(i)
            if size == AUTO_LOOT_MAX_ITEMS then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The list is full, please remove from the list to make some room.")
                break
            end
 
            if storage == itemType:getId() then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." is already in the list.")
                break
            end
 
            if storage <= 0 then
                player:setStorageValue(i, itemType:getId())
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been added to the list.")
                break
            end
 
            size = size + 1
        end
    elseif action == "remove" then
        local item = split[2]:gsub("%s+", "", 1)
        local itemType = ItemType(item)
        if itemType:getId() == 0 then
            itemType = ItemType(tonumber(item))
            if itemType:getId() == 0 then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.")
                return false
            end
        end
 
        local itemName = tonumber(split[2]) and itemType:getName() or item
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            if player:getStorageValue(i) == itemType:getId() then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been removed from the list.")
                player:setStorageValue(i, 0)
                return false
            end
        end
 
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." was not founded in the list.")
    elseif action == "show" then
        local text = "-- Auto Loot List --\n"
        local count = 1
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            local storage = player:getStorageValue(i)
            if storage > 0 then
                text = string.format("%s%d. %s\n", text, count, ItemType(storage):getName())
                count = count + 1
            end
        end
 
        if text == "" then
            text = "Empty"
        end
 
        player:showTextDialog(1950, text, false)
    elseif action == "clear" then
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            player:setStorageValue(i, 0)
        end
 
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The autoloot list has been cleared.")
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use the commands: !autoloot {add, remove, show, clear}")
    end
 
    return false
end

Agora vá em data/creaturescripts/creaturescripts.xml e coloque esta tag dentro:

 

<event type="kill" name="AutoLoot" script="autoloot.lua" />

Depois entra em /data/creaturescripts/scripts e crie um arquivo chamado autoloot.lua, dentro dele coloque isso:

 

local function scanContainer(cid, position)
    local player = Player(cid)
    if not player then
        return
    end
 
    local corpse = Tile(position):getTopDownItem()
    if not corpse or not corpse:isContainer() then
        return
    end
 
    if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then
        for a = corpse:getSize() - 1, 0, -1 do
            local containerItem = corpse:getItem(a)
            if containerItem then
                for b = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
                    if player:getStorageValue(b) == containerItem:getId() then
                        containerItem:moveTo(player)
                    end
                end
            end
        end
    end
end
 
function onKill(player, target)
    if not target:isMonster() then
        return true
    end
 
    addEvent(scanContainer, 100, player:getId(), target:getPosition())
    return true
end

Por fim, não esqueça de registrar o evento dentro do arquivo login.lua que fica na pasta creaturescripts/scripts.

no meu caso (tfs 1.3) ele fica no seguinte caminho: /data/creaturescripts/scripts/others/login.lua

adicione esta tag:

player:registerEvent("AutoLoot")

Creditos 100%: Printer

Editado por TioSlash (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 18/03/2018 em 10:43, TioSlash disse:

 

 

Trouxe esse script do Printer,

testado e aprovado em TFS 1.x

todo credito de criação do mesmo é dele, segue o script:

 


!autoloot add, itemId or name -- Adding a item to the list
!autoloot remove, itemId or name -- Removing a item from the list
!autoloot show -- Show the autoLoot list
!autoloot clear -- Clears the autoLoot list

Vá em data/global.lua e no final do arquivo cole isso:

 


-- AutoLoot config
    AUTO_LOOT_MAX_ITEMS = 5
 
    -- Reserved storage
    AUTOLOOT_STORAGE_START = 10000
    AUTOLOOT_STORAGE_END = AUTOLOOT_STORAGE_START + AUTO_LOOT_MAX_ITEMS
-- AutoLoot config end

Agora vá em data/talkactions/talkactions.xml e coleque essa tag:

 


<talkaction words="!autoloot" separator=" " script="autoloot.lua"/>

Depois entre em /data/talkactions/scripts e crie um arquivo com o nome autoloot.lua, dentro dele coloque isso:

 


function onSay(player, words, param)
    local split = param:split(",")
 
    local action = split[1]
    if action == "add" then
        local item = split[2]:gsub("%s+", "", 1)
        local itemType = ItemType(item)
        if itemType:getId() == 0 then
            itemType = ItemType(tonumber(item))
            if itemType:getId() == 0 then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.")
                return false
            end
        end
 
        local itemName = tonumber(split[2]) and itemType:getName() or item
        local size = 0
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            local storage = player:getStorageValue(i)
            if size == AUTO_LOOT_MAX_ITEMS then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The list is full, please remove from the list to make some room.")
                break
            end
 
            if storage == itemType:getId() then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." is already in the list.")
                break
            end
 
            if storage <= 0 then
                player:setStorageValue(i, itemType:getId())
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been added to the list.")
                break
            end
 
            size = size + 1
        end
    elseif action == "remove" then
        local item = split[2]:gsub("%s+", "", 1)
        local itemType = ItemType(item)
        if itemType:getId() == 0 then
            itemType = ItemType(tonumber(item))
            if itemType:getId() == 0 then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.")
                return false
            end
        end
 
        local itemName = tonumber(split[2]) and itemType:getName() or item
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            if player:getStorageValue(i) == itemType:getId() then
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been removed from the list.")
                player:setStorageValue(i, 0)
                return false
            end
        end
 
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." was not founded in the list.")
    elseif action == "show" then
        local text = "-- Auto Loot List --\n"
        local count = 1
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            local storage = player:getStorageValue(i)
            if storage > 0 then
                text = string.format("%s%d. %s\n", text, count, ItemType(storage):getName())
                count = count + 1
            end
        end
 
        if text == "" then
            text = "Empty"
        end
 
        player:showTextDialog(1950, text, false)
    elseif action == "clear" then
        for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
            player:setStorageValue(i, 0)
        end
 
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The autoloot list has been cleared.")
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use the commands: !autoloot {add, remove, show, clear}")
    end
 
    return false
end

Agora vá em data/creaturescripts/creaturescripts.xml e coloque esta tag dentro:

 


<event type="kill" name="AutoLoot" script="autoloot.lua" />

Depois entra em /data/creaturescripts/scripts e crie um arquivo chamado autoloot.lua, dentro dele coloque isso:

 


local function scanContainer(cid, position)
    local player = Player(cid)
    if not player then
        return
    end
 
    local corpse = Tile(position):getTopDownItem()
    if not corpse or not corpse:isContainer() then
        return
    end
 
    if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then
        for a = corpse:getSize() - 1, 0, -1 do
            local containerItem = corpse:getItem(a)
            if containerItem then
                for b = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
                    if player:getStorageValue(b) == containerItem:getId() then
                        containerItem:moveTo(player)
                    end
                end
            end
        end
    end
end
 
function onKill(player, target)
    if not target:isMonster() then
        return true
    end
 
    addEvent(scanContainer, 100, player:getId(), target:getPosition())
    return true
end

Por fim, não esqueça de registrar o evento dentro do arquivo login.lua que fica na pasta creaturescripts/scripts.

no meu caso (tfs 1.3) ele fica no seguinte caminho: /data/creaturescripts/scripts/others/login.lua

adicione esta tag:


player:registerEvent("AutoLoot")

Creditos 100%: Printer

 

Funciona no TFS 1.3, tibia 12.1?

 

Muito obrigado pelo tutorial...

Link para o post
Compartilhar em outros sites
  • 2 years later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo