Tibia Help
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.


aQii te ayudaremos con Tus Ot Servers
 
ÍndicePortalÚltimas imágenesRegistrarseConectarse
Conectarse
Nombre de Usuario:
Contraseña:
Entrar automáticamente en cada visita: 
:: Recuperar mi contraseña
Últimos temas
» TITULO: Mu Black Kindom | Season 6 | 3000x | 80% | Nuevos Ev
Sistema AntiBot I_icon_minitimeVie Oct 28, 2011 11:25 am por NAHUELLG

» (TUTORIAL) Como usar mage bomb =)
Sistema AntiBot I_icon_minitimeDom Oct 09, 2011 7:29 am por GOD Roca

» Mu Skzer l Season 6 l Exp: 1600x l Drop: 80%
Sistema AntiBot I_icon_minitimeJue Jul 07, 2011 2:57 am por NAHUELLG

» Mu Skzer l Season 6 l Exp: 1600x l Drop: 80%
Sistema AntiBot I_icon_minitimeMar Jun 28, 2011 10:49 am por dnange18

» Mu Online Season 6 Finallity, la batalla final comienza by sairenji
Sistema AntiBot I_icon_minitimeDom Jun 19, 2011 6:23 am por sairenji

» 9.x]-[8.7x]-[8.61/2]-[8.6]-[8.54/7] The Forgotten Server 0.3.6 - Crying Damson
Sistema AntiBot I_icon_minitimeMiér Jun 15, 2011 9:51 am por Orejon

» ayuda porfaah
Sistema AntiBot I_icon_minitimeJue Mayo 05, 2011 3:59 pm por Toniko

» Proyecto Dedicado Fennix Rl Map
Sistema AntiBot I_icon_minitimeJue Mayo 05, 2011 3:42 pm por Toniko

» Como uso mega magebomb 8.6
Sistema AntiBot I_icon_minitimeDom Mar 20, 2011 10:35 am por jasson

Mejores posteadores
God Sposo
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
Admin Necro
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
Admin Skit
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
Zir GaboX
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
Cubo
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
¤•~x Єℓ ώαtэr x~•¤
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
drawmarcos
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
chinodj
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
Toniko
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
meleq
Sistema AntiBot Vote_lcapSistema AntiBot Voting_barSistema AntiBot Vote_rcap 
¿Quién está en línea?
En total hay 2 usuarios en línea: 0 Registrados, 0 Ocultos y 2 Invitados

Ninguno

El record de usuarios en línea fue de 19 durante el Sáb Jun 20, 2020 8:57 am

 

 Sistema AntiBot

Ir abajo 
AutorMensaje
Admin Necro
ADMINISTRADOR
ADMINISTRADOR
Admin Necro


Mensajes : 64
Fecha de inscripción : 04/11/2010
Edad : 27
Localización : Mi Casa

Sistema AntiBot Empty
MensajeTema: Sistema AntiBot   Sistema AntiBot I_icon_minitimeSáb Nov 06, 2010 9:21 am

Sistema AntiBot

¿Cómo funciona?

Basicamente estás jugando y te llega un mensaje con una simple operación matemática, ej:

5+2= ?

y tu contestas !antibot 7

Sistema AntiBot Yunieantibotcs7

¿Cómo aplicarlo?

En creaturescripts.xml agrega estas lineas

Código:
-- configs
 local mintoanswer = 2 -- minutos para responder al antibot
 local delayAntiBot = 30 -- minutes of delay of delayAntiBot
 local maxgroupid = 1 -- a partir de que groupid no aplica el antibot
 local prisionpos = {x=83,y=122,z=7} -- si no respondes bien, coordenadas a donde seras enviado
 local prisionminutes = 10 -- tiempo dentro de la prision
 local templepos = {x=95, y=117, z=7} -- despues de la sentencia lugar a donde seras enviado
 -- 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, "Necro Anti Bot System: Hola, "..playername.."! Tienes ".. mintoanswer .." minute(s) para responder cuanto es ".. first_num .." + ".. second_num ..". Para responder di: !antibot "number.")
 doPlayerSendTextMessage(cid, 20, "Necro 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, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), 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, "Necro Anti Bot System: Correcto, pero volveras a ser cuestionado dentro de un tiempo.")
 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, "Haz completado tu sentencia, relogea para ir a la ciudad.")
 else
 prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
 end
 end
 end


Y agregar en talkactions.xml

Código:
-- 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 onSay(cid, words, param)
 local first_num, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), 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, "Necro 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, "Necro Anti Bot System: Right answer, but you had already answered more than 3 wrong times.")
 end
 else
 doPlayerSendTextMessage(cid, 20, "Necro 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, "Necro Anti Bot System: You had already got ".. getPlayerStorageValue(cid,storages.wrong_answers).." wrong answers! The limit is 3.")
 end
 end
 end


CREDITOS:


Creditos: Yunie De: otland
Volver arriba Ir abajo
https://tibiahelp.foroactivo.mx
 
Sistema AntiBot
Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
Tibia Help :: Scripts-
Cambiar a: