noobinhu 38 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 (editado) Bom, o Gesior fez um sistema destes se não me engano, porém não fui muito divulgado, eu mesmo nunca vi as sources do sistema dele, então hoje decidi fazer um sistema Anti Bot. Funcionamento do script: O sistema de tempo em tempo manda player para o player perguntando o resultado de uma conta de soma (números da conta gerados pelo sistema), então se o player não responder ou responder muitas vezes erradas ele é mandado para alguma prisão, algum lugar fechado, sem saída e automaticamente depois de um certo tempo configurado no script o player pode sair da prisão indo direto para o templo. Screenshoot do sistema: Adicionando o sistema em seu server: Primeiramente, adicione as tags em creaturescripts/creaturescripts.xml: <event type="login" name="AntiBotLogin" script="antibot.lua"/> <event type="logout" name="AntiBotLogout" script="antibot.lua"/> Logo após disso, faça um arquivo em creaturescripts/scripts chamado antibot.lua contendo: -- Yunie Anti Bot System-- XTibia Forums -- www.xtibia.com/forum/ -- configs local mintoanswer = 2 -- minutes to answer anti bot system local delayAntiBot = 30 -- minutes of delay of delayAntiBot local maxgroupid = 1 -- groupid higher than this don't have antiBotSystem Activated local prisionpos = {x=83,y=122,z=7} -- if don't answer, go to this pos local prisionminutes = 10 -- time inside the prision local templepos = {x=95, y=117, z=7} -- after the prisionminutes, back to this position (temple is recommended) -- end configs -- local variables local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129} -- end local variables function onLogin(cid) local prisioned = getPlayerStorageValue(cid,storages.prisioned) if (prisioned == 1) then local prisiontime = getPlayerStorageValue(cid,storages.prisiontime) local timenow = os.time() if (timenow >= prisiontime) then setPlayerStorageValue(cid,storages.prisiontime,0) setPlayerStorageValue(cid,storages.prisioned,0) doTeleportThing(cid, templepos) else prisionEvent = addEvent(checkprisioned,1000,{cid=cid}) doTeleportThing(cid, prisionpos) end end if (delayAntiBot <= mintoanswer) then debugPrint("Error! Anti Bot System debugs: variable delayAntiBot need to be higher than mintoanswer.") else if (getPlayerGroupId(cid) <= maxgroupid) then antiBotEvent = addEvent(antiBot,1000,{cid=cid}) else doPlayerSendTextMessage(cid, 20, "People with group ID higher than ".. maxgroupid .." don't have this system.") end end return TRUE end function onLogout(cid) stopEvent(prisionEvent) stopEvent(antiBotEvent) stopEvent(checkAnswerEvent) setPlayerStorageValue(cid,storages.first_num,0) setPlayerStorageValue(cid,storages.second_num,0) setPlayerStorageValue(cid,storages.result,0) setPlayerStorageValue(cid,storages.answer,0) setPlayerStorageValue(cid,storages.wrong_answers,0) return TRUE end function antiBot(parameters) local cid = parameters.cid local playerpos = getCreaturePosition(cid) local playerpz = getTilePzInfo(playerpos) local playername = getPlayerName(cid) local prisioned = getPlayerStorageValue(cid,storages.prisioned) if (playerpz ~= 1 and prisioned ~= 1) then local first_num = math.random(1,9) local second_num = math.random(1,9) local result = first_num+second_num setPlayerStorageValue(cid,storages.first_num,first_num) setPlayerStorageValue(cid,storages.second_num,second_num) setPlayerStorageValue(cid,storages.result,result) doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Hello, "..playername.."! You have ".. mintoanswer .." minute(s) to answer how much is ".. first_num .." + ".. second_num ..". To answer say: !antibot \"number.") doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Example: 20+20 = 40, then you would say !antibot \"40.") checkAnswerEvent = addEvent(checkAnswer,mintoanswer*60*1000,{cid=cid}) end antiBotEvent = addEvent(antiBot,delayAntiBot*60*1000,{cid=cid}) end function checkAnswer(parameters) local cid = parameters.cid local first_num = getPlayerStorageValue(cid,storages.first_num) local second_num = getPlayerStorageValue(cid,storages.second_num) local result = getPlayerStorageValue(cid,storages.result) local answer = getPlayerStorageValue(cid,storages.answer) local prisioned = getPlayerStorageValue(cid,storages.prisioned) local wrong_answers = getPlayerStorageValue(cid,storages.wrong_answers) if (wrong_answers > 3) then doTeleportThing(cid, prisionpos) setPlayerStorageValue(cid,storages.wrong_answers,0) setPlayerStorageValue(cid,storages.first_num,0) setPlayerStorageValue(cid,storages.second_num,0) setPlayerStorageValue(cid,storages.result,0) setPlayerStorageValue(cid,storages.answer,0) setPlayerStorageValue(cid,storages.prisioned,1) setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60)) doPlayerSendTextMessage(cid, 20, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s) because answered many wrong times.") prisionEvent = addEvent(checkprisioned,1000,{cid=cid}) else if (answer ~= 1 and prisioned ~= 1 and result > 0) then doTeleportThing(cid, prisionpos) setPlayerStorageValue(cid,storages.first_num,0) setPlayerStorageValue(cid,storages.second_num,0) setPlayerStorageValue(cid,storages.result,0) setPlayerStorageValue(cid,storages.answer,0) setPlayerStorageValue(cid,storages.prisioned,1) setPlayerStorageValue(cid,storages.wrong_answers,0) setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60)) doPlayerSendTextMessage(cid, 20, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s).") prisionEvent = addEvent(checkprisioned,1000,{cid=cid}) else setPlayerStorageValue(cid,storages.first_num,0) setPlayerStorageValue(cid,storages.second_num,0) setPlayerStorageValue(cid,storages.result,0) setPlayerStorageValue(cid,storages.answer,0) setPlayerStorageValue(cid,storages.prisioned,0) setPlayerStorageValue(cid,storages.wrong_answers,0) doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: You are ok, but in some minutes you are going to be asked again.") end end end function checkprisioned(parameters) local cid = parameters.cid local prisioned = getPlayerStorageValue(cid,storages.prisioned) local prisiontime = getPlayerStorageValue(cid,storages.prisiontime) local timenow = os.time() if (prisioned == 1) then if (timenow >= prisiontime) then doPlayerSendTextMessage(cid, 20, "You had completed your time here in the prision! You may now relog to go to the city.") else prisionEvent = addEvent(checkprisioned,1000,{cid=cid}) end end end Configure as variáveis em negrito de acordo com seu servidor e gosto, salve e feche. Em talkactions/talkactions.xml adicione a seguinte tag: <talkaction words="!antibot" script="antibot.lua"/> Agora faça um arquivo em talkactions/scripts chamado antibot.lua contendo: -- local variableslocal storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129} -- end local variables function onSay(cid, words, param) local first_num = getPlayerStorageValue(cid,storages.first_num) local second_num = getPlayerStorageValue(cid,storages.second_num) local result = getPlayerStorageValue(cid,storages.result) local answer = getPlayerStorageValue(cid,storages.answer) local prisioned = getPlayerStorageValue(cid,storages.prisioned) param = tonumber(param) if (prisioned ~= 1 and answer ~= 1 and result > 0) then if (param == result) then if (getPlayerStorageValue(cid,storages.wrong_answers) <= 3) then doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Right answer, thank you for answering.") setPlayerStorageValue(cid,storages.wrong_answers,0) setPlayerStorageValue(cid,storages.answer,1) setPlayerStorageValue(cid,storages.first_num,0) setPlayerStorageValue(cid,storages.second_num,0) setPlayerStorageValue(cid,storages.result,0) else doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Right answer, but you had already answered more than 3 wrong times.") end else doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: Wrong answer!") wrong_answers_now = getPlayerStorageValue(cid,storages.wrong_answers) setPlayerStorageValue(cid,storages.wrong_answers,wrong_answers_now+1) doPlayerSendTextMessage(cid, 20, "Yunie Anti Bot System: You had already got ".. getPlayerStorageValue(cid,storages.wrong_answers).." wrong answers! The limit is 3.") end end end Neste script acima não precisa configurar nada. As instruções são todas dadas dentro do jogo para os players durante a execução do sistema. Espero que usem, Yunie. Editado Janeiro 28, 2009 por noobinhu Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/ Compartilhar em outros sites More sharing options...
Darth Sidious 3 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Não te elogio mais! Toda vez você traz coisas novas para o xtibia, porquê não entrou na equipe? Você sim merecia, realmente cara dessa vez você se superou. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683707 Compartilhar em outros sites More sharing options...
Ththt 2 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Bela ideia esse script Parece com um sistema anit-bot de alguns servers de ragnarok Se a cip criasse um script desses.... =P Parabens Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683711 Compartilhar em outros sites More sharing options...
boladuu 0 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Muito criativo...so que pode se tornar meio injuativo ficar respondendo toda hr isso. Vlw pelo scritp^^ Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683712 Compartilhar em outros sites More sharing options...
CarlosPain 9 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Esse Script já exite fazem meses... Eu já ví isso em muitos otservs, acho que vocês visitam pouco as comunidades estrangeiras, por isso não sabiam. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683716 Compartilhar em outros sites More sharing options...
noobinhu 38 Postado Janeiro 25, 2009 Autor Share Postado Janeiro 25, 2009 (editado) Este script existe faz 3 horas amigo haha O outro que existe como já disse, acho que é do Gesior, eu procurei bastante e não achei. Pode me passar por PM ou por aqui mesmo o tópico que contém o sistema dele para mim olhar como ele fez? EDIT: E o dele bane acho, o meu manda para uma prisão durante um tempo. Editado Janeiro 25, 2009 por noobinhu Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683720 Compartilhar em outros sites More sharing options...
u n d e r 110 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Excelente script, porém alguns pontos que eu ressalto: - Tempo em tempo que a pergunta é enviada. - Como diferenciar 'afk' de 'botter'? De qualquer forma, adorei mesmo esta idéia. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683727 Compartilhar em outros sites More sharing options...
noobinhu 38 Postado Janeiro 25, 2009 Autor Share Postado Janeiro 25, 2009 O script não é ativado em áreas com protection zone, portanto um afk ficaria na pz, o tempo entre as execuções do sistema são configuradas no próprio script. local delayAntiBot = 30 -- minutes of delay of delayAntiBot Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683730 Compartilhar em outros sites More sharing options...
u n d e r 110 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Mas digamos que eu fique afk em uma área de caça, juntamente com alguém. Geralmente em hunts, isso ocorre (tomando como exemplo o Tibia global). O sistema entenderá que eu estou caçando. Seria possível ele identificar e enviar essas mensagens apenas aos players em movimento? (seria uma opção para evitar este tipo de diferença). Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683734 Compartilhar em outros sites More sharing options...
noobinhu 38 Postado Janeiro 25, 2009 Autor Share Postado Janeiro 25, 2009 Sim, mas este sistema não é somente para cavebot, funciona para treinamentos com bot, rune maker, ml training e todos outros tipos que o player deixe o bot por um tempo executando tal ação repetidas vezes sem estar no PC. E você pode configurar para ter até 10 minutos (ou mais) para responder o sistema anti bot, o que seria um tempo considerável para um player ficar afk/kick de internet (deslogaria o char). E qualquer coisa, o player não toma ban nem nada, só fica um tempo numa cadeia. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683738 Compartilhar em outros sites More sharing options...
u n d e r 110 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Muito bom cara, eu gostei bastante! O Tibia deveria levar a idéia adianta... viajando um pouco. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683740 Compartilhar em outros sites More sharing options...
Rotciv 2 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Muito bom Yunie! Parabéns brother Excelente script! Com certeza ajudará contra os botters! Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683744 Compartilhar em outros sites More sharing options...
ryandometal 0 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 Ótimo script cara, mas me responde uma coisa... E se a pessoa responder o sistema de maneira incorreta? Caso eu aperte uma tecla junta da outra por engano, eu vou ser preso ou não acontece nada? Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683749 Compartilhar em outros sites More sharing options...
u n d e r 110 Postado Janeiro 25, 2009 Share Postado Janeiro 25, 2009 A pessoa pode errar até três vezes. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683751 Compartilhar em outros sites More sharing options...
noobinhu 38 Postado Janeiro 25, 2009 Autor Share Postado Janeiro 25, 2009 Exato Alessandro. Link para o comentário https://xtibia.com/forum/topic/106097-yunie-anti-bot-system/#findComment-683755 Compartilhar em outros sites More sharing options...
Posts Recomendados