Ir para conteúdo

! Anti-Bot System ! + Tutorial


WarW0lf

Posts Recomendados

Como funciona?

 

- O Jogador precisa estar online por 15 minutos.

- O Anti Bot pedirá para que o player diga alguns números sem símbolos. Ex: [Antibot]: Por favor, diga AntiBot 5% 8 e 9 ^ 2 * 3 sem símbolos! Ficará: AntiBot 58923. Se o player não fizer isso em 2 minutos, ele é kikado.

- O Jogador tem 3 oportunidades para responder, se ele dizer 3 vezes o código errado, ele é kikado.

 

Instalando Sistema:

 

Vá em data/creaturescripts/scripts/ crie um arquivo chamado antibot.lua e cole isto:

 

 

local symbols = {"*", "^", "¿", "%", "&", "$"}

 

local timeBetweenQuestion = 15 * 60 --15 minutes

local timeToKick = 2 * 60 --2 minutes

local timeStorage = 65117

local codeStorage = 65118

local kickStorage = 65119

local timesStorage = 65121

 

function onThink(cid, interval)

if not isPlayer(cid) or getPlayerGroupId(cid) >= 3 then

return

end

 

if getCreatureStorage(cid, timeStorage) < 1 then doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) end

 

if getCreatureStorage(cid, kickStorage) > 0 and os.time() >= getCreatureStorage(cid, kickStorage) then

local tmp = {timeStorage, kickStorage, timesStorage, codeStorage}

for i = 1, #tmp do

doCreatureSetStorage(cid, tmp[i], 0)

end

return doRemoveCreature(cid)

end

 

if os.time() >= getCreatureStorage(cid, timeStorage) then

local code, set = "", 0

set = math.random(1, 100000)

local s, e = 1, 1

for i = 1, string.len(set) do

code = (code == "" and string.sub(set, s, e) or code .. symbols[math.random(#symbols)] .. string.sub(set, s, e))

s, e = s + 1, e + 1

end

 

doCreatureSetStorage(cid, codeStorage, set)

doCreatureSetStorage(cid, kickStorage, os.time() + timeToKick)

doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: Please say !antibot " .. code .. " without symbols. Ex: code: 1*5^8¿6%9 -> !antibot 15869. Remember that you have " .. timeToKick / 60 .. " minutes to do that or you will be kicked.")

end

return

end

 

Cole isto em data/creaturescripts/creaturescripts.xml:

 

 

XML Code:

 



<event type="think" name="Antibot" event="script" value="antibot.lua"/>

 

 

Cole isto em data/creaturescripts/scripts/login.lua:

 

Lua Code:

 

 



local timeStorage = 65117

local codeStorage = 65118

local kickStorage = 65119

local timesStorage = 65121

registerCreatureEvent(cid, "Antibot")

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doCreatureSetStorage(cid, timeStorage, 0)

Agora vá em data/talkactions/scripts,crie um arquivo chamado antibot.lua e cole isto:

 

 

 

Lua Code:

 



local codeStorage = 65118

local kickStorage = 65119

local timesStorage = 65121

local times = 3

 

function onSay(cid, words, param, channel)

 

if getCreatureStorage(cid, codeStorage) == 0 then

return doPlayerSendCancel(cid, "Not yet.")

elseif tonumber(param) == tonumber(getCreatureStorage(cid, codeStorage)) then

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: Enjoy your time!")

return true

else

if getCreatureStorage(cid, timesStorage) < 0 then doCreatureSetStorage(cid, timesStorage, 0) end

 

doCreatureSetStorage(cid, timesStorage, getCreatureStorage(cid, timesStorage) + 1)

if getCreatureStorage(cid, timesStorage) == times then

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doRemoveCreature(cid)

return true

else

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: You have " .. times - getCreatureStorage(cid, storageTimes) .. " opportunities to try it again.")

end

end

return true

end

Agora cole isto em data/talkactions/talkactions.xml:

 

XML Code:

 



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

 

E pronto, está instalado.

 

Créditos: Darkhaos e War W0lf :)

 

Agradeça, Comente e REP+

Editado por WarW0lf
Link para o comentário
Compartilhar em outros sites

Olá, obrigado pelos comentários, só não passarei para mods pois estou trabalhando em um novo script que postarei em breve aqui no Xtibia, por isso estou muito oculpado.

Desculpem...

 

Não se esqueçam do Rep+ mdr.gif

Link para o comentário
Compartilhar em outros sites

só kikado ? ;( teria como colocar por exemplo o player tem 11 minutos para responder o sistema se ele n responder ele seria banido se ele respondece errado o tempo continuaria passando e o sistema falaria resposta errada por favor responda !antibot 585858 se o player deslogar e logar dnv a mensagem aparecese na tela novamente até que ele respondese

Link para o comentário
Compartilhar em outros sites

aki deu esse erro

 

[04/08/2012 19:26:35] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/antibot.lua:1: '=' expected near 'Code'

[04/08/2012 19:26:35] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/antibot.lua)

[04/08/2012 19:26:35] data/talkactions/scripts/antibot.lua:1: '=' expected near 'Code'

[04/08/2012 19:26:35] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/antibot.lua:1: '=' expected near 'Code'

[04/08/2012 19:26:35] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/antibot.lua)

[04/08/2012 19:26:35] data/talkactions/scripts/antibot.lua:1: '=' expected near 'Code'

 

LOGIN

 

local config = {

loginMessage = getConfigValue('loginMessage'),

useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))

}

 

function onLogin(cid)

local loss = getConfigValue('deathLostPercent')

if(loss ~= nil) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 15)

end

 

local accountManager = getPlayerAccountManager(cid)

if(accountManager == MANAGER_NONE) then

local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage

if(lastLogin > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."

else

str = str .. " Please choose your outfit."

doPlayerSendOutfitWindow(cid)

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

elseif(accountManager == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(accountManager == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")

end

 

if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end

 

registerCreatureEvent(cid, "Mail")

registerCreatureEvent(cid, "GuildMotd")

 

registerCreatureEvent(cid, "Idle")

if(config.useFragHandler) then

registerCreatureEvent(cid, "SkullCheck")

end

 

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "SlotLogin")

registerCreatureEvent(cid, "FirstItems")

local timeStorage = 65117

local codeStorage = 65118

local kickStorage = 65119

local timesStorage = 65121

registerCreatureEvent(cid, "Antibot")

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doCreatureSetStorage(cid, timeStorage, 0)

return true

end

 

 

 

ajuda ae

 

<talkaction words="!r" event="script" value="antibot.lua"/>

 

Lua Code:

 

local codeStorage = 65118

local kickStorage = 65119

local timesStorage = 65121

local times = 3

 

function onSay(cid, words, param, channel)

 

if getCreatureStorage(cid, codeStorage) == 0 then

return doPlayerSendCancel(cid, "Not yet.")

elseif tonumber(param) == tonumber(getCreatureStorage(cid, codeStorage)) then

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: Enjoy your time!")

return true

else

if getCreatureStorage(cid, timesStorage) < 0 then doCreatureSetStorage(cid, timesStorage, 0) end

 

doCreatureSetStorage(cid, timesStorage, getCreatureStorage(cid, timesStorage) + 1)

if getCreatureStorage(cid, timesStorage) == times then

doCreatureSetStorage(cid, codeStorage, 0)

doCreatureSetStorage(cid, kickStorage, 0)

doCreatureSetStorage(cid, timesStorage, 0)

doRemoveCreature(cid)

return true

else

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: You have " .. times - getCreatureStorage(cid, storageTimes) .. " opportunities to try it again.")

end

end

return true

end

 

Editado por KennyxD
Link para o comentário
Compartilhar em outros sites

sobre esse sistema seria legal se fizese assim olha a mensagem apareceria no defalt e na tela pro player

 

20:12 [sistema Anti-Cheater] Responda 1209612 através do comando !r. Exemplo: !r 214. Você tem (00:11:00) para responder corretamente, caso contrário será banido.

20:12 [sistema Anti-Cheater] Responda 1209612 através do comando !r. Exemplo: !r 214. Você tem (00:10:46) para responder corretamente, caso contrário será banido.

20:12 [sistema Anti-Cheater] Responda 1209612 através do comando !r. Exemplo: !r 214. Você tem (00:10:32) para responder corretamente, caso contrário será banido.

20:12 Resposta correta, abordagem desativada.

20:12 [sistema Anti-Cheater] Pergunta respondida corretamente, abordagem desativada.

 

^^

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...