Postado Dezembro 30, 2012 12 anos [1:38:22.050] [Error - TalkAction Interface] [1:38:22.050] data/talkactions/scripts/bot.lua:onSay [1:38:22.050] Description: [1:38:22.050] data/talkactions/scripts/bot.lua:142: attempt to call global 'doPlayerCastSpell' (a nil value) [1:38:22.050] stack traceback: [1:38:22.050] data/talkactions/scripts/bot.lua:142: in function 'botMagic' [1:38:22.051] data/talkactions/scripts/bot.lua:166: in function <data/talkactions/scripts/bot.lua:148> Script: local eat = {} local heal = {} local magic = {} local foods = { {8, "Crunch.", 2362}, {15, "Munch.", 2666}, {12, "Munch.", 2667}, {10, "Mmmm.", 2668}, {17, "Munch.", 2669}, {4, "Gulp.", 2670}, {30, "Chomp.", 2671}, {60, "Chomp.", 2672}, {5, "Yum.", 2673}, {6, "Yum.", 2674}, {13, "Yum.", 2675}, {8, "Yum.", 2676}, {1, "Yum.", 2677}, {18, "Slurp.", 2678}, {1, "Yum.", 2679}, {2, "Yum.", 2680}, {9, "Yum.", 2681}, {20, "Yum.", 2682}, {17, "Munch.", 2683}, {8, "Crunch.", 2684}, {6, "Munch.", 2685}, {9, "Crunch.", 2686}, {2, "Crunch.", 2687}, {9, "Munch.", 2688}, {10, "Crunch.", 2689}, {3, "Crunch.", 2690}, {8, "Crunch.", 2691}, {6, "Munch.", 2792}, {9, "Munch.", 2793}, {6, "Gulp.", 2695}, {9, "Smack.", 2696}, {9, "Munch.", 2787}, {4, "Munch.", 2788}, {22, "Munch.", 2789}, {30, "Munch.", 2790}, {30, "Munch.", 2791}, {6, "Munch.", 2792}, {3, "Munch.", 2794}, {36, "Munch.", 2795}, {5, "Munch.", 2796}, {9, "Munch.", 2793}, {4, "Yum.", 5097}, {8, "Gulp.", 6125}, {10, "Mmmm.", 6278}, {15, "Mmmm.", 6279}, {12, "Mmmm.", 6393}, {15, "Mmmm.", 6394}, {20, "Mmmm.", 6501}, {6, "Gulp.", 6541}, {6, "Gulp.", 6542}, {6, "Gulp.", 6543}, {6, "Gulp.", 6544}, {6, "Gulp.", 6545}, {1, "Mmmm.", 6569}, {4, "Mmmm.", 6574}, {15, "Munch.", 7158}, {13, "Munch.", 7159}, {7, "Yum.", 7372}, {7, "Yum.", 7373}, {7, "Yum.", 7374}, {7, "Yum.", 7375}, {7, "Yum.", 7376}, {7, "Yum.", 7377}, {4, "Crunch.", 7909}, {7, "Gulp.", 8838}, {5, "Yum.", 8839}, {2, "Yum.", 8840}, {3, "Urgh.", 8841}, {3, "Munch.", 8842}, {3, "Crunch.", 8843}, {3, "Gulp.", 8844}, {2, "Munch.", 8845}, {11, "Yum.", 8447} } function botInfo(cid) doPlayerPopupFYI(cid, "Tibia Brasil OT Bot System\n" .. "--Tools--\n" .. "!bot startfood/stopfood (Auto Eat)\n\n" .. "--Auto Magic--\n" .. "!bot startmagic, spellname, mananeeded\n" .. "(example !bot startmagic, utevo lux, 84)\n" .. "!bot stopmagic\n\n" .. "--Auto Heal--\n" .. "!bot startheal, spellname, healthneeded, mananeeded\n" .. "(example !bot startheal, exura, 500, 20)\n" .. "!bot stopheal\n\n" .. "--Auto Loot--\n" .. "!loot listid - show ItemID for add in ur auto loot\n" .. "!loot check - show ur list of ur auto loot \n" .. "!loot add:ItemID - add one item for list of auto loot\n" .. "!loot remove:ItemID - add one item for list of auto loot\n" .. "" ) end function botEat(cid) local food = nil for _, v in ipairs(foods) do if getPlayerItemCount(cid, v[3]) > 0 then food = v break end end if food ~= nil then if((getPlayerFood(cid) + food[1]) >= 400) then doPlayerSendCancel(cid, "You are full.") eat[getPlayerGUID(cid)] = addEvent(botEat, 20000, cid) return end doPlayerFeed(cid, food[1] * 4) doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1) doPlayerRemoveItem(cid, food[3], 1) end eat[getPlayerGUID(cid)] = addEvent(botEat, 20000, cid) return true end function botHeal(params) if getCreatureMana(params[1]) < tonumber(params[4]) then heal[getPlayerGUID(params[1])] = addEvent(botHeal, 100, params) return true elseif getCreatureHealth(params[1]) < tonumber(params[3]) then doPlayerCastSpell(params[1], params[2]) heal[getPlayerGUID(params[1])] = addEvent(botHeal, 100, params) return true end heal[getPlayerGUID(params[1])] = addEvent(botHeal, 100, params) return true end function botMagic(params) if getCreatureMana(params[1]) < tonumber(params[3]) then magic[getPlayerGUID(params[1])] = addEvent(botMagic, 100, params) return true else doPlayerCastSpell(params[1], params[2]) magic[getPlayerGUID(params[1])] = addEvent(botMagic, 100, params) return true end end function onSay(cid, words, param, channel) if isPlayer(cid) == false then return doPlayerSendCancel(cid, 'Modo Bot.') else if param == "" then botInfo(cid) end local params = string.explode(param, ",") if params[1] == "startfood" then eat[getPlayerGUID(cid)] = addEvent(botEat, 100, cid) elseif params[1] == "stopfood" then stopEvent(eat[getPlayerGUID(cid)]) elseif (params[1] == "startheal" and #params == 4) then botHeal({cid, params[2], params[3], params[4]}) elseif (params[1] == "stopheal") then stopEvent(heal[getPlayerGUID(cid)]) elseif (params[1] == "startmagic" and #params == 3) then botMagic({cid, params[2], params[3]}) elseif (params[1] == "stopmagic") then stopEvent(magic[getPlayerGUID(cid)]) end return true end end
Postado Dezembro 30, 2012 12 anos data/talkactions/scripts/bot.lua:142: attempt to call global 'doPlayerCastSpell' (a nil value) Tradução pelo Google Tradutor: data/talkactions/scripts/bot.lua:142:tentativa de chamar global "doPlayerCastSpell '(um valor nulo) Ou seja: A função doPlayerCastSpell não foi declarada. -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Dezembro 30, 2012 12 anos Instala a função ué. Bem, a função doPlayerCastSpell tem que ser colocada na source, se você der uma vasculhada por aí você vai encontrar a função e como instalá-la. -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
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.