Jump to content
  • 0

[Help] Captcha Antibot system


Question

Posted

Hi guys,

 

so i tryed to add captcha antibot system the system works after blabla kills he pop up and i must enter if wrong = jail

 

work i just get a error here a picture : erroren.jpg

 

and here the code of L2Attackable :

 

private static int AntiBotKills = 0;
private static int Change = 0;
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

@Override
public boolean doDie(L2Character killer)
{
	// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
	if (!super.doDie(killer))
		return false;

	if (Config.ENABLE_ANTIBOT_SYSTEM)
		AntiBotKills++;

	Change = Rnd.get(10);
	int AntiBotKillsCheck = (Config.ANTIBOT_KILLS_CHECK);
	if (Config.ENABLE_ANTIBOT_SYSTEM && AntiBotKills >= AntiBotKillsCheck)
	{
		killer.setIsParalyzed(true);
		killer.setIsInvul(true);
		AntiBotKills = 0;
		switch(Change)
		{
			case 1:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 3 + 9 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 12\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 2:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 21 - 7</font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 14\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 3:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 5 + 3 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 8\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 4:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 3 - 2 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 1\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 5:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 19 + 4 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 23\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 6:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 9 - 3 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 6\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 7:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 53 - 33 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 20\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 8:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 7 + 22 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 29\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 9:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 4 + 31 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 35\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
				break;
			case 10:
				npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br1>You will be invulnerable until you enter<br1>the code so noone will kill you!<br1><br>Question: <font color=\"66FF00\"> 12 - 8 </font> = ?<edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 4\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
				killer.sendPacket(npcHtmlMessage);
			default:
			;
		}
	}

	// Notify the Quest Engine of the L2Attackable death if necessary
	try
	{
		L2PcInstance player = null;

		if (killer != null)
			player = killer.getActingPlayer();

		if (player != null)
		{
			if (getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL) != null)
				for (Quest quest: getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL))
					ThreadPoolManager.getInstance().scheduleEffect(new OnKillNotifyTask(this, quest, player, killer instanceof L2Summon), _onKillDelay);
		}
	}
	catch (Exception e) { _log.log(Level.SEVERE, "", e); }
	return true;
}

 

thanks for helping mee

Recommended Posts

  • 0
Posted

Tryskell

 

did you have better protect ideas ?i yes but i think for a java beginner very hard to code.

so i dont know captcha is one way the bot reoirt button the second.

 

if i i change it into L2Pcinstance at what bolean  and what i have o change there if you mean that will work better ?

 

thanks

  • 0
Posted

Well, it totally depends of the "idea" of your mod.

 

A captcha system have more reasons to exist on the entrance of any player (enterWorld.java) than in the DoDie method of any L2Attackable monster/summon/player.

 

Considering your captcha thing is *CURRENTLY* :

- generating correctly a random code, and make the association code/input text (well your code is primitive, but it seems to work);

- sending a window at the death of a player (killing anything other than a player show a NPE atm, from what I think);

- punishing the player if the code is wrong;

 

The only thing you have to do is to remove all the code from L2Attackable and edit it for EnterWorld. Basically your code fits for EnterWorld, as it misses all good instances checks, and enterWorld is "made" for players only.

 

------

 

Revert back your code in L2Attackable then

 

	/**
 * Kill the L2Attackable (the corpse disappeared after 7 seconds), distribute rewards (EXP, SP, Drops...) and notify Quest Engine.
 *
 * Actions:
 * Distribute Exp and SP rewards to L2PcInstance (including Summon owner) that hit the L2Attackable and to their Party members
 * Notify the Quest Engine of the L2Attackable death if necessary
 * Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
 *
 * Caution: This method DOESN'T GIVE rewards to L2PetInstance
 *
 * @param killer The L2Character that has killed the L2Attackable
 */
@Override
public boolean doDie(L2Character killer)
{
	// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
	if (!super.doDie(killer))
		return false;

	// Notify the Quest Engine of the L2Attackable death if necessary
	try
	{
		L2PcInstance player = null;

		if (killer != null)
			player = killer.getActingPlayer();

		if (player != null)
		{
			if (getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL) != null)
				for (Quest quest: getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL))
					ThreadPoolManager.getInstance().scheduleEffect(new OnKillNotifyTask(this, quest, player, killer instanceof L2Summon), _onKillDelay);
		}
	}
	catch (Exception e) { _log.log(Level.SEVERE, "", e); }
	return true;
}

 

And in enterworld.java, find the good place to put (around the end, as enterWorld initializes many things) - I perhaps made errors, I just edited with notepad and didn't check synthax/logic :

 

if (Config.ENABLE_ANTIBOT_SYSTEM)
{
private static int AntiBotKills = 0;
private static int Change = 0;
int AntiBotKillsCheck = (Config.ANTIBOT_KILLS_CHECK);
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

Change = Rnd.get(8);
AntiBotKills++;

if (AntiBotKills >= AntiBotKillsCheck)
{
	killer.setIsParalyzed(true);
	AntiBotKills = 0;
	switch(Change)
	{
		case 0:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 3 + 9 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 12\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 1:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 21 - 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 14\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 2:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 9 + 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 16\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 3:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 36 - 18 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 18\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 4:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 10 + 0 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 10\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 5:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 6:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 7:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 8:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		default:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 1 + 8 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 9\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
	}
}
}

 

I didn't test your mechanism, so don't tell it doesn't works (this is your system if I didn't fock the c/p :D), and I don't know how the player isn't supposed to be de-paralized, I guess the voiced command got it.

 

killer have to be replaced to activeChar, imports have surely to be corrected, and such.

  • 0
Posted

Well, it totally depends of the "idea" of your mod.

 

A captcha system have more reasons to exist on the entrance of any player (enterWorld.java) than in the DoDie method of any L2Attackable monster/summon/player.

 

Considering your captcha thing is *CURRENTLY* :

- generating correctly a random code, and make the association code/input text (well your code is primitive, but it seems to work);

- sending a window at the death of a player (killing anything other than a player show a NPE atm, from what I think);

- punishing the player if the code is wrong;

 

The only thing you have to do is to remove all the code from L2Attackable and edit it for EnterWorld. Basically your code fits for EnterWorld, as it misses all good instances checks, and enterWorld is "made" for players only.

 

------

 

Revert back your code in L2Attackable then

 

	/**
 * Kill the L2Attackable (the corpse disappeared after 7 seconds), distribute rewards (EXP, SP, Drops...) and notify Quest Engine.
 *
 * Actions:
 * Distribute Exp and SP rewards to L2PcInstance (including Summon owner) that hit the L2Attackable and to their Party members
 * Notify the Quest Engine of the L2Attackable death if necessary
 * Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
 *
 * Caution: This method DOESN'T GIVE rewards to L2PetInstance
 *
 * @param killer The L2Character that has killed the L2Attackable
 */
@Override
public boolean doDie(L2Character killer)
{
	// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
	if (!super.doDie(killer))
		return false;

	// Notify the Quest Engine of the L2Attackable death if necessary
	try
	{
		L2PcInstance player = null;

		if (killer != null)
			player = killer.getActingPlayer();

		if (player != null)
		{
			if (getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL) != null)
				for (Quest quest: getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL))
					ThreadPoolManager.getInstance().scheduleEffect(new OnKillNotifyTask(this, quest, player, killer instanceof L2Summon), _onKillDelay);
		}
	}
	catch (Exception e) { _log.log(Level.SEVERE, "", e); }
	return true;
}

 

And in enterworld.java, find the good place to put (around the end, as enterWorld initializes many things) - I perhaps made errors, I just edited with notepad and didn't check synthax/logic :

 

if (Config.ENABLE_ANTIBOT_SYSTEM)
{
private static int AntiBotKills = 0;
private static int Change = 0;
int AntiBotKillsCheck = (Config.ANTIBOT_KILLS_CHECK);
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

Change = Rnd.get(8);
AntiBotKills++;

if (AntiBotKills >= AntiBotKillsCheck)
{
	killer.setIsParalyzed(true);
	AntiBotKills = 0;
	switch(Change)
	{
		case 0:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 3 + 9 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 12\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 1:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 21 - 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 14\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 2:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 9 + 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 16\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 3:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 36 - 18 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 18\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 4:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 10 + 0 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 10\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 5:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 6:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 7:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 8:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		default:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 1 + 8 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 9\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
	}
}
}

 

I didn't test your mechanism, so don't tell it doesn't works (this is your system if I didn't fock the c/p :D), and I don't know how the player isn't supposed to be de-paralized, I guess the voiced command got it.

 

killer have to be replaced to activeChar, imports have surely to be corrected, and such.

  • 0
Posted

Well, it totally depends of the "idea" of your mod.

 

A captcha system have more reasons to exist on the entrance of any player (enterWorld.java) than in the DoDie method of any L2Attackable monster/summon/player.

 

Considering your captcha thing is *CURRENTLY* :

- generating correctly a random code, and make the association code/input text (well your code is primitive, but it seems to work);

- sending a window at the death of a player (killing anything other than a player show a NPE atm, from what I think);

- punishing the player if the code is wrong;

 

The only thing you have to do is to remove all the code from L2Attackable and edit it for EnterWorld. Basically your code fits for EnterWorld, as it misses all good instances checks, and enterWorld is "made" for players only.

 

------

 

Revert back your code in L2Attackable then

 

	/**
 * Kill the L2Attackable (the corpse disappeared after 7 seconds), distribute rewards (EXP, SP, Drops...) and notify Quest Engine.
 *
 * Actions:
 * Distribute Exp and SP rewards to L2PcInstance (including Summon owner) that hit the L2Attackable and to their Party members
 * Notify the Quest Engine of the L2Attackable death if necessary
 * Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
 *
 * Caution: This method DOESN'T GIVE rewards to L2PetInstance
 *
 * @param killer The L2Character that has killed the L2Attackable
 */
@Override
public boolean doDie(L2Character killer)
{
	// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
	if (!super.doDie(killer))
		return false;

	// Notify the Quest Engine of the L2Attackable death if necessary
	try
	{
		L2PcInstance player = null;

		if (killer != null)
			player = killer.getActingPlayer();

		if (player != null)
		{
			if (getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL) != null)
				for (Quest quest: getTemplate().getEventQuests(Quest.QuestEventType.ON_KILL))
					ThreadPoolManager.getInstance().scheduleEffect(new OnKillNotifyTask(this, quest, player, killer instanceof L2Summon), _onKillDelay);
		}
	}
	catch (Exception e) { _log.log(Level.SEVERE, "", e); }
	return true;
}

 

And in enterworld.java, find the good place to put (around the end, as enterWorld initializes many things) - I perhaps made errors, I just edited with notepad and didn't check synthax/logic :

 

if (Config.ENABLE_ANTIBOT_SYSTEM)
{
private static int AntiBotKills = 0;
private static int Change = 0;
int AntiBotKillsCheck = (Config.ANTIBOT_KILLS_CHECK);
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

Change = Rnd.get(8);
AntiBotKills++;

if (AntiBotKills >= AntiBotKillsCheck)
{
	killer.setIsParalyzed(true);
	AntiBotKills = 0;
	switch(Change)
	{
		case 0:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 3 + 9 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 12\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 1:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 21 - 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 14\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 2:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 9 + 7 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 16\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 3:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 36 - 18 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 18\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 4:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 10 + 0 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 10\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 5:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 6:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 7:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		case 8:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 7 + 6 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 13\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
			break;
		default:
			npcHtmlMessage.setHtml("<html><title>Antibot System</title><body><center>Enter a code below and click CONFIRM<br><br>Question: <font color=\"66FF00\"> 1 + 8 </font> = ?<br><edit var=\"antibot\" width=110><br><br><button value=\"Confirm\" action=\"bypass -h voice .antibot $antibot 9\" width=80 height=26 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"><font color=\"FFFFFF\"> If your Type is Incorrect you will be Punished !</font></center></body></html>");
			killer.sendPacket(npcHtmlMessage);
	}
}
}

 

I didn't test your mechanism, so don't tell it doesn't works (this is your system if I didn't fock the c/p :D), and I don't know how the player isn't supposed to be de-paralized, I guess the voiced command got it.

 

killer have to be replaced to activeChar, imports have surely to be corrected, and such.

 

If you have ever botted before with programs like L2Net you know that when your bot loggs in you can just sit there for a few minutes and watch it for the capatcha to load up.

 

What you could do on enterworld.java is add a random int for the loading of the capatcha and have the integer be a large number.

 

So player enters - the code assigns random time before load capatcha - when time runs out loads capatcha... not that hard to edit form your current code.

  • 0
Posted

A generated number / suit of letters/number will show the asked code on the html ("To play enter following code : blablabla"), so it's exploitable as the answer is shown.

 

The only real way would be to call an image. The other solution is as the topic owner made, but once the guy got all possible questions/answers, it's bypassed.

 

----

 

I gave all codes and what you had to do, so now go work and come if you got issues compiling/ingame :P.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • if you want auto vote reward system lucera2 i support it add me discord c1c0s#3564
    • @Update improved config files & updated vote sites @Update added JMobius Support
    • @Update improved config files @Update added Lucera2 Support @Update added JMobius Support
    • Nope just sellers bumping their topics. Wlc back 😜
    • General Trackers :   IPTorrents invite IPTorrents account 1 tb TorrentLeech invite Torrentleech account 1 tb buffer  InTheShaDow ( ITS ) account Acid-lounge invite Torrentday invite Crnaberza account Abn.Lol account Limit-of-eden account Norbits account Xspeeds account Xspeeds invite Bemaniso invite Wigornot account Bithumen invite Filelist account Funfile invite AvistaZ invite Potuk.net invite ResurrectThe.Net invite GrabThe.Info invite Greek-Team invite LinkoManija invite Fano.in account TreZzoR account Speed.cd invite Arab-torrents.net account Arabscene.me account Scenetime account 4thd.xyz invite Btarg.com.ar account Dedbit invite Estone.cc account Speedapp invite Finvip invite Fluxzone account GigaTorrents account Gimmepeers account Haidan.video invite Mojblink account Mycarpathians invite Newinsane.info account Oscarworld.xyz account Peers.FM invite Pt.msg.vg account Ransackedcrew account Redemption invite Scene-rush account Seedfile.io invite Teracod invite Torrent.ai account Torrentmasters invite Ttsweb invite X-files invite X-ite invite Ncore account TorrentHR account Rptorrents account BwTorrents account Superbits invite Krazyzone account Immortalseed account Tntracker invite Pt.eastgame.org account Bitturk account Rstorrent account Tracker.btnext invite Torrent-turk.de account BeiTai.PT account Pt.keepfrds account 52pt.site account Pthome account Torrentseeds account Aystorrent account Blues-brothers.biz invite Divteam account Thesceneplace invite CinemaMovies.pl account Brasiltracker account Patiodebutacas account Newheaven.nl account  Xthor account Swarmazon.club invite Bc-reloaded account Crazyspirits account Silentground invite Omg.wtftrackr invite Milkie.cc invite Breathetheword invite Madsrevolution account Chilebt account Yubraca account Uniongang.tv account Frboard account Exvagos account Diablotorrent account Microbit account Carp-hunter.hu account Majomparade.eu account Theshinning.me account Bithorlo account Youiv.info account Dragonworld-reloaded account Sharewood.tv account Partis.si account Digitalcore.club invite Fuzer.me account R3vuk.wtf invite Ztracker account 1 tb buffer 3changtrai account Best-core.info account Bitsite.us account Eliteunitedcrew invite Exitorrent.org account Hellastz account Tophos invite Torrent.lt account Sktorrent.eu account Oshen account Blackhattorrent account Pirata.digital account Esharenet account Ohmenarikgi.la Pirate-share account Immortuos account Kiesbits account Cliente.amigos-share.club account Broadcity invite Ilovetorzz account Torrentbytes account Polishsource account Portugas invite Shareisland account ArabaFenice account Hudbt.hust.edu.cn account Audiences account Nanyangpt account Pt.sjtu.edu.cn account Pt.zhixing.bjtu.edu.cn account Byr.pt invite Ptfiles invite Red-bits account Pt.hdpost.top account Irrenhaus.dyndns.dk (NewPropaganda) account Mnvv2.info (MaxNewVision V2) account 1ptba.com account Spidertk.top account Casa-Torrent (Teamctgame) account Film-paleis account Generation-free account Aftershock-tracker account Twilightsdreams account Back-ups.me invite Sor-next.tk ( Spirit Of Revolution ) account Tfa.tf ( The Falling Angels ) account Hdmayi account S-f-p.dyndns.dk ( Share Friends Projekt ) account Unlimitz.biz account Pttime account St-tracker.eu account New-retro.eu account Zbbit account Tigers-dl.net account Jptvts.us account Lat-team account Club.hares.top account Falkonvision-team account Concen account Drugari account Megamixtracker account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Hdturk.club account Torrentleech.pl account Demonoid invite Lst.gg account Fakedoor.store account LaidBackManor account Vrbsharezone.co.uk invite Torrenteros account Arenaelite account Datascene account Tracker.0day.community Tapochek.net invite Jme-reunit3d account Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Funsharing account Hawke.uno account Monikadesign account Theoldschool.cc invite Fearnopeer account Alpharatio account Desitorrents account Wukongwendao.top account Chinapyg account Azusa.wiki account   Movies Trackers :   Pixelhd account Cinemageddon account DVDSeed account Cinemageddon account Cinemaz account Retroflix account Classix-unlimited - invite Movie-Torrentz (m2g.link) invite Punck-tracker.net account Tmghub account Tb-asian account Cathode-ray.tube account Greatposterwall account Telly account Arabicsource.net account   HD Trackers :   Hdf.world account HD-Only account Torrentland.li account HdSky account Hdchina account Chdbits account Totheglory account Hdroute account Hdhome account TorrentCCF aka et8.org account 3DTorrents invite HD-Torrents account Bit-HDTV account HDME.eu invite Hdarea.co account Asiancinema.me account JoyHD invite HDSpace invite CrazyHD invite Bluebird-hd invite Htpt.cc account Hdtime invite Ourbits.club account Hd4fans account Siambit account Privatehd account Springsunday account Tjupt account Hdcity.leniter invite Ccfbits account Discfan account Pt.btschool.club account Ptsbao.club invite Hdzone.me invite HDDolby account Danishbytes account Zonaq.pw account Tracker.tekno3d account Arabp2p account Hd-united account Reelflix.xyz account Hdatmos.club account Anasch.cc invite Tigris-t account Nethd.org account Hd.ai invite Hitpt.com account Hdmonkey account Dragonhd.xyz account Hdclub.eu account Forum.bluraycd.com account Carpt account Hdfun.me invite Pt.hdupt invite Puntotorrent account Ultrahd account Rousi.zip account Blutopia account   Music Trackers :   Dicmusic account Music-Vid account Open.cd account LzTr account ProAudioTorrents invite Jpopsuki invite TranceTraffic invite Audionews invite Kraytracker invite Libble.me invite Losslessclub invite Indietorrents.com invite Dimeadozen account Funkytorrents invite Karaokedl account zombtracker.the-zomb account Concertos invite Sugoimusic account Satclubbing.club invite Metal.iplay invite Psyreactor invite Panda.cd account Adamsfile account Freehardmusic account Tracker.hqmusic.vn accouunt Twilightzoom account 3 tb buffer Hiresmusic account Metalguru account   E-Learning Trackers :   BitSpyder invite Brsociety account Learnbits invite Myanonamouse account Libranet account 420Project account Learnflakes account Pt.soulvoice.club account P2pelite account Aaaaarg.fail invite Ebooks-shares.org account Abtorrents account   TV-Trackers :   Skipthecommericals Cryptichaven account TV-Vault invite Shazbat.TV account Myspleen account Tasmanit.es invite Tvstore.me account Tvchaosuk account Jptv.club account Tvroad.info   XXX - Porn Trackers :   FemdomCult account Pornbay account Pussytorrents account Adult-cinema-network account Bootytape account 1 Tb buffer Exoticaz account Bitporn account Kufirc account Gaytorrent.ru invite Nicept account Gay-torrents.org invite Ourgtn account Pt.hdbd.us account BitSexy account   Gaming Trackers :   Mteam.fr account BitGamer invite Retrowithin invite Gamegamept invite Cartoon/Anime/Comic Trackers : U2.dmhy account CartoonChaos invite Animetorrents account Nyaa.si account Mononoke account Totallykids.tv account Bakabt.me invite Revanime account Ansktracker account Tracker.shakaw.com.br invite Bt.mdan.org account Skyey2.com account Animetracker.cc   Sports Trackers :   MMA-Tracker invite T3nnis.tv invite AcrossTheTasman account RacingForMe invite Sportscult invite Ultimatewrestlingtorrents account Worldboxingvideoarchive invite CyclingTorrents account Xtremewrestlingtorrents account Tc-boxing invite Mma-torrents account Aussierul invite Xwt-classics account Racing4everyone account Talk.tenyardtracker account Stalker.societyglitch invite Extremebits invite   Software/Apps Trackers :   Ianon account Brokenstones account Appzuniverse invite Teamos.xyz account Graphics Trackers: Forum.Cgpersia account Gfxpeers account Forum.gfxdomain account Documentary Trackers: Forums.mvgroup account   Others   Fora.snahp.eu account Board4all.biz account Filewarez.tv account Makingoff.org/forum account Xrel.to account Undergunz.su account Corebay account Endoftheinter.net ( EOTI ) account Thismight.be invite Skull.facefromouter.space account Avxhm.se (AvaxHome) account Ssdforum account Notfake.vip account Intotheinter.net account Tildes.net invite Thetoonz account Usinavirtual account Hdclasico invite HispaShare account Valentine.wtf account Adit-hd account Forum-andr.net account Warezforums account Justanothermusic.site account Forbiddenlibrary.moe account Senturion.to account Movieparadise account Militaryzone account Dcdnet.ru account Sftdevils.net account Heavy-r.com account New-team.org account   NZB :   Drunkenslug account Drunkenslug invite Usenet-4all account Brothers-of-Usenet account Dognzb.cr invite Kleverig account Nzb.cat account Nzbplanet.net invite Ng4you.com account Nzbsa.co.za account Bd25.eu account NZB.to account   Prices start from 3 $ to 100 $   Payment methods: Crypto, Neteller, Webmoney, Revolut   If you want to buy something send me a pm or contact me on:   Email: morrison2102@gmail.com   Discord: LFC4LIFE#4173   Telegram: https://t.me/LFC4LIFE4173   Skype: morrison2102@hotmail.com
  • Topics

×
×
  • Create New...