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
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
Minimal Font Editor
Installation
PlayerMobile.cs must be modified. Right under the line:
Add this code:
Add the following statement to the top of each of the files that need to be modified:
The following files should be modified as follows:
basefolder\Scripts\Services\BulkOrders\LargeBOD.cs double click method:
basefolder\Scripts\Services\BulkOrders\SmallBOD.cs double click method:
basefolder\Scripts\Services\Harvest\Core\HarvestSystem.cs BeginHarvesting method:
basefolder\Scripts\Items\- BaseClasses\BaseTool.cs
Credits
Hank for background fix
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
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
Minimal Font Editor
Installation
PlayerMobile.cs must be modified. Right under the line:
Code:
public partial class PlayerMobile : Mobile, IHonorTarget
{
Add this code:
Code:
/* Begin Captcha Mod */
private DateTime _NextCaptchaTime;
public DateTime NextCaptchaTime
{
get { return _NextCaptchaTime;}
set { _NextCaptchaTime = value; }
}
[CommandProperty(AccessLevel.Seer)]
public TimeSpan CaptchaDelay
{
get
{
if (DateTime.Now >= _NextCaptchaTime)
return TimeSpan.FromSeconds(0);
return (_NextCaptchaTime - DateTime.Now);
}
set { _NextCaptchaTime = DateTime.Now + value; }
}
/* End Captcha Mod */
Add the following statement to the top of each of the files that need to be modified:
Code:
using Server.Gumps
The following files should be modified as follows:
basefolder\Scripts\Services\BulkOrders\LargeBOD.cs double click method:
Code:
public override void OnDoubleClick( Mobile from )
{
if (IsChildOf(from.Backpack) || InSecureTrade || RootParent is PlayerVendor)
{
/* Being Captcha Mod */
Gump bod_gump = new LargeBODGump(from, this);
CaptchaGump.sendCaptcha(from, CaptchaGump.SendGumpAfterCaptcha, bod_gump);
/* End Captcha Mod */
//from.SendGump(new LargeBODGump(from, this));
}
else
from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it.
}
basefolder\Scripts\Services\BulkOrders\SmallBOD.cs double click method:
Code:
public override void OnDoubleClick( Mobile from )
{
if (this.IsChildOf(from.Backpack) || this.InSecureTrade || this.RootParent is PlayerVendor || this.Parent == from)
{
Gump bod_gump = new SmallBODGump(from, this);
CaptchaGump.sendCaptcha(from, CaptchaGump.SendGumpAfterCaptcha, bod_gump);
//from.SendGump(new SmallBODGump(from, this));
}
else
from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it.
}
basefolder\Scripts\Services\Harvest\Core\HarvestSystem.cs BeginHarvesting method:
Code:
public virtual bool BeginHarvesting( Mobile from, Item tool )
{
if ( !CheckHarvest( from, tool ) )
return false;
/* Begin Captcha Mod */
CaptchaGump.sendCaptcha(from, HarvestSystem.SendHarvestTarget, new object[]{tool, this});
/* End Captcha Mod */
//from.Target = new HarvestTarget( tool, this );
return true;
}
/* Begin Captcha Mod */
public static void SendHarvestTarget(Mobile from, object o)
{
if (!(o is object[]))
return;
object[] arglist = (object[])o;
if (arglist.Length != 2)
return;
if (!(arglist[0] is Item))
return;
if (!(arglist[1] is HarvestSystem))
return;
from.Target = new HarvestTarget((Item)arglist[0], (HarvestSystem)arglist[1] );
}
/* End Captcha Mod */
basefolder\Scripts\Items\- BaseClasses\BaseTool.cs
Code:
public override void OnDoubleClick( Mobile from )
{
CaptchaGump.sendCaptcha(from, BaseTool.OnDoubleClickRedirected, this);
//OnDoubleClickRedirected(from, this);
}
public static void OnDoubleClickRedirected(Mobile from, object o)
{
if (o == null || (!(o is BaseTool)))
return;
BaseTool tool = (BaseTool)o;
if (tool.IsChildOf(from.Backpack) || tool.Parent == from)
{
CraftSystem system = tool.CraftSystem;
int num = system.CanCraft(from, tool, null);
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
{
from.SendLocalizedMessage(num);
}
else
{
CraftContext context = system.GetContext(from);
from.SendGump(new CraftGump(from, system, tool, null));
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
Credits
Hank for background fix