1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Captcha! Anti-AFK checker 0.51

Allows admins to reduce afk resource gathering or other automated activities on their shards.

  1. Praxiiz
    Introduction
    This captcha system allows admins to reduce afk resource gathering or other automated activities on their shards.

    It is setup so that it prompts a player maximum of once an hour when they use a skill tool or try to harvest something. This one hour minimum delay can be customized.

    Features
    • Designed to be minimally invasive to players
    • Adjustable minimum delay (defaults to an hour, which means players will only see it once an hour and only if they harvest or use a skill tool)
    • Passive, using no timers
    • Character rotations degrees can be modified (default +/- 30 degrees)
    • Randomized hues
    • Includes a very rudimentary font editor
    Limitations
    The font editor is really minimal. It lacks a save function. To update fonts, you use the [dumpfonts command and copy the updated array from the console and paste it into the script. I used it to create the fonts, but never really intended it to be used by others, which is why it looks so plain.
    Screenshots
    captcha1.PNG

    captcha2.PNG

    captcha3.PNG

    Minimal Font Editor
    captcha_font_editor1.PNG

    captcha_font_editor2.PNG



    Installation

    PlayerMobile.cs must be modified. Right under the line:
    Code (C#):
    1. public partial class PlayerMobile : Mobile, IHonorTarget
    2.     {


    Add this code:
    Code (C#):
    1.  
    2.   /* Begin Captcha Mod */
    3.     private DateTime _NextCaptchaTime;
    4.     public DateTime NextCaptchaTime
    5.     {
    6.         get { return _NextCaptchaTime;}
    7.         set { _NextCaptchaTime = value; }
    8.     }
    9.  
    10.     [CommandProperty(AccessLevel.Seer)]
    11.     public TimeSpan CaptchaDelay
    12.     {
    13.         get
    14.         {
    15.             if (DateTime.Now >= _NextCaptchaTime)
    16.                 return TimeSpan.FromSeconds(0);
    17.  
    18.             return (_NextCaptchaTime - DateTime.Now);
    19.         }
    20.         set { _NextCaptchaTime = DateTime.Now + value; }
    21.     }
    22. /* End Captcha Mod */
    23.  
    Add the following statement to the top of each of the files that need to be modified:
    Code (C#):
    1. using Server.Gumps
    The following files should be modified as follows:

    basefolder\Scripts\Services\BulkOrders\LargeBOD.cs double click method:
    Code (C#):
    1.  
    2.         public override void OnDoubleClick( Mobile from )
    3.         {
    4.         if (IsChildOf(from.Backpack) || InSecureTrade || RootParent is PlayerVendor)
    5.       {
    6.  
    7.   /* Being Captcha Mod */
    8.   Gump bod_gump = new LargeBODGump(from, this);
    9.   CaptchaGump.sendCaptcha(from, CaptchaGump.SendGumpAfterCaptcha, bod_gump);
    10.   /* End Captcha Mod */
    11.  
    12.   //from.SendGump(new LargeBODGump(from, this));
    13.  
    14.       }
    15.       else
    16.         from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it.
    17.         }
    18.  
    basefolder\Scripts\Services\BulkOrders\SmallBOD.cs double click method:

    Code (C#):
    1. public override void OnDoubleClick( Mobile from )
    2. {
    3.   if (this.IsChildOf(from.Backpack) || this.InSecureTrade || this.RootParent is PlayerVendor || this.Parent == from)
    4.   {
    5.     Gump bod_gump = new SmallBODGump(from, this);
    6.     CaptchaGump.sendCaptcha(from, CaptchaGump.SendGumpAfterCaptcha, bod_gump);
    7.  
    8.     //from.SendGump(new SmallBODGump(from, this));
    9.   }
    10.   else
    11.     from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it.
    12. }
    13.  
    basefolder\Scripts\Services\Harvest\Core\HarvestSystem.cs BeginHarvesting method:
    Code (C#):
    1.         public virtual bool BeginHarvesting( Mobile from, Item tool )
    2.         {
    3.             if ( !CheckHarvest( from, tool ) )
    4.                 return false;
    5. /* Begin Captcha Mod */
    6.             CaptchaGump.sendCaptcha(from, HarvestSystem.SendHarvestTarget, new object[]{tool, this});
    7. /* End Captcha Mod */
    8.  
    9.             //from.Target = new HarvestTarget( tool, this );
    10.             return true;
    11.         }
    12.  
    13. /* Begin Captcha Mod */
    14.         public static void SendHarvestTarget(Mobile from, object o)
    15.         {
    16.             if (!(o is object[]))
    17.                 return;
    18.             object[] arglist = (object[])o;
    19.  
    20.             if (arglist.Length != 2)
    21.                 return;
    22.  
    23.             if (!(arglist[0] is Item))
    24.                 return;
    25.  
    26.             if (!(arglist[1] is HarvestSystem))
    27.                 return;
    28.            
    29.             from.Target = new HarvestTarget((Item)arglist[0], (HarvestSystem)arglist[1] );
    30.         }
    31. /* End Captcha Mod */
    32.  
    basefolder\Scripts\Items\- BaseClasses\BaseTool.cs

    Code (C#):
    1.         public override void OnDoubleClick( Mobile from )
    2.         {
    3.             CaptchaGump.sendCaptcha(from, BaseTool.OnDoubleClickRedirected, this);
    4.             //OnDoubleClickRedirected(from, this);
    5.         }
    6.   public static void OnDoubleClickRedirected(Mobile from, object o)
    7.   {
    8.   if (o == null || (!(o is BaseTool)))
    9.   return;
    10.  
    11.   BaseTool tool = (BaseTool)o;
    12.  
    13.   if (tool.IsChildOf(from.Backpack) || tool.Parent == from)
    14.   {
    15.   CraftSystem system = tool.CraftSystem;
    16.  
    17.   int num = system.CanCraft(from, tool, null);
    18.  
    19.   if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
    20.   {
    21.   from.SendLocalizedMessage(num);
    22.   }
    23.   else
    24.   {
    25.   CraftContext context = system.GetContext(from);
    26.  
    27.   from.SendGump(new CraftGump(from, system, tool, null));
    28.   }
    29.   }
    30.   else
    31.   {
    32.   from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
    33.   }
    34.   }
    35.  
    Credits
    Hank for background fix
    Greed likes this.

Recent Updates

  1. Bug Fixes

Recent Reviews

  1. Hank
    Hank
    5/5,
    Version: 0.50
    A great anti-afk checker for afk resource gathering and crafting. Scripts are very straight forward allowing you to easily integrate this afk check with any other activities. I definitely recommend checking this out. Simple but extremely effective.