Jump to content
  • 0

Little Help With Captcha Code


Question

Posted (edited)

hello Mxc i need some help from who understands java since i'm a bit noob as you can see and i'll go crazy, i made a antibot captcha by levels of punishment and i have tried using these pieces of code to put a config to look for items in the player's inventory and if you have to delete them, but i get 5000 errors in the server console after the system try to delete the items.

 

this is the config.java:

			ANTIBOT_3_LEVEL_LISTITEMS_REMOVE = L2JModSettings.getBoolean("AntiBotLevel3ListItemsRemove", true);
			String[] AntibotRemoveItems = L2JModSettings.getString("AntibotRemoveItems", "").split(",");
			ANTIBOT_REMOVE_ITEMS_LIST = new ArrayList<>(AntibotRemoveItems.length);
			for (String id : AntibotRemoveItems)
			{
				ANTIBOT_REMOVE_ITEMS_LIST.add(Integer.parseInt(id));
			}

this is my antibot file ( piece of code):

					if (Config.ANTIBOT_3_LEVEL_LISTITEMS_REMOVE)
					{
						for (L2ItemInstance item : player.getInventory().getAllItemsByItemId2(Config.ANTIBOT_REMOVE_ITEMS_LIST))
						{
							if (item != null)
							{
								player.getInventory().destroyItem("Anti Bot", item, player, player);
							}
						}
						
					}
					
					break;

and this is the method that i created in pcinventory.java to check the list...:

	/**
	 * @param ANTIBOT_REMOVE_ITEMS_LIST
	 * @return
	 */
	public L2ItemInstance[] getAllItemsByItemId2(List<Integer> ANTIBOT_REMOVE_ITEMS_LIST)
	{
		return getAllItemsByItemId2(ANTIBOT_REMOVE_ITEMS_LIST);
	}

and this is the config.ini:

# Remove the list of items listed below on third level punishment?
AntiBotLevel3ListItemsRemove = True

# Remove the list of items listed below on third level punishment
# Example 6673,3470 (festival adena, gold bars)
AntibotRemoveItems = 6673,3470

i am getting the errors in the method getAllItemsByItemId2() , if someone can give me a hand 's take will be thankful ,thanks in advance.

Edited by b0rto

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Your method is calling itself, leading to a permanent loop (server processes it until it ends into a stackoverflow).

 

What you want to do is to loop over all items (generic existing method), retrieve their ids and compare id with whatever id from the list (I added ArrayUtil.contains for such case on aCis, dunno if you got a similar thing on whatever project you use). If it's positive, you delete the item.

 

Take inspiration from "castle circlet removal" custom.

Edited by Tryskell

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hey chatgpt. Make me a website for my private l2jserver called l2karma. Make no mistakes.
    • Server Description L2 Karma is a permanent Interlude 1x server built on L2J with retail-like mechanics and a long-term vision — not a seasonal reset or wipe server. We focus on competitive longevity, fair play, and a community where every player matters. Core Features ✔ True x1 Experience (XP / SP / Adena / Drop / Spoil) ✔ Retail mechanics — no forced progression shortcuts ✔ Single-box only (1 client per player — no multi-boxing advantage) ✔ No Pay-to-Win & strict anti-RMT policy ✔ Already live and active with players progressing ✔ Long-term commitment — 3-year guarantee ✔ Designed for meaningful PvP and community cohesion 📏 Server Rules No Multi-Boxing Advantage — Only one client per account is allowed. No Pay-to-Win Items or Services — VIP runes are optional and do not lock content. No Bots, Scripts, or Automation — Zero tolerance. Suspicious accounts will be banned. No Exploit Abuse — Reporting exploits immediately avoids penalties. No RMT / Real Money Trading — Strict enforcement — economy integrity matters. Fair Play Only — Harassment and racism are not allowed in chat or Discord. Respect Admin Decisions — Official rulings are final to keep the server stable. 📥 How to Join 🔗 Website: https://l2karma.org 🔗 Discord: https://discord.gg/VV9RAfmnth Chronicle: Interlude Rates: x1 (Classic) Box Limit: Single Box 🧠 What Makes Us Different ✔ Permanent World — No resets ever ✔ Designed for players tired of wipe-cycle servers ✔ Community-centric growth — not rinse-and-repeat launches ✔ Competitive but fair environment ✔ Events, structured seasons, and ongoing content support
    • A widespread proxy service, operating through hijacked devices, has been shut down in a cross-industry effort led by Google. The network, known as IPIDEA, functioned by secretly converting millions of personal devices into proxies for malicious actors. The Mechanism of the Scheme The operation distributed hidden code within seemingly legitimate free apps and VPN services. Once installed, this code enrolled the user’s device into a pool of residential IP addresses. These addresses were then sold anonymously, primarily to cybercriminal and state-sponsored groups, to mask the origin of attacks, fraud, and espionage. Key impacts of the network included: Facilitating operations for more than 550 identified threat actors. Exposing unsuspecting device owners to potential legal and security risks by associating their IP addresses with criminal traffic. The Takedown Strategy Google and its partners disrupted the service by: Seizing core operational domains. Using Google Play Protect to detect and remove malicious applications. Coordinating with infrastructure providers to prevent the network from reestablishing itself. The action highlights the necessity of continuous user awareness, developer diligence in code reviews, and proactive industry cooperation to maintain cybersecurity. Front Companies Associated with IPIDEA IPIDEA masked its activities under various brand names, such as: Proxy Brands: 360 Proxy, 922 Proxy, Luna Proxy, IP2World, ABC Proxy. VPN Brands: Door VPN, Radish VPN, Galleon VPN. SDK Brands: PacketSDK, HexSDK (the toolkits used to embed proxy code).   Choosing Ethical Proxy Services Alternatives For lawful purposes like market research, ad verification, or data aggregation, selecting a transparent and consensual provider is essential. Reputable services obtain explicit user permission for their networks and enforce strict compliance measures. Examples of Established Providers: Bright Data: A leading, consent-based residential proxy network. Oxylabs: Provides large-scale proxy solutions for enterprise needs. MoMoProxy: Maintains a large pool of residential IPs for tasks like web scraping.   Only $850/1TB.  https://momoproxy.com   Identifying a Legitimate Provider: A trustworthy service will typically demonstrate: Informed Consent: Networks are built with the clear agreement of participants. Robust Compliance: Proactive systems to prevent abuse and respect website terms. Operational Transparency: Public-facing policies, identifiable corporate structure, and genuine customer support. Conduct thorough due diligence. Opt for providers that are clear about their IP sources and maintain strong anti-abuse policies, ensuring your legitimate activities do not inadvertently support harmful operations.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..