[ANTI - BOT]Question System

caotic
Por caotic
em Mods, funções e outros

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

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.

LuckOake

avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 23/07/12Posts: 1104Gênero: MasculinoChar no Tibia: Luck Oake

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.

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

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.

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

o mais legal é que eu queria exclusividade (y)

Fabio Augustus - Infraestrutura

Skype: guhsvasc

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

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

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

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

bossisg.png

UmSerQualquer

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/10/18Posts: 12

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