Jump to content

Recommended Posts

Posted

http://prntscr.com/j77h2z

this is how you start this will open a window.

you register also the voiced command on the voiced handler, this is an example of what you ask the rest is up to the brain.

Posted
  On 4/19/2018 at 5:59 AM, Nightw0lf said:

http://prntscr.com/j77h2z

this is how you start this will open a window.

you register also the voiced command on the voiced handler, this is an example of what you ask the rest is up to the brain.

Expand  

i think you understand me wrong mate , because i think my english is little bad .... i want to make an command for example ( .gatekeeper ) and when i use that command in chat i want to open gatekeper html just that only 

Posted
  On 4/19/2018 at 7:48 PM, Prostyle1990 said:

i think you understand me wrong mate , because i think my english is little bad .... i want to make an command for example ( .gatekeeper ) and when i use that command in chat i want to open gatekeper html just that only 

Expand  

the answer is in nightw0lf's link. try to understand what you have to change.

 

Btw, learn some basics before you continue...

Posted

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

Posted
  On 4/19/2018 at 9:16 PM, tazerman2 said:

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

Expand  

you just helped him to raise to many questions that he dont even know how to ask he has to start from the basics good luck on that complex way to start

Posted
  On 4/19/2018 at 9:16 PM, tazerman2 said:

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

Expand  

man thank you for you answer , but i already lost 1 week without any succes :( maybe can you make for me just an command like .gatekeeper and when i press .gatekeeper i want to open _bbsgatekeper html page please ? i want to use that commmand in l2mythras file witch is shared here on mxc please 

Posted
  On 4/25/2018 at 5:47 PM, SweeTs said:

I don't get it. Why would I use .gatekeeper rather than pressing directly ALT+G? I wonder.

Expand  

alt + g + 1 click = 2 buttons 1 click
tele = 4 buttons
true why?????? well maybe is some old server with default cb xD somebody opens official server again!

Posted

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

Posted
  On 4/25/2018 at 10:46 PM, Tony360 said:

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

Expand  

You have right alt+g its only for admin  ! now i will explain why i want to make this commands , just because i adapted this shortcuts to my interface and when i press each button just appear in chat .buffer .gatekeeper .shop etc....because commands are not implemented in java :D to open the html page for each button 

 

 

here is the pic ---------> https://ibb.co/gBW1rx <--------------

Posted
  On 4/25/2018 at 10:46 PM, Tony360 said:

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

Expand  

yes alt+b oh i did not know alt + g is "admin package" can you tell us more about it? what it does?

 

  On 4/25/2018 at 11:50 PM, Prostyle1990 said:

You have right alt+g its only for admin  ! now i will explain why i want to make this commands , just because i adapted this shortcuts to my interface and when i press each button just appear in chat .buffer .gatekeeper .shop etc....because commands are not implemented in java :D to open the html page for each button 

 

 

here is the pic ---------> https://ibb.co/gBW1rx <--------------

Expand  

but you have the code and i gave you an example you have the tools you have the materials USE them now its like having a naked lady in your bed and asking the crowd how to fuck her. ffs.

Posted
  On 4/26/2018 at 5:53 AM, Nightw0lf said:

yes alt+b oh i did not know alt + g is "admin package" can you tell us more about it? what it does?

Expand  

 

Dude he said something about community and I though you and SweeTs mistakly said “G”and not “B” stop be toxic.

Posted

guys what i want to do its only to create a command for my buttons when i press button gatekeper to open "bypass _bbsgatekeeper" page but right now when i press button with gatekeper only appear in chat .gatekeeper because i have no voicedcommands maybe someone can make for me an example ? files what i use its shared here L2Mythras file  https://ibb.co/gBW1rx 

Posted

well finally i did this working for me but now i have another problem for example when i type .gk open me gatekeeper page but not in corectly dimension and open in dialog dimension that mean my original gatekeper html page its 780x512 and when i press .gk it open in 289x359 how i can fix that ?any can help ?

Posted (edited)

guys my code look like that but i dont know why in game when i use .gatekeeper appear me gk page but in a small window and not on original window maybe someone can help me please ???? 

 

 


 

package l2f.gameserver.handler.voicecommands.impl;

import l2f.gameserver.handler.voicecommands.IVoicedCommandHandler;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeper implements IVoicedCommandHandler
{

    @Override
    public boolean useVoicedCommand(String command, Player activeChar, String target)
    {
        if (!target.isEmpty())
        {


        }
        showMainPage(activeChar);
        return true;
    }


    private static void showMainPage(Player activeChar)
    {
        activeChar.sendPacket(new NpcHtmlMessage(0).setFile("scripts/services/communityPVP/gatekeeper/main.htm"));
    }

    @Override
    public String[] getVoicedCommandList()
    {
        return new String[]
        {
            "gatekeeper"
        };
    }

}


 

Edited by Prostyle1990

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
Reply to this topic...

×   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

    • Αν σε ενδιαφέρει ο κόσμος των κρυπτονομισμάτων και θέλεις να συζητάς, να μαθαίνεις, αλλά και να μοιράζεσαι γνώσεις με άλλους Έλληνες χρήστες, τότε σε προσκαλούμε στο νέο μας Telegram forum αποκλειστικά για την ελληνική crypto κοινότητα!   Συζητάμε για Bitcoin, altcoins, DeFi, trading, νέες τάσεις, NFTs, τεχνική ανάλυση και ό,τι άλλο αφορά τον κόσμο των crypto. Είτε είσαι αρχάριος είτε προχωρημένος, θα βρεις κάτι που σε ενδιαφέρει και μια παρέα που μιλάει τη γλώσσα σου – κυριολεκτικά!     Σύνδεσμος πρόσβασης:    https://t.me/investfuture_crypto_gr    ή   Scan QR Code:       Έλα να γίνουμε η πιο ενεργή ελληνική κοινότητα στο χώρο των crypto!
    • Αν σε ενδιαφέρει ο κόσμος των κρυπτονομισμάτων και θέλεις να συζητάς, να μαθαίνεις, αλλά και να μοιράζεσαι γνώσεις με άλλους Έλληνες χρήστες, τότε σε προσκαλούμε στο νέο μας Telegram forum αποκλειστικά για την ελληνική crypto κοινότητα!   Συζητάμε για Bitcoin, altcoins, DeFi, trading, νέες τάσεις, NFTs, τεχνική ανάλυση και ό,τι άλλο αφορά τον κόσμο των crypto. Είτε είσαι αρχάριος είτε προχωρημένος, θα βρεις κάτι που σε ενδιαφέρει και μια παρέα που μιλάει τη γλώσσα σου – κυριολεκτικά!     Σύνδεσμος πρόσβασης:    https://t.me/investfuture_crypto_gr    ή   Scan QR Code:       Έλα να γίνουμε η πιο ενεργή ελληνική κοινότητα στο χώρο των crypto!
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Good luck with your g/o!
  • Topics

×
×
  • Create New...