Postado Fevereiro 11, 2020 5 anos @poko360 vc fez aquele negócio da database para trocar por int? e vc editou a alguma parte da talk? testei aqui e funcionou [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 11, 2020 5 anos Autor Em 11/02/2020 em 01:18, Vodkart disse: @poko360 vc fez aquele negócio da database para trocar por int? fiz nao, tipo, nao entendi mt bem, tenho que ir la em "players_storage" é la? tenho medo de mudar algo la e afetar todos os players Em 11/02/2020 em 01:18, Vodkart disse: e vc editou a alguma parte da talk? nao, mudei nd nao EDIT: mudei todos pra int, é assim? tem ctz que nao vai afetar em nada em relação ao sv? oO EDIT 2: mudei todos pra int, e continuou a mesma coisa =S Editado Fevereiro 11, 2020 5 anos por poko360 (veja o histórico de edições)
Postado Fevereiro 11, 2020 5 anos @poko360 mas ele já da esse erro direto? digamos que vc criar uma conta e digitar !task, já aparece isso? deixa eu ver como ficou seu mods editado? [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 12, 2020 5 anos Autor @Vodkart Em 11/02/2020 em 10:16, Vodkart disse: @poko360 mas ele já da esse erro direto? digamos que vc criar uma conta e digitar !task, já aparece isso? ele so da o error quando digito !task (inclusive com o novo char tambem, nao funciona) e o lag voltou denovo: Mostrar conteúdo oculto meu mod ficou assim: Mostrar conteúdo oculto <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Automatic Simple Task" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="no"> <config name="auto_stask"><![CDATA[ automatic_task = { {name = "Easy", storage = 761001, monsters_list = {"Cyclops","Cyclops Smith"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 500000}, {name = "Medium", storage = 761002, monsters_list = {"Dragon","Dragon lord"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 2500000}, {name = "Hard", storage = 761003, monsters_list = {"Hydra","Serpent Spawn"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 5000000}, {name = "Insane", storage = 761004, monsters_list = {"Wild Snow","Midnight Asura","Nature Djinn","Storm Djinn","[+10%] Wild Snow","[+10%] Midnight Asura","[+10%] Nature Djinn","[+10%] Storm Djinn"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 7500000}, {name = "Ultimate", storage = 761005, monsters_list = {"wizard","blackfrost","marauder","ferumbras","[+10%] wizard","[+10%] blackfrost","[+10%] marauder","[+10%] ferumbras"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 10000000}, {name = "RED", storage = 761006, monsters_list = {"red wizard","red blackfrost","red marauder","red ferumbras","[+10%] red wizard","[+10%] red blackfrost","[+10%] red marauder","[+10%] red ferumbras"}, can_repeat = true, level_min = 1, count = 1000, reward = {}, exp = 0, money = 15000000}, {name = "OOF", storage = 761007, monsters_list = {"oof"}, can_repeat = false, level_min = 1, count = 25000, reward = {8977,1}, exp = 0, money = 0}, {name = "Apolo", storage = 761008, monsters_list = {"apolo"}, can_repeat = true, level_min = 1, count = 50, reward = {{6543,15},{8981,1}}, exp = 0, money = 0}, {name = "Lyre", storage = 761009, monsters_list = {"lyre"}, can_repeat = true, level_min = 1, count = 50, reward = {{10309,1},{2198,1}}, exp = 0, money = 0}, {name = "Blue", storage = 761010, monsters_list = {"blue"}, can_repeat = true, level_min = 1, count = 7, reward = {{10530,1},{12524,1}}, exp = 0, money = 0}, {name = "Vip coin", storage = 761011, monsters_list = {"vip coin"}, can_repeat = false, level_min = 1, count = 10, reward = {{11192,10}}, exp = 0, money = 0}, {name = "Runes", storage = 761012, monsters_list = {"runes"}, can_repeat = true, level_min = 1, count = 50, reward = {{2348,1}}, exp = 0, money = 0}, {name = "Baby", storage = 761013, monsters_list = {"baby"}, can_repeat = true, level_min = 1, count = 50, reward = {{4863,1}}, exp = 0, money = 0}, {name = "Pingu", storage = 761014, monsters_list = {"pingu"}, can_repeat = true, level_min = 1, count = 50, reward = {{6544,1}}, exp = 0, money = 0}, {name = "Kayn", storage = 761015, monsters_list = {"kayn"}, can_repeat = true, level_min = 1, count = 50, reward = {{9971,10}}, exp = 0, money = 0}, {name = "Jake", storage = 761016, monsters_list = {"jake"}, can_repeat = true, level_min = 1, count = 50, reward = {11390,10}, exp = 0, money = 0} } automatic_task_config = { reward_type = MESSAGE_STATUS_CONSOLE_BLUE, defeat_type = MESSAGE_STATUS_CONSOLE_ORANGE, defeat_storage = 963850, lvl_advance_control = 963851 } function getItemsFromList(items) local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[2] .. ' ' .. getItemNameById(items[1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return strendfunction getMonsterFromList(monster) local str = '' if #monster > 0 then for i = 1, #monster do str = str .. monster if i ~= #monster then str = str .. ', ' end end end return strendfunction GiveRewardsTask(cid, items) local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID for _, i_i in ipairs(items) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doAddContainerItem(backpack, item, amount) else for i = 1, amount do doAddContainerItem(backpack, item, 1) end end endend]]></config><event type="advance" name="TaskAutAdvance" event="script"><![CDATA[domodlib('auto_stask')function onAdvance(cid, skill, oldLevel, newLevel) if (skill == SKILL__LEVEL) then if getPlayerStorageValue(cid, automatic_task_config.lvl_advance_control) < newLevel then for k, v in pairs(automatic_task) do if v.level_min == newLevel then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Task System] Voce Desbloqueou a "..v.name.." Task! Parabéns!") end end setPlayerStorageValue(cid, automatic_task_config.lvl_advance_control, newLevel) end end return trueend]]></event><talkaction words="/task;!task" event="buffer"><![CDATA[domodlib('auto_stask')param, str = param:lower(),"Task(s) Disponiveis:\n\n"if isInArray({"counter","contador","count"},param) then setPlayerStorageValue(cid, automatic_task_config.defeat_storage, tonumber(getPlayerStorageValue(cid, automatic_task_config.defeat_storage)) <= 0 and 1 or 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(tonumber(getPlayerStorageValue(cid, automatic_task_config.defeat_storage)) <= 0 and "ativado" or "desativado")..".") return trueendfor k, v in pairs(automatic_task) do if getPlayerLevel(cid) >= v.level_min and tonumber(getPlayerStorageValue(cid, v.storage)) < v.count then local amount = tonumber(getPlayerStorageValue(cid, v.storage)) <= 0 and 0 or tonumber(getPlayerStorageValue(cid, v.storage)) str = str.."[+] "..v.name .." Task [+]\n\nMonster Count: ["..amount.."/"..v.count.."]\n\nMonsters Killing: "..getMonsterFromList(v.monsters_list)..".\nLevel: "..v.level_min.." or More.\nRewards: ".. (table.maxn(v.reward) > 0 and getItemsFromList(v.reward) or "Nothing") ..".\nMoney: ".. (v.money > 0 and v.money or 0) ..".\n" endendreturn doShowTextDialog(cid, 8983, str)]]></talkaction><event type="login" name="TaskAutLogin" event="script"><![CDATA[function onLogin(cid) registerCreatureEvent(cid, "KillAutTask") registerCreatureEvent(cid, "TaskAutAdvance") return trueend]]></event><event type="kill" name="KillAutTask" event="script"><![CDATA[domodlib('auto_stask')function onKill(cid, target) local str = "" if isPlayer(cid) and isMonster(target) then for task , info in pairs(automatic_task) do if isInArray(info.monsters_list, getCreatureName(target):lower()) and getPlayerLevel(cid) >= info.level_min then local ret = tonumber(getPlayerStorageValue(cid, info.storage) <= 0 and 0 or getPlayerStorageValue(cid, info.storage)) if tonumber(ret) < tonumber(info.count) then setPlayerStorageValue(cid, info.storage, tonumber(getPlayerStorageValue(cid, info.storage) <= 0 and 1 or getPlayerStorageValue(cid, info.storage)+1)) if getPlayerStorageValue(cid, automatic_task_config.defeat_storage) <= 0 and tonumber(getPlayerStorageValue(cid, info.storage)) < info.count then doPlayerSendTextMessage(cid, 24,"[Task System] defeated Total [" .. tonumber(getPlayerStorageValue(cid, info.storage)) .. "/" .. info.count .. "] da Task do " .. info.name .. ".") end if tonumber(getPlayerStorageValue(cid, info.storage)) >= info.count then if info.exp > 0 then doPlayerAddExp(cid, info.exp) str = str.."".. (str == "" and "" or ", ") .." "..info.exp.." de exp" end if info.money > 0 then doPlayerAddMoney(cid, info.money) str = str.."".. (str == "" and "" or ", ") ..""..info.money.." gps" end if table.maxn(info.reward) > 0 then GiveRewardsTask(cid, info.reward) str = str.."".. (str == "" and "" or ", ") ..""..getItemsFromList(info.reward) end doPlayerSendTextMessage(cid, automatic_task_config.reward_type, "[Task System] Voce completou a "..info.name.." Task. Obrigado pela sua ajuda!! Suas Recompensas: "..(str == "" and "nenhuma" or str)) if info.can_repeat == true then setPlayerStorageValue(cid, info.storage, 0) end end end end end end return trueend]]></event></mod> Editado Fevereiro 12, 2020 5 anos por poko360 (veja o histórico de edições)
Postado Fevereiro 13, 2020 5 anos Solução @poko360 tinha mta coisa faltando, quando vc copiou saiu várias funções n sei pq pega daqui: https://pastebin.com/raw/kF7TLf9A [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.