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 :
Search for public void SwingPickaxe() , and above it , add:
Search for : public void UnPackProfs() , above it add:
Search for if (Splitter[0] == "/level") , above it add:
Now,search for : if (CurrentNPC == 390) , above it add:
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:
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.
* 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.