Praxiiz

Member
Praxiiz submitted a new resource:

Captcha! Anti-AFK checker - Allows admins to reduce afk resource gathering or other automated activities on their shards.

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...

Read more about this resource...
 
I followed the directions on the resource page, yes i added using Server.Gumps; to all the modified scripts
I am getting the following errors

Code:
Errors:
+ Items/- BaseClasses/BaseTool.cs:
    CS0117: Line 165: 'Server.Items.BaseTool' does not contain a definition for 'OnDoubleClickRedirected'
+ Services/BulkOrders/SmallBOD.cs:
    CS0117: Line 214: 'Server.Items.BaseTool' does not contain a definition for 'OnDoubleClickRedirected'
    CS0246: Line 225: The type or namespace name 'CraftSystem' could not be found
       (are you missing a using directive or an assembly reference?)
    CS0246: Line 233: The type or namespace name 'CraftContext' could not be found
       (are you missing a using directive or an assembly reference?)
    CS0246: Line 234: The type or namespace name 'CraftGump' could not be found
       (are you missing a using directive or an assembly reference?)
 
Last edited by a moderator:
Sorry about that, I added the rest of that method and corrected a couple of the others. It should be working now.
 
Thank you for the quick fix, it is working now. I really like how it works. It is everything you listed in the features!
Is it possible to show what is being typed?
 
The shard I developed it on uses custom hues. I'll have to look at the gump and change it to something with some better contrast.
 
I changed setupBackground in Captcha.cs to this and it's very visible now. I also made a small change that reduced the number of gump images.
example.jpg
Code:
private void setupBackground()
        {
            AddImage(0, 3, 9274); //9274 dark Grey Background
            AddImage(68, 3, 9274);
            AddImage(38, 11, 9158); //9158 are the Tiny dots on the gump
            AddImage(83, 11, 9158);
            AddImage(137, 11, 9158);
            AddImage(191, 11, 9158);
            AddImage(92, 11, 9158);
            AddImage(146, 11, 9158);
            AddImage(38, 56, 9158);
            AddImage(83, 56, 9158);
            AddImage(137, 56, 9158);
            AddImage(191, 56, 9158);
            AddImage(92, 56, 9158);
            AddImage(146, 56, 9158);
            AddImage(4, 129, 9157);
            AddImage(20, 129, 9157);
            AddImage(36, 129, 9157);
            AddImage(52, 129, 9157);
            AddImage(68, 129, 9157);
            AddImage(84, 129, 9157);
            AddImage(100, 129, 9157);
            AddImage(116, 129, 9157);
            AddImage(132, 129, 9157);
            AddImage(148, 129, 9157);
            AddImage(164, 129, 9157);
            AddImage(180, 129, 9157);
            AddImage(196, 116, 9155);
            AddImage(196, 100, 9155);
            AddImage(196, 84, 9155);
            AddImage(196, 68, 9155);
            AddImage(196, 52, 9155);
            AddImage(196, 36, 9155);
            AddImage(196, 20, 9155);
            AddImage(196, 4, 9155);
            AddImage(1, 1, 9151);
            AddImage(17, 1, 9151);
            AddImage(33, 1, 9151);
            AddImage(49, 1, 9151);
            AddImage(65, 1, 9151);
            AddImage(81, 1, 9151);
            AddImage(97, 1, 9151);
            AddImage(113, 1, 9151);
            AddImage(129, 1, 9151);
            AddImage(145, 1, 9151);
            AddImage(161, 1, 9151);
            AddImage(177, 1, 9151);
            AddImage(183, 1, 9151);
            AddImage(55, 101, 2443, 1153); //Image where you entry Text (1153 is the hue)
            AddButton(124, 101, 247, 248, 2, GumpButtonType.Reply, 0);
            AddImage(29, 34, 9158);
            AddImage(23, 34, 9158);
            AddImage(17, 34, 9158);
            AddImage(11, 34, 9158);
            AddImage(11, 40, 9158);
            AddImage(11, 46, 9158);
            AddImage(11, 52, 9158);
            AddImage(11, 58, 9158);
            AddImage(11, 64, 9158);
            AddImage(11, 70, 9158);
            AddImage(11, 76, 9158);
            AddImage(11, 82, 9158);
            AddImage(11, 88, 9158);
            AddImage(11, 94, 9158);
            AddImage(11, 100, 9158);
            AddImage(11, 106, 9158);
            AddImage(11, 112, 9158);
            AddImage(17, 112, 9158);
            AddImage(23, 112, 9158);
            AddImage(29, 112, 9158);
            AddImage(35, 112, 9158);
            AddImage(41, 112, 9158);
            AddImage(38, 115, 9158);
            AddImage(38, 112, 9158);
            AddImage(38, 109, 9158);
            AddImage(35, 106, 9158);
            AddImage(35, 118, 9158);
            AddImage(32, 121, 9158);
            AddImage(32, 103, 9158);
            AddTextEntry(57, 103, 53, 20, 0, 3, @"");
            AddLabel(38, 67, 1153, @"Type the three letters"); //1153 is the hue
            AddImage(1, 116, 9153);
            AddImage(1, 100, 9153);
            AddImage(1, 84, 9153);
            AddImage(1, 68, 9153);
            AddImage(1, 52, 9153);
            AddImage(1, 36, 9153);
            AddImage(1, 20, 9153);
            AddImage(1, 4, 9153);



        }
 
Last edited by a moderator:
I made that script a couple years ago, there are much more efficient ways to build up the gump. Feel free to improve it.
 
Worked good for a long time and now:
Code:
===================Server Crash Report===================
Exception:
System.NullReferenceException:Object reference not set to an instance of an object
at Server.Gumps.CaptchaGump.OnResponse (Server.Network.NetState sender, Server.Gumps.RelayInfo info) [0x00000] in <filename unknown>:0
at Server.Network.PacketHandlers.DisplayGumpResponse (Server.Network.NetState state, Server.Network.PacketReader pvSrc) [0x00000] in <filename unknown>:0
at Server.Network.MessagePump.HandleReceive (Server.Network.NetState ns) [0x00000] in <filename unknown>:0
at Server.Network.MessagePump.Slice () [0x00000] in <filename unknown>:0
at Server.Core.Main (System.String[] args) [0x00000] in <filename unknown>:0
 
I'll try to answer this the best I can. Since the server wasn't in debug mode at the time, I won't know for sure which object was causing the null reference because we don't have a line number.

The most likely fix is to change line 519 from
Code:
  if (m_From == null || m_ActionObject == null)

to include the method parameters:
Code:
  if (m_From == null || m_ActionObject == null || sender == null || info == null)
 
Our server players send an info that properly complete captcha does not open the BOD window for smallbulks. Captcha with large BODs works properly. We'll check it on our test server. Also, here is our smallBOD file (latest servuo) with modification shared here.

EDIT:
Hmmm
I found different part of smallBOD code between shared here and placed on runuo.

Here on ServUO
if (tool.IsChildOf(from.Backpack) || tool.InSecureTrade || tool.RootParent is PlayerVendor || tool.Parent == from)
{
CraftSystem system = tool.CraftSystem;

RunUO website
if (tool.IsChildOf(from.Backpack) || tool.Parent == from)
{
CraftSystem system = tool.CraftSystem;
 

Attachments

  • SmallBOD.cs
    14 KB · Views: 3
Last edited:
I apologize for the confusion on the small bod modification. I have corrected the code.

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.
}
 
Hi again. Here is a screen of 2 fonts captcha only. I hope the screen will help you find a place that requires modification.
ai.imgur.com_RMvcfUF.jpg
 
Last edited:
Server Crash Report
===================

RunUO Version 0.5, Build 5357.16143
Operating System: Unix 3.10.23.6
.NET Framework: 4.0.30319.17020
Time: 2014-09-05 13:43:44
Mobiles: 45261
Items: 229966
Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at Server.Gumps.CaptchaGump.OnResponse (Server.Network.NetState sender, Server.Gumps.RelayInfo info) [0x00000] in <filename unknown>:0
at Server.Network.PacketHandlers.DisplayGumpResponse (Server.Network.NetState state, Server.Network.PacketReader pvSrc) [0x00000] in <filename unknown>:0
at Server.Network.MessagePump.HandleReceive (Server.Network.NetState ns) [0x00000] in <filename unknown>:0
at Server.Network.MessagePump.Slice () [0x00000] in <filename unknown>:0
at Server.Core.Main (System.String[] args) [0x00000] in <filename unknown>:0
 
Praxiiz - Unfortunately I am working on mono, myserver run by monoruntime via terminal console and I can not get a full debug report for this error. But this addon is truly sensational and fully effective for the elimination of passive sourcing of raw materials and production. Really - Five Stars
Mayby any of You know most better ubuntu and can tell me the way to run justuo through the terminal with monoruntime and debug mode?
 
Last edited:
Is there a more up to date version of this. Or a better one. For me it only checks when you first use tool if you first login after intiated you never see another gump.
 
Is this script still working correctly?
Warning! Players generally can't stand this system. You cannot run macros and respond to the captcha. It is extremely intrusive. Best to monitor your players and have penalties for afk gathering.
With the attached file 'Showoff.cs' allows you to cycle though all online players by teleporting to each one, allowing you to check on them, query them (see if they are afk)
 

Attachments

  • ShowOff.cs
    3.4 KB · Views: 19
Last edited:
Server Crash Report
===================

RunUO Version 1.0, Build 0.0
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 2.0.50727.8806
Time: 2020/6/20 22:14:12
Mobiles: 22756
Items: 1012694
Exception:
System.NullReferenceException: 未将对象引用设置到对象的实例。
在 Server.Gumps.CaptchaGump.OnResponse(NetState sender, RelayInfo info)
在 Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
在 Server.Network.MessagePump.HandleReceive(NetState ns)
在 Server.Network.MessagePump.Slice()
在 Server.Core.Main(String[] args)

======================================
Players reported to me:
Use RAZOR to write macro commands to read old tools.
Then, throw away the old tool, buy a new tool, use the macro directly (not double-click the new tool manually), pop up the verification code, enter the verification code, and immediately crash. Because the macro saved by RAZOR is the ID of the old tool, it crashes. Come on, how to solve it?
 
Still doesn't make sense as you are limiting yourself to .NET Framework: 2.0 ... We are about to go into Net 5 this fall, I would strongly reconsider your choice, you are creating issues for yourself!

Just some friendly advise as picking a server to use for a specific UO era is not a good way of looking at it IMHO. You should be able to use the latest ServUO and accomplish the same thing without sacrificing flexibility of coding as each .Net gives us more to use in our projects!
 
  • Like
Reactions: Dan
Still doesn't make sense as you are limiting yourself to .NET Framework: 2.0 ... We are about to go into Net 5 this fall, I would strongly reconsider your choice, you are creating issues for yourself!

Just some friendly advise as picking a server to use for a specific UO era is not a good way of looking at it IMHO. You should be able to use the latest ServUO and accomplish the same thing without sacrificing flexibility of coding as each .Net gives us more to use in our projects!

THANKS!!!
 
If anyone needs to use it in RunUO 1.0, I think the mentioned bug is here:
C#:
TextRelay tr_captcha = info.GetTextEntry(3);
if(tr_captcha.Text.Length != 3)

The code expects response to the captcha gump, but Razor is probably sending response to a craft gump. There is no text entry in the Razor response, hence the null reference exception.

It can be fixed like this:
C#:
TextRelay tr_captcha = info.GetTextEntry(3);
if(tr_captcha  == null || tr_captcha.Text.Length != 3)
Otherwise it is working good, even on RunUO 1 (with small changes to delegate usage).
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back