Skip to content

Instantly share code, notes, and snippets.

@HossamYousef
Created July 27, 2015 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HossamYousef/d9a63bda6782193e075f to your computer and use it in GitHub Desktop.
Save HossamYousef/d9a63bda6782193e075f to your computer and use it in GitHub Desktop.
Anti bot
#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