Created
July 27, 2015 15:04
-
-
Save HossamYousef/d9a63bda6782193e075f to your computer and use it in GitHub Desktop.
Anti bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Anti bot | |
if (client.WaitingKillCaptcha) | |
{ | |
if (Now32 > client.KillCountCaptchaStamp.AddSeconds(60)) | |
{ | |
client.Disconnect(); | |
} | |
} | |
else | |
{ | |
if (client.Entity.KillCount < 0) client.Entity.KillCount = 0; | |
if (client.Entity.KillCount >= 1500 || client.Entity.KillCount2 >= 150) | |
{ | |
client.KillCountCaptchaStamp = Time32.Now; | |
client.WaitingKillCaptcha = true; | |
Npcs dialog = new Npcs(client); | |
client.ActiveNpc = 9999997; | |
client.KillCountCaptcha = client.GenerateCaptcha(5); | |
dialog.Text("Input the current text: " + client.KillCountCaptcha + " to verify your humanity."); | |
dialog.Input("Captcha message:", 1, (byte)client.KillCountCaptcha.Length); | |
dialog.Option("No thank you.", 255); | |
dialog.Send(); | |
return; | |
} | |
else | |
{ | |
if (Now32 > client.LastMove.AddMinutes(5) && Now32 < client.LastAttack.AddSeconds(5)) | |
{ | |
if (client.WaitingKillCaptcha) | |
{ | |
if (Now32 > client.KillCountCaptchaStamp.AddSeconds(60)) | |
{ | |
client.Disconnect(); | |
} | |
} | |
else | |
{ | |
client.KillCountCaptchaStamp = Time32.Now; | |
client.WaitingKillCaptcha = true; | |
Npcs dialog = new Npcs(client); | |
client.ActiveNpc = 9999997; | |
client.KillCountCaptcha = client.GenerateCaptcha(5); | |
dialog.Text("Input the current text: " + client.KillCountCaptcha + " to verify your humanity."); | |
dialog.Input("Captcha message:", 1, (byte)client.KillCountCaptcha.Length); | |
dialog.Option("No thank you.", 255); | |
dialog.Send(); | |
} | |
} | |
} | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment