ParanoiaPhD

Member
I was able to figure out how to make it page the gm when they fail to enter the correct catcha but I have been unable to figure out how to get the code to compile. I've narrowed it down to this but at this point i think so actual coding is required. This makes it page gm with UNHANDLED when they enter the incorrect captcha text. I would like to add to this a way to make it to where they page when they cancel the captcha, use tool again without interacting with captcha, and preferably add a number of times they can do these things before page as it will get ultra annoying to have to constantly cancel the help requests people need atleast a few tries before the stop there macro.

C#:
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_From == null || m_ActionObject == null || sender == null || info == null)
            {
                return;
            }
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 2:
                {
                    TextRelay tr_captcha = info.GetTextEntry(3);
                    if(tr_captcha.Text.Length != 3 )
                    {
                        from.SendMessage("You failed to prove that you're not A.F.K.");
                        
                        
                        
                        
                        
                        from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));
            
            
            
            
            
            
                        return;
                    
                    }

                    if (Char.ToUpper(tr_captcha.Text[0]) != m_A || Char.ToUpper(tr_captcha.Text[1]) != m_B || Char.ToUpper(tr_captcha.Text[2]) != m_C)
                    {
                        from.SendMessage("You failed to prove that you're not A.F.K. ");
                        
                        
                        
                        
                        
                        from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));
            
            
            
            
            
            
            
                        return;
                    }

                    //They Passed the Captcha!
                    if (from is PlayerMobile)
                    {
                        PlayerMobile pm = (PlayerMobile)from;
                        pm.NextCaptchaTime = DateTime.Now + TimeSpan.FromMinutes(Utility.RandomMinMax(5,25));
                    }

                    //call our delegate and pass it our mobile & argument
                    m_Action(m_From, m_ActionObject);
                }
                break;
            }
        }
Post automatically merged:

Sorry about that post it was done with one hand as I was eating... So THIS code compiles fine. It doesn't compile when I try to add the code that makes it page to the top section which I suspect is the place where it needs to go for it to page when canceling or re-using the tool without completing the captcha... It's getting some error about "from" and im not sure why I will keep working on it and messing around but if anyone wants to help or give me advice feel free!
Post automatically merged:

Alright so I came up with another option my first choice was beyond my abilities but here is what I came up with... Basically I got it to just block you out from harvesting and nopage to gms... this is ok by me as the point is to block you out not ban you or screw you over... The solution to my desire to be notified is to make it so when you actually do solve the captcha you cancel your page to the gms! AWESOME IDEA RIGHT! so the only problem is that if they screw up more than once they generate multiple pages to the gms so now I have to figure out how to make it so you can only have one page at a time...

in captcha.cs

C#:
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            
            Mobile from = sender.Mobile;
            if (m_From == null || m_ActionObject == null || sender == null || info == null)
            {
            
                
                from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));

                return;
            }
            
            //Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 2:
                {
                    TextRelay tr_captcha = info.GetTextEntry(3);
                    if(tr_captcha.Text.Length != 3 )
                    {
                        from.SendMessage("You failed to prove that you're not A.F.K.");
                        
                        from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));

                        return;
                    
                    }

                    if (Char.ToUpper(tr_captcha.Text[0]) != m_A || Char.ToUpper(tr_captcha.Text[1]) != m_B || Char.ToUpper(tr_captcha.Text[2]) != m_C)
                    {
                        from.SendMessage("You failed to prove that you're not A.F.K. ");
                        
                        from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));
            
                        return;
                    }

                    //They Passed the Captcha!
                    if (from is PlayerMobile)
                    {
                        PlayerMobile pm = (PlayerMobile)from;
                        pm.NextCaptchaTime = DateTime.Now + TimeSpan.FromMinutes(Utility.RandomMinMax(5,25));
                    }
                        
                    //call our delegate and pass it our mobile & argument
                    m_Action(m_From, m_ActionObject);
                }
                PageEntry entry = PageQueue.GetEntry(this.m_From);
                PageQueue.Remove(entry);
                
                
                break;
            }
        }
        
    }
}
 
Last edited:
So I figure it out... I figured out how to make it start pinging the gm when they are using the tool afk... PERFECT! CHECK THIS OUT if you are looking for a more serious captcha system... Add this to your harvest system...

C#:
/* Begin Captcha Mod */
            CaptchaGump.sendCaptcha(from, HarvestSystem.SendHarvestTarget, new object[]{tool, this});
/* End Captcha Mod */

ArrayList list = PageQueue.List;
                for (int i = 0; i < list.Count;)
            {
                PageEntry e = (PageEntry)list[i];

                if (e.Sender.Alive)
                {
                    e.AddResponse(e.Sender, "[Logout]");
                    PageQueue.Remove(e);
                }
                else
                {
                    ++i;
                }
            }
             


from.SendLocalizedMessage(501234, "", 0x35); /* The next available Counselor/Game Master will respond as soon as possible.
            * Please check your Journal for messages every few minutes.
            */

            PageQueue.Enqueue(new PageEntry(from, "text", PageType.Other));

            //EventSink.InvokeResourceHarvestAttempt(new ResourceHarvestAttemptEventArgs(from, tool, this));
            //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 */
Post automatically merged:

wait a sec this makes it so you get a ping whenever they use a tool. lol one sec
 
Last edited:
o_O
Proactivity is more productive than reactivity. Try to focus on what you are doing. Or try to convey the information clearly, with the complete code, and details of the errors that occur.
 
if i could i would just delete this crap... but if someone really wants to get a ping from the captcha they will figure it out from what I posted... If a mod will delete this post I'll post my code nice and clearer...
Post automatically merged:

Let me give you some advise... try to understand that im not a coder i have a very basic understanding of what im doing and that this post is the fruit of my hours of labor... please try to be more understanding and actually offer something worthy of my effort instead of just spitting on it...
 
Last edited:
Ok guys I'm still in need of help so... I'm happy with the code snips I added from the help system.... The only problem is that there is no identifiable information in the page on the initial window. It just reads "text". That's it I just need to figure out how to make the player add something identifiable preferably their name to the message so instead of reading "text" it reads <player name> just needs one thing to make it identifiable and this addition to the capture script will make it 10000% more effective at catching the afk miners. I will try to figure out after truck school but if anyone cares to help in the mean time I will have my phone...
1607953482241.png
 
Decided it will be easier to use knifes chat system since if i can get it to tell world its gathering upon harvest it will show player name then i just need to enable unique names and ill bee good! It will be cool.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back