Ir para conteúdo

Posts Recomendados

ME AJUDA NO MEU ANTIBOT TA DANDO ERRO OLHA ELE AI \/

 -- configs
local mintoanswer = 2 -- minutes to answer Anti bot system
local delayAntiBot = 30 -- minutes of delay of delayAntiBot
local maxgroupid = 1 -- groupid higher than this don't have antibotSystem Activated
local prisionpos = {x=1061,y=920,z=7} -- if don't answer, go to this pos
local prisionminutes = 10 -- time inside the prision
local templepos = {x=1000, y=1000, z=7} -- after the prisionminutes, back to this position (temple is recommended)
-- end configs

-- local variables
local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129}
-- end local variables


function onLogin(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (prisioned == 1) then
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (timenow >= prisiontime) then
setPlayerStorageValue(cid,storages.prisiontime,0)
setPlayerStorageValue(cid,storages.prisioned,0)
doTeleportThing(cid, templepos)
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
doTeleportThing(cid, prisionpos)
end
end


if (delayAntiBot <= mintoanswer) then
debugPrint("Error! Anti Bot System debugs: variable delayAntiBot need to be higher than mintoanswer.")
else
if (getPlayerGroupId(cid) <= maxgroupid) then
antiBotEvent = addEvent(antiBot,1000,{cid=cid})
else
doPlayerSendTextMessage(cid, 20, "People with group ID higher than ".. maxgroupid .." don't have this system.")
end
end
return TRUE
end

function onLogout(cid)
stopEvent(prisionEvent)
stopEvent(antiBotEvent)
stopEvent(checkAnswerEvent)


setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
return TRUE
end

function antibot(parameters)
local cid = parameters.cid

local playerpos = getCreaturePosition(cid)
local playerpz = getTilePzInfo(playerpos)
local playername = getPlayerName(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (playerpz ~= 1 and prisioned ~= 1) then
local first_num = math.random(1,9)
local second_num = math.random(1,9)
local result = first_num+second_num

setPlayerStorageValue(cid,storages.first_num,first_num)
setPlayerStorageValue(cid,storages.second_num,second_num)
setPlayerStorageValue(cid,storages.result,result)
doPlayerSendTextMessage(cid, 20, "Anti Bot System: Olá, "..playername.."! Voce tem ".. mintoanswer .." minute(s) para responder o quanto é ".. first_num .." + ".. second_num ..". Para responder a diga: !AntiBot \"number.")
doPlayerSendTextMessage(cid, 20, "Anti Bot System: Exemplo: 20+20 = 40, então você diria !AntiBot \"40.")
checkAnswerEvent = addEvent(checkAnswer,mintoanswer*60*1000,{cid=cid})
end
antiBotEvent = addEvent(antiBot,delayAntiBot*60*1000,{cid=cid})
end

function checkAnswer(parameters)
local cid = parameters.cid
local first_num = getPlayerStorageValue(cid,storages.first_num)
local second_num = getPlayerStorageValue(cid,storages.second_num)
local result = getPlayerStorageValue(cid,storages.result)
local answer = getPlayerStorageValue(cid,storages.answer)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
local wrong_answers = getPlayerStorageValue(cid,storages.wrong_answers)
if (wrong_answers > 3) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, 20, "Fim de Tempo! Você tinha ido para a prisão por ".. prisionminutes .." minute(s) porque respondeu errado muitas vezes!.")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
if (answer ~= 1 and prisioned ~= 1 and result > 0) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, 20, "Limite de tempo! Você tinha sido preso por ".. prisionminutes .." minute(s).")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
doPlayerSendTextMessage(cid, 20, "Anti Bot System: Está ok, mas em alguns minutos você vai ser convidado novamente.")
end
end
end

function checkprisioned(parameters)
local cid = parameters.cid
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (prisioned == 1) then
if (timenow >= prisiontime) then
doPlayerSendTextMessage(cid, 20, "Você tinha terminado o seu tempo aqui na prisão! Agora você pode relogar para ir para a cidade.")
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
end
end
end

 

 

então peguei esse script aqui no xtibia, do

http://www.xtibia.com/forum/topic/150209-anti-bot/page__p__1103531__hl__anti__fromsearch__1#entry1103531

e eu modifiquei algumas coisas trazui algumas coisas do script do ingles para o portugues até ai de boa mais quando eu fui ver aqui no Arquivo.Exe do ot olha o erro

[28/10/2011 18:00:13] [Error - CreatureScript Interface] 
[28/10/2011 18:00:13] data/creaturescripts/scripts/AntiBot.lua:onLogin
[28/10/2011 18:00:13] Description: 
[28/10/2011 18:00:13] (luaAddEvent) Callback parameter should be a function.

 

entao eu nao sei qual o erro ta ai meu script, tem tbm o talkaction mais ele nao da erro só no creaturescripts e eu não sei como arrumar ja coloquei uma prision no ot para o anti bot mandar o cara mais fica dando esse erro ME AJUDA PLIS!

Link para o comentário
https://xtibia.com/forum/topic/171051-sistema-antibot-ajuda-ta-dando-erro/
Compartilhar em outros sites

×
×
  • Criar Novo...