[ Resolvido ]

Paulistasks
em Lixeira Pública

Paulistasks

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/09/09Posts: 76Char no Tibia: Danth Enix
-- Yunie Anti Bot System

-- XTibia Forums

-- www.xtibia.com/forum/

 

 

-- 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=83,y=122,z=7} -- if don't answer, go to this pos

local prisionminutes = 10 -- time inside the prision

local templepos = {x=95, y=117, 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, "Yunie Anti Bot System: Hello, "..playername.."! You have ".. mintoanswer .." minute(s) to answer how much is ".. first_num .." + ".. second_num ..". To answer say: !antibot \"number.")

doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Example: 20+20 = 40, then you would say !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, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s) because answered many wrong times.")

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, "Time limit! You had been prisioned for ".. 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, "Yunie Anti Bot System: You are ok, but in some minutes you are going to be asked again.")

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, "You had completed your time here in the prision! You may now relog to go to the city.")

else

prisionEvent = addEvent(checkprisioned,1000,{cid=cid})

end

end

end

 

Só preciso que adaptem ele pra ao invés de prender o player, ele somente kikar, obrigado =]

Last Job:



sign2h.png

 

Neobux Member:

downloaduc.gif

Wiltry

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/07/08Posts: 306

doRemoveThingFromPos(getCreaturePosition(cid), 1)

 

adiciona isso no script e remove as parada de prende

pois nao lerei isso tudo apesar de ja ter lido, mas n lembro mias

Atenciosamente,
Wiltry
<div align='center'><b>Wiltry 2008~2009</b></div>
<div align='center'>Mapper & Scripter</div>
<div align='center'><img src="http://img263.imageshack.us/img263/9130/beyond.png" border="0" class="linked-sig-image" /></div>
vlw guww :*

Paulistasks

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/09/09Posts: 76Char no Tibia: Danth Enix

Ahh, vlw aew, mas eu não manjo nada disso, não sei o que tenho que remover, eu removi umas linhas aqui e agr ele ta fazendo todos kikarem de 15 em 15 segundos

Last Job:



sign2h.png

 

Neobux Member:

downloaduc.gif

thaleees

Live, Live and Live
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/12/08Posts: 60

Tenta isso:

-- Yunie Anti Bot System

-- XTibia Forums

-- www.xtibia.com/forum/

 

 

-- 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=83,y=122,z=7} -- if don't answer, go to this pos

local prisionminutes = 10 -- time inside the prision

local templepos = {x=95, y=117, 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})

doRemoveThingFromPos(getCreaturePosition(cid), 1)

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, "Yunie Anti Bot System: Hello, "..playername.."! You have ".. mintoanswer .." minute(s) to answer how much is ".. first_num .." + ".. second_num ..". To answer say: !antibot \"number.")

doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Example: 20+20 = 40, then you would say !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

doRemoveThingFromPos(getCreaturePosition(cid), 1)

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, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s) because answered many wrong times.")

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, "Time limit! You had been prisioned for ".. 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, "Yunie Anti Bot System: You are ok, but in some minutes you are going to be asked again.")

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, "You had completed your time here in the prision! You may now relog to go to the city.")

else

prisionEvent = addEvent(checkprisioned,1000,{cid=cid})

end

end

end

 

Depois retire as linhas que achar desnecessária.

Como o de adicionar o storage ao player preso e as mensagens de prisão.

Gostou do meu trabalho? Use meu fan bar:




Meu Open Tibia Server:



Hunted Server

www.HuntedServer.com.br

24 Hrs

Venha conheçer o maior otserv do Brasil!


--

13:00 Ogreonee [40]: como hago para encartar un small ruby?
13:01 ThaLeeeS [10]: tiene q hacer un boquete
13:01 Ogreonee [40]: como un boquete?

Paulistasks

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/09/09Posts: 76Char no Tibia: Danth Enix

Aew, agr sim, vlw ;D

Last Job:



sign2h.png

 

Neobux Member:

downloaduc.gif

\Mattheus ~*

Ex Moderador
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 11/02/09Posts: 559Char no Tibia: Deep Druid

Pedido entregue, Paulistasks não esqueça de quando seu pedido for entregue reporte o tópico para que um moderador feche-o.

 

Tópico fechado,

Feliz Natal.

[/ Construçãao .