• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Mods] Anti-Bot by Potar (MOD by me) (Tfs 0.4)

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    Hola usuarios de tibiaface


    bueno aqui le dejo un sistema de antibots systems
    mods/antibot_system.xml
    nos vamos a mods y copiamos un archivo y renombramos por antibot_system.xml y pegamos esto dentro:


    Código:
    <?xml version="1.0" encoding="UTF-8"?>
     
    <!-- scripts and functions by Potar -->
    <!-- tested on TFS 0.4 rev 3777 (Fir3Element) -->
    <!-- trains the character when clicking on a train statue -->
    <!-- the global event is set to check every 20 minutes (1200000 miliseconds) -->
    <!-- needs lib/177-AntiBot.lua (look at the end of the file) -->
     
    <mod name="AntiBot System" version="1.0" author="" contact="OTLand" enabled="yes">
     
      <config name="antibot_config"><![CDATA[
          config = {
              minimumLevelToCheck = 40,
              secondsAfterKillToCheck = 60,
              secondsForPlayerAnswer = 300,
              warningsForBan = 3,
              teleportToPrison = false,
              prisonPosition = {x = 0, y = 0, z = 0},
              hoursBanished = 24,
              textAfterWarning = "You received a warning, on the 3rd you will be banished. Keep playing but stop botting!",
              storageBase = 77000,
              storageKill = 77001,
              storageNumWrongAnswers = 77002,
              storageNumWarnings = 77003,
              storageIgnoreUsers = 77004,
              storageCanUseTalkaction = 77005,
              storagePlayerRandomNumber = 77006
          }
      ]]></config>
     
      <event type="kill" name="antibot" event="buffer"><![CDATA[
          domodlib('antibot_config')
          if isPlayer(target) or isSummon(target) then return true end 
                AB_SYSTEM_set(cid, config.storageKill, os.time())
      ]]></event>
     
      <event type="login" name="antibot" event="buffer"><![CDATA[
          registerCreatureEvent(cid, "antibot")
      ]]></event>
     
      <globalevent name="antibot" interval="1200000" event="buffer"><![CDATA[
          domodlib('antibot_config')
          local minutesToAnswer = ((config.secondsForPlayerAnswer) / 60)
          for _, name in ipairs(getOnlinePlayers()) do
              local cid = getPlayerByName(name)
              local player = getPlayerGUIDByName(name)
              local account = getAccountIdByName(name)
              local value1 = AB_SYSTEM_get(cid,config.storageKill)
              local value2 = config.secondsAfterKillToCheck
              local value3 = value1 + value2
              if isPlayer(cid) and value3 >= os.time() and getPlayerLevel(cid) >= config.minimumLevelToCheck and AB_SYSTEM_get(cid,config.storageIgnoreUsers) <= 0 and AB_SYSTEM_get(cid,config.storageCanUseTalkaction) <= 0 then
                  AB_SYSTEM_set(cid, config.storageCanUseTalkaction, 1)
                  AB_SYSTEM_set(cid, config.storagePlayerRandomNumber, math.random(10000,99999)) -- random number!
                  AB_SYSTEM_send_player_white_text(cid, "You have "..minutesToAnswer.." minutes to say: !antibot "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber).." or you will receive a warning, but if it is your "..config.warningsForBan.."rd warning you will be banished.")
                  AB_SYSTEM_send_player_red_text(cid, "You have "..minutesToAnswer.." minutes to say: !antibot "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber).." or you will receive a warning, but if it is your "..config.warningsForBan.."rd warning you will be banished.")
              --System 
              addEvent(function ()
              if isOnline(player) == TRUE then
                  if AB_SYSTEM_get(cid,config.storageCanUseTalkaction) >= 1 then
                      local how = AB_SYSTEM_get(cid,config.storageNumWarnings)
                      AB_SYSTEM_set(cid, config.storageCanUseTalkaction, 0)
                      AB_SYSTEM_set(cid, config.storagePlayerRandomNumber, 0)
           
                      if  how <= 0 then
                          AB_SYSTEM_set(cid, config.storageNumWarnings, 1)
                          AB_SYSTEM_send_player_red_text(cid, config.textAfterWarning)
                          AB_SYSTEM_send_player_white_text(cid, config.textAfterWarning)
                      elseif how == 1 then
                          AB_SYSTEM_set(cid, config.storageNumWarnings, 2)
                          AB_SYSTEM_send_player_red_text(cid, config.textAfterWarning)
                          AB_SYSTEM_send_player_white_text(cid, config.textAfterWarning)
                      elseif how >= 2 then
                          doTeleportThing(cid, config.prisonPosition)
                          AB_SYSTEM_set(cid, config.storageNumWarnings, 0)
                          doAddAccountBanishment(account, player, config.hoursBanished * 3600 + os.time(),12, ACTION_BANISHMENT, "Cavebotting")
                          doRemoveCreature(cid)
                      end
                  end
              end
              end,config.secondsForPlayerAnswer * 1000)
              --EndSystem
              end
          end
      ]]></globalevent>
     
      <talkaction log="yes" words="!antibot;/antibot" event="buffer"><![CDATA[
          domodlib('antibot_config')
          if AB_SYSTEM_get(cid,config.storageCanUseTalkaction) >= 1 then
              if(param == '') then
                  AB_SYSTEM_send_player_red_text(cid, "Invalid param, just say !antibot "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber)..".")
                  AB_SYSTEM_send_player_white_text(cid, "Invalid param, just say !antibot "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber)..".")
                  return true
              end
              if param == ''..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber)..'' then
                  AB_SYSTEM_set(cid, config.storageCanUseTalkaction, 0)
                  AB_SYSTEM_set(cid, config.storagePlayerRandomNumber, 0)
                  AB_SYSTEM_set(cid, config.storageNumWrongAnswers, 0)
                  AB_SYSTEM_send_player_red_text(cid, "Thank you for the correct answer.")
                  AB_SYSTEM_send_player_white_text(cid, "Thank you for the correct answer.")
              else
                  local player = getPlayerGUIDByName(cid)
                  local account = getAccountIdByName(cid)
                  local how = AB_SYSTEM_get(cid,config.storageNumWarnings)
                  local how2 = AB_SYSTEM_get(cid,config.storageNumWrongAnswers)
                  local how3 = how2 + 1
                  AB_SYSTEM_set(cid, config.storageNumWrongAnswers, how3)
                  local how5 = AB_SYSTEM_get(cid,config.storageNumWrongAnswers)
                  AB_SYSTEM_send_player_red_text(cid, "Wrong secure code, your secure code is "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber).." that was your "..how3.." time of "..config.warningsForBan.." wrong answers.")
                  AB_SYSTEM_send_player_white_text(cid, "Wrong secure code, your secure code is "..AB_SYSTEM_get(cid,config.storagePlayerRandomNumber).." that was your "..how3.." time of "..config.warningsForBan.." wrong answers.")
                  if how5 == 3 then
                      AB_SYSTEM_set(cid, config.storageCanUseTalkaction, 0)
                      AB_SYSTEM_set(cid, config.storagePlayerRandomNumber, 0)
                      AB_SYSTEM_set(cid, config.storageNumWrongAnswers, 0)
                          if  how <= 0 then
                              AB_SYSTEM_set(cid, config.storageNumWarnings, 1)
                              doTeleportThing(cid, config.prisonPosition)
                              AB_SYSTEM_send_player_red_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                              AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                          elseif how == 1 then
                              AB_SYSTEM_set(cid, config.storageNumWarnings, 2)
                              doTeleportThing(cid, config.prisonPosition)
                              AB_SYSTEM_send_player_red_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                              AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                          elseif how >= 2 then
                              doTeleportThing(cid, config.prisonPosition)
                              AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 0)
                              doAddAccountBanishment(account, player, config.hoursBanished * 3600 + os.time(),12, ACTION_BANISHMENT, "Cavebotting")
                              doRemoveCreature(cid)
                          end
                  end
              end
          else
          AB_SYSTEM_send_player_red_text(cid, "The AntiBot system is not already available for you.")
          AB_SYSTEM_send_player_white_text(cid, "The AntiBot system is not already available for you.")
          end
      ]]></talkaction>
    </mod>

    luego nos vamos a data/lib copiamos cualquier archivo y renombremos por 177-AntiBot.lua y luego pegamos esto dentro

    Código:
    --[[
        Anti Bot System by Potar
        ver.: 1.00 (2012-12-24)
        contact.: View Profile: Potar - OtLand
        file.: LIB
    ]]--
    function AB_SYSTEM_get(cid, a_storage)
        return getPlayerStorageValue(cid, a_storage)
    end
    function AB_SYSTEM_set(cid, b_storage, b_value)
        setPlayerStorageValue(cid, b_storage, b_value)
    end
    function AB_SYSTEM_send_player_white_text(cid, text)
        doPlayerSendTextMessage(cid, 22, text)
    end
    function AB_SYSTEM_send_player_red_text(cid, text)
        doPlayerSendTextMessage(cid, 18, text)
    end
    function isOnline(player)
        local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";")
        local on = rows:getDataInt("online")
            if on ~= 0 then
                return TRUE
            else
                return FALSE
            end
    end
    function isSummon(cid)
        return getCreatureMaster(cid) ~= nil
    end

    y listo.






    Ver perfil de usuario http://www.tibiaface.com

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).