Postado Abril 13, 2013 12 anos Como muitos sistemas anti-bot, a sua base é de um código que é gerado aleatoriamente. Onde esta é diferente, porém, é um pouco no log de bate-papo, o código aparece em uma janela pop-up. Assim, os jogadores exigindo que quer lembrar, ou escrever no bloco de notas brevemente. Ele poderia facilmente ser alterado para não mostrar os símbolos também. Vamos Lá! Vá em data/creaturescripts/scripts, abra login.lua e adicione isso - 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) Ainda em creaturescripts/scripts, copie um arquivo .lua, renomeie para antibot e adicione isso -(OBS - Defina a cordenada de uma tile em sua trainer area ou templo. Atrás de uma porta, ou teleport é recomendado) local timeBetweenQuestion = 35 * 60 --35 minutes local timeToKick = 2 * 45 --1.5 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, 0) end return doTeleportThing(cid, {x = 26026, y = 26036, z = 5}) 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, "[Anti-Bot]: Please say !antibot followed by your code without symbols.") doPlayerPopupFYI (cid, "Here is your code! !antibot"..code.." Type in the numbers without symbols.") end return end local symbols = {"*", "^", "¿", "%", "&", "$"} Em creaturescripts.xml, adicione a seguinte tag - <event type="think" name="Antibot" event="script" value="antibot.lua"/> Agora vá em data/talkactions/scripts, copie um arquivo .lua e renomeie para antibot, adicione isso (LEMBRE DE ESCOLHER AS CORDENADAS NOVAMENTE!) - 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) doTeleportThing(cid, {x = 26026, y = 26036, z = 5}) return true else return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: You have 3 total opportunities to try to get the correct answer.") end end return true end Adicione as tag's em talkactions.xml - <talkaction log="yes" access="4" words="/botcheck;!botcheck" event="script" value="botcheck.lua"/> <talkaction words="!antibot" event="script" value="antibot.lua"/> /botcheck player_name Utilizado de imediato requer um jogador para utilizar o código. Vá em data/talkactions/scripts, copie um arquivo .lua e renomeie para botcheck, adicione isso - -- BY SUPOMGLOL local timeStorage = 65117 local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 local timeBetweenQuestion = 9999 * 60 --training time local timeToKick = 2 * 45 --1.5 minutes function onSay(cid, words, param, channel) local pid = 0 if(param == '') then pid = getCreatureTarget(cid) if(pid == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end else pid = getPlayerByNameWildcard(param) end if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.") return true end if(isPlayer(pid) and getPlayerAccess(pid) >= getPlayerAccess(cid)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot botcheck this player.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been botchecked.") doCreatureSetStorage(pid, codeStorage, set) doCreatureSetStorage(pid, kickStorage, os.time() + timeToKick) doCreatureSetStorage(pid, timeStorage, os.time()- timeBetweenQuestion) doPlayerPopupFYI(pid, "You are under GM watch. Respond now.") return true end OPCIONAL! Quer que seu server permita o treinamento em AFK? Vá em data/movements/scripts, copie um arquivo .lua e renomeie para Training Tiles, adicione isso - -- BY SUPOMGLOL local timeStorage = 65117 local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 local timeBetweenQuestion = 9999 * 60 --training time local timeToKick = 2 * 45 --1.5 minutes function onStepIn(cid, item, position, fromPosition) if item.actionid == 8410 then doCreatureSetStorage(cid, codeStorage, set) doCreatureSetStorage(cid, kickStorage, 0) doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Anti-Bot]: You're welcome to use a bot to train. You have 9999 minutes of training left!") doPlayerPopupFYI (cid, "You will no longer recieve ANTI-BOT checks!") elseif item.actionid == 8411 then doCreatureSetStorage(cid, codeStorage, set) doCreatureSetStorage(cid, kickStorage, os.time() + timeToKick) doCreatureSetStorage(cid, timeStorage, os.time()- timeBetweenQuestion) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You will now recieve random ANTI-BOT checks!") return end end Vá em movements.xml, e adicione as seguintes tag's - <movement type="StepIn" actionid="8410" event="script" value="training tiles.lua"/> <movement type="StepIn" actionid="8411" event="script" value="training tiles.lua"/> Então você deve definir sua tile em trainers com a action 8410, e sua tile de saida para trainers com a actions 8411. (Em seu mapper editor!) Como explicado abaixo -e aqui -Bem, espero que gostem!Créditos - supomglol ►[Mega Topic] Seu Primeiro Open Tibia Server◄ ►Lista Dos Meus Trabalhos◄
Postado Janeiro 13, 2015 10 anos Gostaria que explicasse como funciona isto... Eu não entendi muito bem... Preciso de um anti-bot, mas preciso saber como funciona este..
Postado Maio 18, 2015 10 anos please help me Error: [18/5/2015 3:5:5] [Error - CreatureScript Interface] [18/5/2015 3:5:5] data/creaturescripts/scripts/antibot.lua:onThink [18/5/2015 3:5:5] Description: [18/5/2015 3:5:5] data/creaturescripts/scripts/antibot.lua:39: attempt to call global 'doPlayerPopupFYI' (a nil value) [18/5/2015 3:5:5] stack traceback: [18/5/2015 3:5:5] data/creaturescripts/scripts/antibot.lua:39: in function <data/creaturescripts/scripts/antibot.lua:11>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.