Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Citar

Lua Script Error: [Main Interface] in a timer event called from: (Unknown scriptfile) data/creaturescripts/scripts/autoloot.lua:13: attempt to call method 'getSize' (a nil value) stack traceback: [C]: in function 'getSize' data/creaturescripts/scripts/autoloot.lua:13: in function

 

Link para o post
Compartilhar em outros sites
  • 6 months later...

Aqui funcionou otx 3.10, base tfs 1.3.

Porém está acontecendo o seguinte erro no distro: 

Lua Script Error: [Main Interface] 
in a timer event called from: 
(Unknown scriptfile) 
data/creaturescripts/scripts/autoloot.lua:13: attempt to call method 'getSize' (a nil value) 
stack traceback: 
[C]: in function 'getSize' 
data/creaturescripts/scripts/autoloot.lua:13: in function 

O mais estranho é que funciona 100% o script kkk alguem sabe como arrumar isso? E eu também queria colocar mais slots de loot porém só para vip como faço isso?

Editado por vine96 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 5 weeks later...

@floyer 

Em 03/01/2017 em 03:27, floyer disse:

Olha, no meu pra funcionar eu tive que alterar o .lua do talkactions, Bem na instruçao onde vc adiciona o item


if action == "add" then
        local item = split[2] -- Alterei aki. Antes ele removia os espacos em branco de itens como (gold coin), ficando goldcoin, dai ele n achava esse nome nos loots 
        local itemType = ItemType(item)
        if itemType:getId() == 0 then --removi linhas aki. Se o player digitar o nome errado do item, nao sera adicionado na lista de loot
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.")
                return false
        end

Só testei com o item gold coin. Matei uns eskeletos e ele funcionou certinho

 

O meu continua sem funcionar. Não aparece erro nenhum na distro, porém quando tento adicionar algum item usando o comando !autoloot add, ele não reconhece nenhum item que escrevo, fica sempre repetindo a msg Use the commands: !autoloot {add, remove, show, clear}. Sabe resolver? Uso TFS 1.2

 

Citar

Corrigido, precisava colocar vírgula para funcionar:

!autoloot add,gold coin :wow:

 

Editado por r4ge (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 year later...
  • 11 months later...
Em 25/10/2015 em 16:02, Tricoder disse:
SCREENSHOT


______________________________________________

COMANDOS


!autoloot add, itemId ou name -- Adicionando um item na lista
!autoloot remove, itemId or name -- Remover um item da lista
!autoloot show -- Mostrar a lista do autoLoot
!autoloot clear -- Limpar a lista do autoLoot
______________________________________________
SCRIPT

data/global.lua


-- 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

talkactions/talkactions.xml


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

talkactions/scripts/autoloot.lua


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

creaturescripts/creaturescripts.xml


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

creaturescripts/scripts/autoloot.lua


local function scanContainer(cid, position)
    local player = Player(cid)
    if not player then
        return
    end

    local corpse = Tile(position):getTopDownItem()
    if not corpse then
        return
    end

    if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then
        for i = corpse:getSize() - 1, 0, -1 do
            local containerItem = corpse:getItem(i)
            if containerItem then
                for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
                    if player:getStorageValue(i) == 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

creaturescripts/scripts/login.lua


player:registerEvent("AutoLoot")
______________________________________________

CRÉDITOS

  • Printer

desculpe reviver o topico, como deixo o comando !autoloot pra ativar o sistema e o restante pra gerenciar pelo (manager loot containers) Meu é tfs 1.3 versao 12.3 

Link para o post
Compartilhar em outros sites
5 minutos atrás, feipedorp disse:

desculpe reviver o topico, como deixo o comando !autoloot pra ativar o sistema e o restante pra gerenciar pelo (manager loot containers) Meu é tfs 1.3 versao 12.3 

 

vc quer um comando que ativa o autoloot? exemplo !autoloot on/off?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
21 horas atrás, Vodkart disse:

 

vc quer um comando que ativa o autoloot? exemplo !autoloot on/off?

Eu quero deixar o sistema como atual igual global, para gerenciamento de backpackys e itens, porem o meu autoloot não pega o loot sozinho tem que abrir o bixo, gostaria que somente ao matar coletasse sozinho o loot.

Link para o post
Compartilhar em outros sites
  • 10 months later...

Pra quem ainda utiliza esse script venho trazer a solução para o erro tanto do GetSize quanto do Container.

 

O meu pensamento foi bem simples, eu sabia que o script estava funcionando quase "perfeitamente" se não fosse esse erro, eu testei inumeras vezes e não acontecia o erro, porém quando outras pessoas pelo mapa estavam caçando, as vezes aparecia.

Então eu tive que começar a pensar em identificar em que circunstância isso acontecia, então eu pensei na possibilidade de ser um monstro específico ou alguma característica.

Coloquei pra printar o monstro e o player toda vez que o autoloot fosse acionado e deu certo, descobri que quando as pessoas matavam por exemplo a Snake, que não tem como abrir, o script dava esse erro.

 

A solução foi o seguinte, 

 

 

Arquivo: creaturescripts/scripts/autoloot.lua

        local container = Container(corpse.uid)
	
		-- verificação se o corpo possui ou não container
        if not container then
              return
        end

 

Coloquei essa verificação para identificar se o monstro em questão possuia container antes de executar a função do autoloot.

 

Sendo assim, se ele identificar que o corpo não possui container (não da pra abrir) ele mata o script e não da o erro.

 

Espero que funcione pra vocês também!

 

Scripts final ficou assim:

 

local function scanContainer(cid, position)
    local player = Player(cid)
    if not player then
        return
    end

    local corpse = Tile(position):getTopDownItem()
    if not corpse then
        return
    end

    if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then


        local container = Container(corpse.uid)

        if not container then
              return
        end

        for i = 0, container:getSize()-1 do
            local containerItem = container:getItem(i)
            if containerItem then
                for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
                    if player:getStorageValue(i) == 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

 

 

Editado por tavares7 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 year later...

Salve galera desculpa revier o topico mais estou com mesmo erro do cara ali de 2017, eu testei numa tfs1.5 do nekiro downgrades 8.60 
ele funciona tudo certinho adiciona na lista e remove e ver a lista porém ele não coleta o item e não aparece erro no log


Alguem pode ajudar

Link para o post
Compartilhar em outros sites

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 campospkks
      Servidor muito bem otimizado, com amplo map para uma diversão imperdível. 
       
      *  Quest System
      * bugs corrigidos 90,0%
      * Client Específico (V8)
      * Mobile Adaptavel e Otimizado
      * database.sql já com (Modulo Pix) 
      * site 95,9% atualizado (Troque, pois a marca já possuí proprietário)
      * Franquia Tibia Custom baseado em armas.
       
      Site Original: soulgun.com.br
      discord.gg/cCWcaMwjuB
      Relançamento Servidor 20-09-2024
      Horario 17:00
      whatsap Grupo
      https://chat.whatsapp.com/JsAyLAmwJQyGEWgHTI4096
      Video Do Game
      https://youtu.be/N8asxdnzmGw


    • Por HoSOnline
      [BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA][BETA]

      Hello, I would like to introduce you to a server that I have been working on for some time.
      ____________________________________
      Start HoSOnline - Beta 20.09.2024r 18:00 / BR 6:00 pm
      Discord: https://discord.gg/g7uzMzr3dg
      AccMaker: https://hosonline.eu/home.html
      FanPage FB: https://www.facebook.com/historyofshinobionline
      ________________________________


      ____________________________________

      SERVER INFORMATION
      ________________________________

      Exp Rate: MEDIUM

      On the server I currently have:
      (all systems are described on AccMaker)


      ○ 17 Professions
      ○ Shippuden (Reborn System with DB OTS)
      ○ Task System
      ○ Rider System
      ○ Fly System
      ○ Florist System (only Ino)
      ○ Upgrade System
      ○ Class System Broni/EQ
      ○ 'Combo' System
      ○ Specials Jutsu
      ○ Perks System
      ○ Cast System
      ○ Crafting System
      ○ Hiraishin Kunai
      ○ Boss System
      ○ Sag System..


      Sample Screens from the game:









       
    • Por chateadoagr
      Bem-vindo ao Genesis Online Tibia (GOT), um mundo onde a civilização foi devastada por um apocalipse zumbi. Inspirado em referências como The Walking Dead e Resident Evil, o GOT desafia você a sobreviver em meio ao caos, enfrentando hordas de mortos-vivos, explorando ruínas perigosas e formando alianças estratégicas. Embarque nesta jornada épica de sobrevivência e descoberta, onde cada escolha molda seu destino em um cenário hostil repleto de desafios e perigos iminentes.
       
       
      Adentre o universo de Genesis Online Tibia (GOT), um jogo repleto de sistemas inovadores e emocionantes. Equipe-se com um vasto arsenal de armas para enfrentar as ameaças do apocalipse zumbi, enquanto o sistema autoloot simplifica suas conquistas. Desenvolva seu personagem através de um sistema de upgrade único, aprimorando habilidades e atributos para enfrentar desafios cada vez mais formidáveis.
       
      Explore um mundo imersivo onde o som desempenha um papel crucial, criando uma atmosfera envolvente e realista. Vasculhe cada canto em busca de recursos vitais, desvendando segredos e tesouros ocultos. Siga uma cativante história através de missões que expandem o enredo, revelando os mistérios por trás do apocalipse e oferecendo recompensas valiosas.
       
      Em Genesis Online Tibia, a jornada pela sobrevivência é repleta de ação, estratégia e emoção, convidando você a se aventurar em um mundo onde cada decisão molda seu destino e determina sua capacidade de enfrentar os desafios que aguardam.

      Em breve imagens do servidor!
       
       
    • Por MarcusCores
      Welcome to ShadeCores
      We are excited to finally present to you: ShadeCores!
      After a long time of development and testing, we're finally ready to launch this awesome game!
      Quick Info for laziness:
      Rates: Tibia 7.4 theme 1x Experience 1x Skills 1x Magic 1x Loot 1x Regen General info:
      Official launch: April 24, 17:00 CEST.
      Create characters: 1 hour before launch (16:00 CEST).
      Website: https://shadecores.com/?subtopic=news
      Authentic Damages Monster attacks Monsters carrying equipment & loot Monster Spawns & respawn depending on players online World light and watches Traps Line of sight system Floor saving system Exhaustion system Much more.. General Cannot multi-client REAL Proven & Verified Anti-Cheat system = No cheaters Many quests modified to add mystery to the game for everyone Much more..
      What is ShadeCores?
      ShadeCores is a game designed to mimic the oldschool version of Tibia.com, but in a slower pace.
      Our goal is to be a long lasting and functional game that doesn't run a course of being broken after a few years.
      Read more at: https://shadecores.com/?subtopic=about&view=about.

      World Map
      The map contains all places of Tibia 7.70.
      It also contains 100% spawns of Tibia 7.70.
      With exception of Ankrahmun and Port Hope that was removed for balancing purposes.

      Built authentically
      ShadeCores was built hand in hand with hacked Tibia files (7.70 version) and is very accurate to how Tibia was (with exception things that has been improved).
      If you played Tibia back in 7.4-7.70 and join ShadeCores, you will yourself notice how scary accurate every single spawn is.
      Read more at: https://shadecores.com/?subtopic=about&view=additional.

      Game health
      We have made many modifications to ensure a healthy economy and game.
      Read more at: https://shadecores.com/?subtopic=about&view=balance.

      Creature Behavior
      In ShadeCores, same as in CipSoft's, creatures that's fleeing for their life (low health) will not make any pauses no matter how close the player is.
      Creatures also doesn't have any exhaustion of their abilities such as attacks, healings and more.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=5-Features+-Creature+Behavior.

      Creature spawns
      ShadeCores has the very same spawn system that CipSoft's had back in the day.
      All creatures that spawns has a "home".
      And this "home" has a set amount of creatures that belongs to it, always same type of creature.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=3-Features+-Creature+spawns.

      Accurate creature loot & inventory
      ShadeCores have an accurate loot & inventory system for creatures, working identically as it did in CipSoft's back in the day.
      Which means that creatures with items that give light, will also light up the creature, or armors that will increase the armor of the creature, or that when a creature wear boots of haste, it will run noticeably faster!
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=1-Features+-Creatures+equipping+their+loot+%26amp%3B+loot+system.

      Authentic exhaustions
      Believe it or not, OT's have it completely wrong, OTs uses 1 or 2 kind of exhaustions depending on which version they're meant to reflect (healing + attacking spells).
      However, in CipSoft's, there were 3 different exhaustions in the old days, 4 if you include "using item on.." exhaustion which was 1 second.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=6-Features+-Exhaustion+system.

      Floor saving
      ShadeCores are running with a map-saving system that allow the map to save certain edits done by players.
      The edits can almost be anything from items added to certain places, to open doors, wall torches that's lit or not, items hiding in boxes, book cases or even unexpected containers invisible to the naked eye.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=12-Features+-Floor+saving+system.

      Game health balance
      To ensure that ShadeCores become as perfect as possible, a lot has to be considered and corrected.
      Our goal is to make a long lasting and functional game that doesn't run a course of being broken after a few years.
      In ShadeCores, you're not meant to get unlimited supplies, hunting dragons, dragon lords, demons or other demonic critters, we don't fancy the rushed pace much of Tibia has become along with the community.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=13-Features+-Game+Health+Balance+(creatures%2C+supplies%2C+gold).

      Keep valuables valuable
      In ShadeCores it's harder to obtain "good" equipment, which will turn lower level equipment into the new good equipment.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=14-Features+-Game+Health+Balance+(equipment).

      Line of sight system
      In ShadeCores we use the same line-of-sight system as in CipSoft's.
      You may notice when you're playing that sometimes you can throw things in a way you can't do in most OT's.
      And you' may also notice that sometimes, you cannot throw things in same way as in most OT's.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=8-Features+-Line+of+sight+system.

      Poison storm
      Almost every OT either has ticking poison damage from around 50 counting down until 0, while others have an instant damage followed by poison or some other mixtures.
      While in reality, damage of the poison storm is decided by level and magic level, from the first tick of damage, it decreases with a few % until it reaches 0.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=7-Features+-Poison+storm.

      Traps functionality
      Traps does a static amount of damage. 30 to be exact, it's always 30.
      However, traps cause a physical damage that listen to the creatures armor.
      It means that the damage can and will be reduced by any armor the creature may have.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=2-Features+-Traps+(item).

      World light & watches
      In ShadeCores, time and world light works exactly like it did in CipSoft's back in the day.
      Read more at: https://shadecores.com/?subtopic=support&view=faq&topic=9-Features+-World+lights+%26amp%3B+watches.

      Anti-Cheat system
      We have a very advanced and automatic anti-cheat system that detects all kind of cheats rather quickly, be it bot, macro, tasker or others.
      This system was first developed and proven to work very well in RetroCores world "Cleanera".
      It has since then been improved to be faster and detect a wider array of cheats that people could use.

      A lot of servers has basically lied about that they're anti-bot, most of players have been in "anti-bot" servers that's been exploding with cheats and nobody gets punished, which is why most with good reason wont trust whenever someone says they're "antibot".
      But through Cleanera@RetroCores, we've verified for a lot of people that we're not bullshitting you, we're legit, we have a system that works and a lot of people have tested it and found themselves shocked when their "secret cheat" got caught even though nobody was nearby them.

      Additionally to the anti-cheat, ShadeCores does not allow multi-clienting
      Multi-Clienting will be treated as a cheat and lead to a deletion.
      To make sure nobody accidentally use multi-client without knowing the rules, we've made so that it's not possible to start more than one instance of the client.
      If you try to start a new client while already having one open, you will face this little message.

      Other Game Features
      Ability to play for free. No level restrictions on items nor spells. Non-stackable runes/fluids. No Runes from NPCs. No item-hotkeys. No wands/rods. No protection zone on boats/carpets. Manual aiming Anti-lag system. Great and improved monster systems. Monsters can be lured anywhere. No stairjump exhaust. Possibility to make UH traps. Accurate 7.4 formulas. Classic premium system. Classic promotion system. Many and random raids with possibility to loot raid-rare items.
      If you're new to the community, you're welcome to join the ShadeCores Discord server to chat with other players and staff!
      plain link: https://discord.gg/BtZmNDNUz6


      ShadeCores will officially launch on April 24 at 17:00 CEST!
      You will be able to create characters starting at 16:00 CEST the same day!

      Sincerely,
      ShadeCores Staff
    • Por Kill of sumoners
      olá sou o takezo e estou caminhando para desenvolver um novo ot de naruto 100% com sprites 45°, ja contamos com mais de 25 vocations, cliente com layout reformulado, som ambiente e em ataques, porem a staff conta apenas comigo e mais um amigo, vim aqui procurar pessoas que possam querer integrar a staff, sejam elas devs, designers, mappers entre outros, para mais informações entre em contato privado comigo, desde ja muito obrigado!
       
      https://gyazo.com/745b10c56f4571464645fdea192cf350
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo