[Relase] Anti-bot system ( As Qonquer had it )

10/26/2008 22:58 _Emme_#1
Wazzup homies? I was bored today and decided to quickly get something ,and the only thing in my mind was the anti-bot-level system Qonquer has. If anyone wonder,here is how it's working:

* Each 15 minutes,it brings up an NPC chat and ask you an question with some options. If you answer wrong,you get disconnected, if you wont answer within 20 seconds, you get disconnected.

So,theres no way to get away!:D
Also, there are alot of privateservers that are not yet public, so I simply made a command for all this,so you can start / shut it off whenever you like.

Alright,here goes the code:



In Character.cs :


Quote:
public Timer QuestionTimer = new Timer();
public Timer QuestionTimer1 = new Timer();
public bool QuestionAnswered = false;
public bool CanAsk = true;


Search for public void SwingPickaxe() , and above it , add:



Quote:
public void Question()
{
if (CanAsk)
{

int Question = General.Rand.Next(1, 5);
MyClient.CurrentNPC = 186183;

if (Question == 1)
{

MyClient.SendPacket(General.MyPackets.NPCSay("What color is brown?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Blu e", 1));
MyClient.SendPacket(General.MyPackets.NPCLink("Bla ck", 2));
MyClient.SendPacket(General.MyPackets.NPCLink("Yel low?", 3));
MyClient.SendPacket(General.MyPackets.NPCLink("Bro wn", 4));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}
if (Question == 2)
{

MyClient.SendPacket(General.MyPackets.NPCSay("Do you use an bot at the moment:)?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Ofc ourse", 5));
MyClient.SendPacket(General.MyPackets.NPCLink("No sir", 6));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}
if (Question == 3)
{

MyClient.SendPacket(General.MyPackets.NPCSay("How would you rate this server?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Ama zing", 7));
MyClient.SendPacket(General.MyPackets.NPCLink("Goo d", 8));
MyClient.SendPacket(General.MyPackets.NPCLink("Bad ", 9));
MyClient.SendPacket(General.MyPackets.NPCLink("Mil k,please", 10));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}
if (Question == 4)
{

MyClient.SendPacket(General.MyPackets.NPCSay("Are you connected to the internet?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Yea h", 11));
MyClient.SendPacket(General.MyPackets.NPCLink("Not sure", 12));
MyClient.SendPacket(General.MyPackets.NPCLink("Mil k,please", 13));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}
if (Question == 5)
{

MyClient.SendPacket(General.MyPackets.NPCSay("Have you ever used an computer?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Yea h", 14));
MyClient.SendPacket(General.MyPackets.NPCLink("Not sure", 15));
MyClient.SendPacket(General.MyPackets.NPCLink("I am a bot!!!", 16));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}
}


}

Search for : public void UnPackProfs() , above it add:


Quote:
public void QuestionTimer_Elapsed(object sender, ElapsedEventArgs e)
{
Question();
MyClient.SendPacket(General.MyPackets.SendMsg(MyCl ient.MessageId, "Server", Name, "Answer the question quick and correct ,else you will be kicked out.", 2000));

}
public void QuestionTimer1_Elapsed(object sender, ElapsedEventArgs e)
{
if (!QuestionAnswered)
{
Save();
MyClient.Drop();
}


}



Search for if (Splitter[0] == "/level") , above it add:



Quote:
if (Splitter[0] == "@start")
{
MyChar.QuestionTimer.Interval = 60000 * 15;
MyChar.QuestionTimer.Elapsed += new ElapsedEventHandler(MyChar.QuestionTimer_Elapsed);
MyChar.QuestionTimer.Start();
MyChar.QuestionTimer1.Interval = 60000 * 16;
MyChar.QuestionTimer1.Elapsed += new ElapsedEventHandler(MyChar.QuestionTimer1_Elapsed) ;
MyChar.QuestionTimer1.Start();

}


if (Splitter[0] == "/stop")
{
MyChar.QuestionTimer.Stop();
MyChar.QuestionTimer1.Stop();
MyChar.CanAsk = false;

}

Now,search for : if (CurrentNPC == 390) , above it add:



Quote:
if (CurrentNPC == 186183)
{
if (Control == 1 || Control == 2 || Control == 3 || Control == 5 || Control == 10 || Control == 13 || Control == 16)
{
MyChar.Save();
MyChar.MyClient.Drop();

}
else
{
MyChar.QuestionAnswered = true;
}

}


I seriously only tested this once,and didnt test it all,but to me it all should work fine. Its really simple and I did it because I was bored,I dont mind if you think it was worthless:D


I highly suggest everyone to change the question/answers if your server is public and you are going to use this. It is recommended to change the question + answers atleast once a week , if not even more often.
This is how you add more question/answers:

Search for int Question = General.Rand.Next(1, 5); , and change that 5 to how many questions you want to ask.

Now,search for: if (Question == 5) , and above it , add a new question with a higher number ,this is an example:


Quote:
if (Question == 6) // you cant use this number on any other question
{

MyClient.SendPacket(General.MyPackets.NPCSay("Clic k the option which says ´Correct Answer´?"));
MyClient.SendPacket(General.MyPackets.NPCLink("Cow ", 17)); // <- these numbers should always be higher than the one above , or the last one at the last question. Those are the option ID's.
MyClient.SendPacket(General.MyPackets.NPCLink("Not sure", 18));
MyClient.SendPacket(General.MyPackets.NPCLink("Cor rect answer", 19));
MyClient.SendPacket(General.MyPackets.NPCSetFace(3 0));
MyClient.SendPacket(General.MyPackets.NPCFinish()) ;
}

Great! You added the questions. Now lets add so they will disconnect if they answer wrong!

Search for: if (CurrentNPC == 186183) , and two rows under that you see a long line with like : if (Question == 1 || Question == 2 || bla bla bla,somewhere in there,add the WRONG answer ids. On the example,the wrong IDs are 18 and 17, so then you do this.

if (Question == 17 || Question == 18 somewhere in that long line so it fit in.

Goodluck,

P.S : Sorry for my bad english and my lack of explanation skill.




Press thanks if you just want to or if you really think this was worth releasing.



Emme


EDIT : Now when I looked at the quotes,I see there are spaces here and there,for some reason. Probably quote system that is fuxxed up. So,if your going to copy + paste this,make sure all the spaces are corrected.
10/26/2008 23:00 taguro#2
Nice release, this should help keep people honest on private servers.
10/26/2008 23:03 XxArcherMasterxX#3
Nice Release emme!

added to my all in 1 thread in green letters;)
10/26/2008 23:05 _Emme_#4
Seriously? Was this an nice idea? I was set to get all flames on this one,ah whatever,there are still some nice guys left here:)

Any other ideas of what I can code to improve the actual game-play,to keep it clean and stuffs like that?
10/26/2008 23:07 XxArcherMasterxX#5
Quote:
Originally Posted by emildayan1 View Post
Seriously? Was this an nice idea? I was set to get all flames on this one,ah whatever,there are still some nice guys left here:)

Any other ideas of what I can code to improve the actual game-play,to keep it clean and stuffs like that?
well you are bored i think, so why not releasing uuhhhmmm wait give me 5 minuts:P

[5 Minutes Later]

Code a kind of Vip Map like you said in a other post or a pk tournament:p

ps/ lol this was a great idea
10/26/2008 23:10 lostsolder05#6
lolz, nice good idea =x(talking 2 emme)
10/26/2008 23:11 taguro#7
Quote:
Originally Posted by XxArcherMasterxX View Post
well you are bored i think, so why not releasing uuhhhmmm wait give me 5 minuts:P

[5 Minutes Later]

Code a kind of Vip Map like you said in a other post or a pk tournament:p

ps/ lol this was a great idea
Coding a pk tourney is easy... creating a completely new map... not so easy. Maps aren't made by coding.
10/26/2008 23:14 _Emme_#8
Im working on that VIP map / system shit:
This is what I got on it, worked for like 15 - 20 minutes then I had to go:

* VIP Purchase:
12 hours - 1000 CPs or 20 million silvers
24 hours - 2000 CPs or 35 million silvers.
48 hours - 5000 CPs or 55 million silvers.
A week - 15000 CPs or 150 million silvers.

You can always go back to normal cities, and back in.

* Sends an different effect on the top right corner,which name is VIP and tells you how long until you lose your VIP.

* 3x experience by killing the monsters in the VIP map

* Special monsters in the VIP map,gives extra nice drops and are a few higher level monsters.

* A few NPCs,charge nothing to go to the other maps.

* Each 20 minutes , you have a chance of winning 20 CPs. The chance is 1 of 15.




Ill add a few more stuffs,then release it.

Emme
10/26/2008 23:16 alexbigfoot#9
nice one....(u helped me a lot with this one)
10/26/2008 23:16 _Emme_#10
Quote:
Originally Posted by taguro View Post
Coding a pk tourney is easy... creating a completely new map... not so easy. Maps aren't made by coding.
We discussted this in another thread,haha. What he/ me meant was we are going to use the copy of TC/BI/DC blablabla, and use them as ´new´ maps, or , in other world, create a whole new VIP world. Or infact,_I_ will, then release it , Lawls.

Emme
10/26/2008 23:17 XxArcherMasterxX#11
Quote:
Originally Posted by emildayan1 View Post
Im working on that VIP map / system shit:
This is what I got on it, worked for like 15 - 20 minutes then I had to go:

* VIP Purchase:
12 hours - 1000 CPs or 20 million silvers
24 hours - 2000 CPs or 35 million silvers.
48 hours - 5000 CPs or 55 million silvers.
A week - 15000 CPs or 150 million silvers.

You can always go back to normal cities, and back in.

* Sends an different effect on the top right corner,which name is VIP and tells you how long until you lose your VIP.

* 3x experience by killing the monsters in the VIP map

* Special monsters in the VIP map,gives extra nice drops and are a few higher level monsters.

* A few NPCs,charge nothing to go to the other maps.

* Each 20 minutes , you have a chance of winning 20 CPs. The chance is 1 of 15.




Ill add a few more stuffs,then release it.

Emme
cool:p
10/26/2008 23:17 _Emme_#12
Quote:
Originally Posted by alexbigfoot View Post
nice one....(u helped me a lot with this one)

Be REALLY honest now,when you looked at it,I am 99 % sure, you was thinking:

Oh damn, this wasnt really that hard!

Seriously,was I right? Since this is really simple,atleast I think..
10/26/2008 23:18 XxArcherMasterxX#13
Quote:
Originally Posted by emildayan1 View Post
Be REALLY honest now,when you looked at it,I am 99 % sure, you was thinking:

Oh damn, this wasnt really that hard!

Seriously,was I right? Since this is really simple,atleast I think..
hahhahahaha you owned him xD!
10/26/2008 23:19 tao4229#14
Simple, yet useful I guess.

@highfive EmMe
10/26/2008 23:21 _Emme_#15
Ouch! Dont highfive that hard,man!
Nah seriously,yeah it was rather simple..

Going to sleep now, my cousin is nagging me all tha time..

Peace for now,ill release more tomorrow,give me ideas..