[RELEASE]Anti bot system 5165

05/13/2010 23:25 .Summer#1
Here is an simple anti bot system.
Credits goes to Arco for the npc send thing :)

First go to MyThreads.cs and find:
Code:
            interval = Interval;
            T = new Thread(new ThreadStart(Run));
            T.Start();
Now under it paste:
Code:
                System.Timers.Timer BOTTimer = new System.Timers.Timer(1000.0);
                BOTTimer.Start();
                BOTTimer.Elapsed += delegate { BOT(); };
                System.Timers.Timer DBOTTimer = new System.Timers.Timer(1000.0);
                DBOTTimer.Start();
                DBOTTimer.Elapsed += delegate { BBOT(); };
Now find: bool closed = false;
under it paste:
Code:
        public static bool BOTSEND = false;
        public static bool DBOTSEND = false;
        public static bool BOTCHECK = false;
Now find:
Code:
        public void Close()
        {
            closed = true;
        }
above it put:
Code:
        public static void BOT()
        {
            if (DateTime.Now.Minute == 45 && BOTSEND == false)
            {
                foreach (Character Char in World.H_Chars.Values)
                {
                    DBOTSEND = false;
                    BOTSEND = true;
                    BOTCHECK = false;
                    Char.MyClient.DialogNPC = 13652;
                    PacketHandling.NPCDialog.Handle(Char.MyClient, null, 13652, 0);
                    Char.MyClient.EndSend();
                }
            }
        }

        public static void BBOT()
        {
            if (DateTime.Now.Minute == 15 && DBOTSEND == false)
            {
                    DBOTSEND = true;
                    BOTSEND = false;
                    BOTCHECK = true;
            }
        }
Then put this npc:
Code:
#region BOTTER
                            case 13652:
                                {
                                    if (Control == 0)
                                    {
                                        if (MyThread.BOTCHECK == false)
                                        {
                                            //Checking if players are afk, the way is that if they stand in same spot after 5secs count.
                                            GC.Message(2011, " CHECKING AFK PLAYERS.");
                                            ushort LASTSPOTX;
                                            ushort LASTSPOTY;
                                            ushort LASTSPOTM;
                                            LASTSPOTX = GC.MyChar.Loc.X;
                                            LASTSPOTY = GC.MyChar.Loc.Y;
                                            LASTSPOTM = GC.MyChar.Loc.Map;
                                            Thread.Sleep(5000);
                                            if (GC.MyChar.Loc.X == LASTSPOTX && GC.MyChar.Loc.Y == LASTSPOTY && GC.MyChar.Loc.Map == LASTSPOTM)
                                            {

                                            }
                                            else
                                            {
                                                GC.Message(2500, " ALL AFK PLAYERS ARE NOW OUT OF BOTSYSTEM.");
                                                Thread.Sleep(2000);
                                                GC.Message(2011, " ANTI BOT SYSTEM START IN 3SECONDS.");
                                                Thread.Sleep(3000);
                                                GC.AddSend(Packets.NPCSay("ANTI BOT SYSTEM: What color is red? ANSWER: RED"));
                                                GC.AddSend(Packets.NPCLink("Blue.", 1));
                                                GC.AddSend(Packets.NPCLink("Red.", 3));
                                                GC.AddSend(Packets.NPCLink("Gree.", 1));
                                                GC.AddSend(Packets.NPCLink("White.", 1));
                                                GC.AddSend(Packets.NPCLink("Yellow.", 1));
                                                GC.AddSend(Packets.NPCLink("Pink.", 1));
                                                GC.AddSend(Packets.NPCLink("Orange.", 1));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            if (Control == 1)
                                            {
                                                GC.MyChar.Teleport(6001, 50, 50);
                                                GC.Message(2005, GC.MyChar.Name + " Have been botjailed, because he answer wrong on the AntiBot System.");
                                            }
                                            if (Control == 3)
                                            {
                                                GC.AddSend(Packets.NPCSay("ANTI BOT SYSTEM: Wich of these things is not a vegetable? ANSWER: MEAT"));
                                                GC.AddSend(Packets.NPCLink("Salad.", 1));
                                                GC.AddSend(Packets.NPCLink("Tomato.", 1));
                                                GC.AddSend(Packets.NPCLink("Tomato again.", 1));
                                                GC.AddSend(Packets.NPCLink("WTF.", 1));
                                                GC.AddSend(Packets.NPCLink("OMG.", 1));
                                                GC.AddSend(Packets.NPCLink("Meat.", 4));
                                                GC.AddSend(Packets.NPCLink("Im blonde.", 1));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            if (Control == 4)
                                            {
                                                GC.AddSend(Packets.NPCSay("ANTI BOT SYSTEM: Say ok!!! ANSWER: OK"));
                                                GC.AddSend(Packets.NPCLink("OK.", 5));
                                                GC.AddSend(Packets.NPCLink("im a botter.", 1));
                                                GC.AddSend(Packets.NPCLink("noob.", 1));
                                                GC.AddSend(Packets.NPCLink("what ever.", 1));
                                                GC.AddSend(Packets.NPCLink("hey.", 1));
                                                GC.AddSend(Packets.NPCLink("lol.", 1));
                                                GC.AddSend(Packets.NPCLink("im a haxor.", 1));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            if (Control == 5)
                                            {
                                                GC.AddSend(Packets.NPCSay("ANTI BOT SYSTEM: What is 2+4? ANSWER: 6"));
                                                GC.AddSend(Packets.NPCLink("1.", 1));
                                                GC.AddSend(Packets.NPCLink("7.", 1));
                                                GC.AddSend(Packets.NPCLink("6.", 6));
                                                GC.AddSend(Packets.NPCLink("14.", 1));
                                                GC.AddSend(Packets.NPCLink("I can't count.", 1));
                                                GC.AddSend(Packets.NPCLink("BITCH.", 1));
                                                GC.AddSend(Packets.NPCLink("can i get botjail?.", 1));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            if (Control == 6)
                                            {
                                                GC.AddSend(Packets.NPCSay("ANTI BOT SYSTEM: Are you botting? ANSWER: no"));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("yes.", 1));
                                                GC.AddSend(Packets.NPCLink("no.", 7));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            if (Control == 7)
                                            {
                                                GC.AddSend(Packets.NPCSay("Congratulations, your not a botter."));
                                                GC.AddSend(Packets.NPCLink("I know.", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                    }
                                    break;
                                }
                            #endregion
Now everytime the clock is XX:45, then it will send the antibot system :)

Note:
Quote:
Right click on Thread.Sleep and click resolve, then use System.Threading
05/14/2010 00:19 Basser#2
Why does this make you a reborn?

Talking about
Reborn += 1;
05/14/2010 00:25 .Summer#3
oh, sorry, is because i changed reborn to bot count, in my source.
Thanks for notice me.

#Fixed :)
05/14/2010 00:29 gerble93#4
You should also create a command/function that allows the player to indicate that they are currently AFK for a while so this way it ignores them and moves on..
05/14/2010 00:32 killersub#5
very nice job! +k
05/14/2010 00:54 .Summer#6
Quote:
Originally Posted by gerble93 View Post
You should also create a command/function that allows the player to indicate that they are currently AFK for a while so this way it ignores them and moves on..
it already check afk players.
but ill make command 2sec :)
05/14/2010 00:55 Korvacs#7
Already got a way around your anti-bot check.

Since your npc always returns to the same dialog, and there is only 1 option which takes you to a different dialog (the correct one) any bot could be made to read the incoming bot check, and automatically answer by sending a dialog request to the only option which is different.

To easy.

If your wanting to go down the NPC Dialog anti-bot route, at the very least you should have all of the dialogs point to different dialog ids, instead of making it obvious like you have.

And if you really wanted to make something decent you should use the inputbox style link, and have the user input the answer to something, also dont put the answer in the dialog, since any proxy can parse that and create a database of questions and responses.

A good idea would be to ask the user something which changes quite often, for example what is your current level, what is your current hp, what is your current mp, how much gold is in your inv. Obviously databases can still be made and responses coded, but it would be alittle bit more complex than it is now.

Honestly though if you want anti-bot protection you should implement timestamp checking on incomming packets.
05/14/2010 01:11 .Summer#8
Quote:
Originally Posted by Korvacs View Post
Already got a way around your anti-bot check.

Since your npc always returns to the same dialog, and there is only 1 option which takes you to a different dialog (the correct one) any bot could be made to read the incoming bot check, and automatically answer by sending a dialog request to the only option which is different.

To easy.

If your wanting to go down the NPC Dialog anti-bot route, at the very least you should have all of the dialogs point to different dialog ids, instead of making it obvious like you have.

And if you really wanted to make something decent you should use the inputbox style link, and have the user input the answer to something, also dont put the answer in the dialog, since any proxy can parse that and create a database of questions and responses.

A good idea would be to ask the user something which changes quite often, for example what is your current level, what is your current hp, what is your current mp, how much gold is in your inv. Obviously databases can still be made and responses coded, but it would be alittle bit more complex than it is now.

Honestly though if you want anti-bot protection you should implement timestamp checking on incomming packets.
it was just a simple anti bot system.
and yea is true, it could be done alot better.


@gerble
here is the afk command
-----------------------------------------------------
character.cs:
find: public ulong VP;

add this under:
Code:
public bool AFK;
Now open jump.cs
and replace the whole class with:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
    public class Jump
    {
        public static void Handle(Main.GameClient GC, byte[] Data)
        {
            if (GC.MyChar.AFK == false)
            {
                if (GC.MyChar.BuffOf(NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray).Eff == NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray)
                    GC.MyChar.RemoveBuff(GC.MyChar.BuffOf(Features.SkillsClass.ExtraEffect.BlessPray));
                GC.MyChar.Mining = false;
                GC.MyChar.AtkMem.Attacking = false;
                GC.MyChar.Action = 100;
                if (GC.MyChar.Loc.AbleToJump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10), GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Cyclone) || GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Ride)))
                {
                    if (GC.MyChar.StatEff.Contains(NewestCOServer.Game.StatusEffectEn.Ride))
                    {
                        if (GC.MyChar.Vigor >= 5)
                            GC.MyChar.Vigor -= 5;
                        else return;
                    }
                    Game.World.Action(GC.MyChar, Data);
                    GC.MyChar.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10));
                    Game.World.Spawns(GC.MyChar, true);
                }
                else if (GC.MyChar.AFK == false)
                {
                    GC.LocalMessage(2005, "Invalid Jump!");
                    GC.AddSend(Packets.GeneralData(GC.MyChar.EntityID, 0, GC.MyChar.Loc.X, GC.MyChar.Loc.Y, 0x6c));
                }
            }
        }
    }
}
now open walkrun.cs
and replace the whole class with:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
    public class WalkRun
    {
        public static void Handle(Main.GameClient GC, byte[] Data)
        {
            if (GC.MyChar.AFK == false)
            {
                if (GC.MyChar.BuffOf(NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray).Eff == NewestCOServer.Features.SkillsClass.ExtraEffect.BlessPray)
                    GC.MyChar.RemoveBuff(GC.MyChar.BuffOf(Features.SkillsClass.ExtraEffect.BlessPray));
                GC.MyChar.Mining = false;
                GC.MyChar.AtkMem.Attacking = false;
                GC.MyChar.Action = 100;
                Game.World.Action(GC.MyChar, Data);
                GC.MyChar.Direction = (byte)(Data[4] % 8);
                GC.MyChar.Loc.Walk((byte)(Data[4] % 8));
                Game.World.Spawns(GC.MyChar, true);
            }
        }
    }
}
Now they can't walk or jump, when they are set as afk.
now in chat.cs find:
Code:
                    if (Cmd[0] == "/players")
                    {
above that put:
Code:
                    if (Cmd[0] == "/afk")
                    {
                        GC.LocalMessage(2000, "You are now set as AFK and you won't get effected by the anti bot system. You can't walk or jump!");
                        GC.MyChar.AFK = true;
                    }
                    if (Cmd[0] == "/afkoff")
                    {
                        GC.LocalMessage(2000, "You are not AFK more, feel free to walk and jump!");
                        GC.MyChar.AFK = false;
                    }
To make afk write: /afk
to make afk off write: /afkoff
05/14/2010 01:55 CIRASH#9
Code:
GC.AddSend(Packets.NPCLink("[B][COLOR="Red"]Green.[/COLOR][/B]", 1));
05/14/2010 01:56 -Shunsui-#10
this is more for AutoBots bot that do stuff for you? cause lol i can use about 500 other bots why not make a check to see if programs with containng name like "bot" and stuff like that and make em close and send a Messg
05/14/2010 02:00 Fratua#11
I believe it is illegal to look at search for something like that on somebodys computer although a nice TOS could save you from trouble.

EDIT: What if your botting a different game?
05/14/2010 02:02 .Summer#12
cuz is jsut a simple bot checker :)
I dont have alot time for helping & making releases, since im working on my own server to make it done :)
so things i release will just be simple things :)

but to prevent bot programs, you could simply change your conquer.exe, so they would have to make a new bot for looking up the client.
then simply change your exe sometimes, (when patch?)
06/15/2010 00:22 copz1337#13
Quote:
Originally Posted by Korvacs View Post
Already got a way around your anti-bot check.

Since your npc always returns to the same dialog, and there is only 1 option which takes you to a different dialog (the correct one) any bot could be made to read the incoming bot check, and automatically answer by sending a dialog request to the only option which is different.

To easy.

If your wanting to go down the NPC Dialog anti-bot route, at the very least you should have all of the dialogs point to different dialog ids, instead of making it obvious like you have.

And if you really wanted to make something decent you should use the inputbox style link, and have the user input the answer to something, also dont put the answer in the dialog, since any proxy can parse that and create a database of questions and responses.

A good idea would be to ask the user something which changes quite often, for example what is your current level, what is your current hp, what is your current mp, how much gold is in your inv. Obviously databases can still be made and responses coded, but it would be alittle bit more complex than it is now.

Honestly though if you want anti-bot protection you should implement timestamp checking on incomming packets.
Yep just like websites, they ask you what 5+1 is and you input the answer so a bot can't attack it. Btw .Summer, the changing .exe idea is a bad one. Maybe it's good temporarily until you find a way to block it for some time (not forever since hacks can always be updated). But having to change the .exe every patch just to prevent the bot, is bad. Trust me, a server I played did that and the outcome wasn't good.
06/15/2010 14:52 xStylo#14
Quote:
Originally Posted by copz1337 View Post
Yep just like websites, they ask you what 5+1 is and you input the answer so a bot can't attack it. Btw .Summer, the changing .exe idea is a bad one. Maybe it's good temporarily until you find a way to block it for some time (not forever since hacks can always be updated). But having to change the .exe every patch just to prevent the bot, is bad. Trust me, a server I played did that and the outcome wasn't good.
I have no idea on hax anyways :D
06/15/2010 22:04 µ~Xero~µ#15
the afk command just made it completly useless now