CA

[ANTI - BOT]Question System

Por caotic, 26 de dez. de 2012 em Mods, funções e outros

anti bot
question system
anti bot for question
anti bot question system
otserv
tibia
script
5.0 (1)
7
2.8k
caoticC
26 de dezembro de 2012 às 13:53

O fabio(beeki) pediu um script para min então eu resolvi disponibilizar o mesmo script para vocês xtibianos!

 

O anti bot faz uma pergunta ao player quando ele loga e depois de X tempo.

Assim se o player estiver usando um bot de "caça sozinho" ele e detectado e teleportado para uma posição que seria uma cadeia.

 

Esta todo configurado mais pode ser alterado livremente.

 

 

Vá em lib e crie um arquivo lua chamado de anti bot e coloque este código:

 

local question = {
{perg = "1+1 e igual a?", resp = "2"},
{perg = "Qual e o nome verdadeiro do beeki", resp = "Fabio"},
{perg = "Você esta em que level?", resp = "100"}
}

function doJailforBot(cid, pos)
if isPlayer(cid) and getPlayerStorageValue(cid, 23410) == 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você foi preso por bot")
doTeleportThing(cid, pos)
setPlayerStorageValue(cid, 23446, 0)
setPlayerStorageValue(cid, 23448, 0)
setPlayerStorageValue(cid, 23412, 1)
end
return true
end
function respQuestion(cid, resp)
if getPlayerStorageValue(cid, 23410) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque ja respondeu")
end
if getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque você esta preso")
end
if tostring(getPlayerStorageValue(cid, 23446)) == resp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você acertou a respota")
setPlayerStorageValue(cid, 23410, 1)
return true
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você errou a resposta")
end

function activeAntiBot(cid, pos, time)
if isPlayer(cid) then
if getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você esta preso por uso de bot")
end
local random = math.random(#question)
local perg = question[random].perg
local resp = question[random].resp
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] diga a resposta falando /resp(reposta) ("..perg..")")
setPlayerStorageValue(cid, 23446, resp)
setPlayerStorageValue(cid, 23448, perg)
setPlayerStorageValue(cid, 23410, 0)
addEvent(doJailforBot, time, cid, pos)
end
return true
end

Agora vá em talkactions e crie um arquivo lua chamado de resp e coloque isto:

 

function onSay(cid, words, param, channel)
if not param or param == " " or param == ""  then
doPlayerSendCancel(cid, "Você precisa dizer a respota")
return true
end
return respQuestion(cid, param)
end

 

Coloque esta tag em talkactions.xml:

 

 

 

<talkaction words="/resp" event="script" value="resp.lua"/>

 

 

 

Agora vá em creaturescripts e crie um arquivo lua chamado de anti-bot e coloque isto:

 

local jail= {x=1497, y=1488, z=5}
local time = 36000
local temp = 3600*1000 --- Tempo para o sistema do anti banimento for ativado

function onLogin(cid)

function repeatAntiBot(cid, jail, temp, time)
activeAntiBot(cid, jail, time)
addEvent(activeAntiBot, temp, cid, jail, time)
end

repeatAntiBot(cid, jail, temp, time)
return true
end

 

Coloque esta tag em creaturescrips.xml:

 

 

 

<event type="login" name="bot" event="script" value="anti-bot.lua"/>

 

 

 

Registre o evento em login.lua:

registerCreatureEvent(cid, "bot")

 

Vamos as configurações basicas:

{perg = "Qual e o nome verdadeiro do beeki", resp = "Fabio"},

Em perg você deve colocar a pergunta que poderá aparecer.

Em resp deve colocar a resposta da pergunta.

Atenção ao colocar caracteres minusculos ou maisculos pois eles podem alterar a senha.

LuckOakeL
26 de dezembro de 2012 às 14:06

Legal o script, REP+

 

Só vai ai uma dica pra você. Nesse trecho:

 

if getPlayerStorageValue(cid, 23410) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque ja respondeu")
end
if getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque você esta preso")
end
if tostring(getPlayerStorageValue(cid, 23446)) == resp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você acertou a respota")
setPlayerStorageValue(cid, 23410, 1)
return true
end

 

Você poderia reduzir ele usando elseif, ficando assim:

 

if getPlayerStorageValue(cid, 23410) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque ja respondeu")
elseif getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque você esta preso")
elseif tostring(getPlayerStorageValue(cid, 23446)) == resp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você acertou a respota")
setPlayerStorageValue(cid, 23410, 1)
return true
end

 

Mas fica a seu critério, é apenas uma dica mesmo.

 

Anyway, legal o script.

Editado Dezembro 26 por LuckOake

caoticC
26 de dezembro de 2012 às 14:14

Legal o script, REP+

 

Só vai ai uma dica pra você. Nesse trecho:

 

if getPlayerStorageValue(cid, 23410) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque ja respondeu")
end
if getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque você esta preso")
end
if tostring(getPlayerStorageValue(cid, 23446)) == resp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você acertou a respota")
setPlayerStorageValue(cid, 23410, 1)
return true
end

 

Você poderia reduzir ele usando elseif, ficando assim:

 

if getPlayerStorageValue(cid, 23410) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque ja respondeu")
elseif getPlayerStorageValue(cid, 23412) == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] O sistema não esta ativo porque você esta preso")
elseif tostring(getPlayerStorageValue(cid, 23446)) == resp then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ANTI-BOT] Você acertou a respota")
setPlayerStorageValue(cid, 23410, 1)
return true
end

 

Mas fica a seu critério, é apenas uma dica mesmo.

 

Anyway, legal o script.

 

Num gosto.

Fica muito mais desorganizado..

 

Ate mais.

BeekiB
26 de dezembro de 2012 às 16:04

o mais legal é que eu queria exclusividade (y)

caoticC
26 de dezembro de 2012 às 16:21

o mais legal é que eu queria exclusividade (y)

 

Mais eu ia te dar exclusivo.

Mais vc não me respondeu seu fdp.

Então resolvi postar.

Se quiser eu posso ate retirar para vc :3

Editado Dezembro 26 por caotic

VodkartV
26 de dezembro de 2012 às 16:25

se quer algo exclusivo, faça você mesmo... porque do contrário, cedo ou tarde vai alguém posta ;x

6 anos depois...
27 de janeiro de 2019 às 04:24

O que precisa mudar, quero que o script der kick no player?