Jump to content
  • 0

Bot Window Voicedcommand Handler


Question

Posted

I made a little voicedcommand to call the Bot window in case the player close it by mistake. I have no errors when I use the command but nothing happen. I got this error on the voicedcommandhandlers folder.

Error on: C:\Users\Giovanni Amorim\Desktop\Project_l2obs\game\data\scripts\handlers\voicedcommandhandlers\Code.java.error.log
Line: -1 - Column: -1

no main method in handlers.voicedcommandhandlers.Code

Can someone help me make this code work. Thank you in advance.

Here is the code.

package handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2AntiBot;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
 * @author disorder25
 */
public class Code implements IVoicedCommandHandler
{
	private static String[] VOICED_COMMANDS =
	{
		"code"
	};
	
	@Override
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
	{
		if (command.equalsIgnoreCase("code"))
		{
			L2AntiBot.ShowHtml_Start(activeChar);
		}
		else
		{
			activeChar.sendMessage("omg lame error! where is " + command + " ! blame the Server Admin");
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}

7 answers to this question

Recommended Posts

  • 0
Posted (edited)

You must search how it voiced command handlers works...and i think you have this all false..

Did you have any command .code?

Where is code you mus put your command tour command starts with the java file for the .bot or i dont what you have...

 

And this L2AntiBot.ShowHtml_Start(activeChar); go not there...

 

if (command.equalsIgnoreCase("Your command"))

And up where is "code" change to "your command"

And sorry but im with phone and i cant help so much..

Edited by Reborn12
  • 0
Posted

you don't even get the message in case that the code for the antibot is not working?

i mean this message that you set "omg lame error! where is " + command + " ! blame the Server Admin"

no I don't.

  • 0
Posted

OK i got it to work now, I just need to add a restriction for it not to work in case they click "Confirm" without enter a code.

 

Here is the working code.

package handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2AntiBot;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;

/**
 * @author disorder25
 */
public class Code implements IVoicedCommandHandler
{
	private static String[] VOICED_COMMANDS =
	{
		"code"
	};
	
	@Override
	public boolean useVoicedCommand(String command, L2PcInstance player, String target)
	{
		NpcHtmlMessage _npcHtmlMessage = new NpcHtmlMessage(0);
		
		if (command.equalsIgnoreCase("code"))
		{
			_npcHtmlMessage.setHtml(L2AntiBot.ShowHtml_Start(player));
			player.getActingPlayer().sendPacket(_npcHtmlMessage);
		}
		else
		{
			player.sendMessage("omg lame error! where is " + command + " ! blame the Server Admin");
			return false;
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}

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

    • WARFRONT is an Interlude faction PvP server built around one idea: the battlefield should never feel static. Choose your side. Angels vs Demons.   Capture Outposts to move the frontline and your faction's respawns. Fight for the Main Outpost to unlock dynamic events and HQ assaults. Push into enemy territory and destroy their Headquarters to win the battle. But WARFRONT goes far beyond traditional faction PvP.     ▶️ Dynamic Outpost & territory warfare ▶️ Daily Faction Castle Siege ▶️ Weekly Clan Siege ▶️ Grand Boss events ▶️ Kamaloka instanced party content ▶️ Reworked Interlude classes ▶️ Skill & Ability Tree  ▶️ Battlefield Contracts ▶️ Faction & individual rankings ▶️ Long-term character progression ▶️  Battle Pass & cosmetic progression ▶️  30-minute rotating battlefields   We've also reworked classes that are traditionally overlooked in faction PvP. Bishop can enter an offensive Inquisitor role, Daggers have Shadow Step, Prophet has its own combat toolkit, Overlord supports the entire faction, and several other classes have received new mechanics and balance changes. ▶️  SKILL & ABILITY TREE  Skill & Ability Tree system designed to add another layer of character progression and build choice to WARFRONT. Rather than simply increasing stats, the goal is to give players meaningful choices that can change how their character develops and how their class performs on the battlefield. This system is currently being tested, with more information and previews coming soon. The goal isn't to replace Interlude. It's to make Interlude faction PvP exciting again.   ▶️ CLOSED BETA: 03 OCTOBER 2026 Closed Beta will be our opportunity to push the systems, class balance and battlefield mechanics as hard as possible before Grand Opening. We built it. Now we need you to break it. ▶️  Website & Closed Beta Registration https://l2warfront.com ▶️  Discord https://discord.gg/u93YhB5Exy
    • Legends never truly die. They just wait for the right time to return. For over a decade, Vindication (aka Noobwars) held the crown as the longest-running and most legendary Greek private server. We built a home, created unbreakable bonds, and lived through thousands of hours of epic PvP, endless castle sieges, and unforgettable memories. Lately, others have tried to use our name to mimic what we built. But you can't copy soul, and you can't fake history. As the original Administrator, I am proud to tell you that the waiting is finally over. The true architect is back to bring you the ultimate Interlude experience. We are returning to revive that pure, old-school Lineage 2 nostalgia—the way it was always meant to be played. Just the authentic Vindication vibe we all fell in love with. Gather your old comrades, prepare your clans, and get ready to step back into the world of Interlude where it all started.   The original era begins again. Welcome home. GM*absolut*   Server Rates VINDICATION CLASSIC INTERLUDE x4  EXP/SP: x4  Adena: x2  Drop: x3  Spoil: x3  Seal Stones: x2  Raid Boss EXP/SP: x2  Raid Boss Drop: x1  Epic Boss Drop: x1  Manor: x1  Safe Enchant: +3  Max Enchant: +20  Normal Scroll Chance: Retail  Blessed Scroll Chance: Retail   🚀 Nostalgia Meets Next-Gen Technology We are not just bringing back the server you loved; we are upgrading it for the modern era. For the first time ever, we have integrated DLSS 5 into our Interlude client. Experience the classic gameplay you miss with ground-breaking performance     More info @ sites   Website:    http://www.vindication.gr Discord:       https://discord.gg/BVtgYvjyk6 Facebook:  https://www.facebook.com/groups/lineage2gr
    • maybe you can try L2jBayev Chronicle 4 project.
  • 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..