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.







info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char 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 endAgora vá em talkactions e crie um arquivo lua chamado de resp e coloque isto:
Coloque esta tag em talkactions.xml:
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 endColoque esta tag em creaturescrips.xml:
Registre o evento em login.lua:
registerCreatureEvent(cid, "bot")