Jump to content
  • 0

[Help]How to use a method, via html.


Question

Posted

Guys, i am working on a new kind of voiced command for teleport, and i have created a method in my voiced command file. I want to use this method, via html. What i mean? When i press the button teleport on html, the action it will do, will be written on my java file for voiced command. Like other teleport htmls, they say action: _goto x. How can i do that, please?

12 answers to this question

Recommended Posts

  • 0
Posted

bump. sorry for making another bump today, i just modified the whole post, i solved the previous problem, and since it's about the same thing, i decided not to make a new post...

  • 0
Posted

Guys, i am working on a new kind of voiced command for teleport, and i have created a method in my voiced command file. I want to use this method, via html. What i mean? When i press the button teleport on html, the action it will do, will be written on my java file for voiced command. Like other teleport htmls, they say action: _goto x. How can i do that, please?

you can build an new html via java and can use teleToLocation method instead of make a new html file.
  • 0
Posted

you can build an new html via java and can use teleToLocation method instead of make a new html file.

no it has nothing to do with teletolocation, it's a completely different thing. and i want to have the html on 'soft' mode not hard coded :P so users will be able to edit that...

  • 0
Posted

Don't quite understand but do you mean  like this where you click button and it teleports you? you want to know the html code for it? well here that is:

 

<a action="bypass -h npc_%objectId%_goto 9900" msg="811;Gludin Arena">Gludin Arena - 1 Olympiad Token</a>

 

or for actual buttons like in L2J admin menu:

 

<button value="To Town" action="bypass -h npc_%objectId%_goto 1111" width=150 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">

 

 

  • 0
Posted

Don't quite understand but do you mean  like this where you click button and it teleports you? you want to know the html code for it? well here that is:

 

<a action="bypass -h npc_%objectId%_goto 9900" msg="811;Gludin Arena">Gludin Arena - 1 Olympiad Token</a>

 

or for actual buttons like in L2J admin menu:

 

<button value="To Town" action="bypass -h npc_%objectId%_goto 1111" width=150 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">

 

 

pff no. if you can understand, this _goto 1111 is a method in L2TeleporterInstance(if i am right) file. i have created a new method and i want to use it instead of _goto, for example:

<button value="To Town" action="bypass -h npc_%objectId%_OLYMPUS" width=150 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">

  • 0
Posted

I told you, edit L2TeleporterInstance and create new bypass.

hmm w8 going to try this... and i tell you again. sorry i didn't see your first post :P

 

EDIT:

        if (actualCommand.equalsIgnoreCase("teleport"))
        {
    	int idx,idy,idz;
	if (name.equalsIgnoreCase("Giran")) {
		idx = 83400;
		idy = 147943;
		idz = -3404; }
	else if (name.equalsIgnoreCase("Aden")) {
		idx = 146331;
		idy = 25762;
		idz = -2018; }
	else { 
		idx=0;
		idy=0;
		idz=0;
	}
		String val = command.substring(17);
		st = new StringTokenizer(val);
		if (st.countTokens() == 1)
		{
			String names = st.nextToken();
			if(name != null)
			{
				String num = st.nextToken();
	               player.teleToLocation(idx, idy, idz, true);
			}
		}
}

here is my bypass. i tested it and it doesn't work. maybe i have to add sth else too in it? i added this after:

                if (10 >= minPrivilegeLevel) // NOTE: Replace 10 with privilege level of player
                doTeleport(player, whereTo);
                else player.sendMessage("You don't have the sufficient access level to teleport there.");
                return;
            }
        }

  • 0
Posted

pff no. if you can understand, this _goto 1111 is a method in L2TeleporterInstance(if i am right) file. i have created a new method and i want to use it instead of _goto, for example:

<button value="To Town" action="bypass -h npc_%objectId%_OLYMPUS" width=150 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">

 

why you wanna create a new method instead of goto..lawl.., anyway just add bypass

  • 0
Posted

Just make sure to insert new bypass in correct place.

 

L2TeleporterInstance.java

 

There is void:

 

	@Override
public void onBypassFeedback(L2PcInstance player, String command)
{

        }

 

And for example now add test bypass:

 

		else if (command.startsWith("TestLol"))
	{
		player.sendMessage("it works, lol!");
	}

 

Now use this bypass at html (only for NPC's with L2Teleporter Type, since its L2TeleporterInstance)

 

Simple and clear.

 

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

    • Hi everyone, Since I’m no longer interested in L2 servers, if anyone is willing to continue the project, let me know. I’m currently selling the entire project. DM me for more information if you’re genuinely interested. I can offer limited free support for the first couple of months. It is not cheap. The sale includes the domain, the recently fully redesigned website, the updater, the interface, server files with Lucera ext source, and the database (excluding account passwords, emails, and other private information; character data can remain).   Server for test: https://lineage2.gold/download Server Info: https://lineage2.gold/info Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113  
    • You invent yourself a life - bad for you, one of the inner core dev, fernandopm, which worked hard over aCis quests from 2011 to 2016 is argentinian. I teached him back in time to work and make proper quests. My dev team comes from 10+ countries and I'm myself french. "Racist/nationalist" card ? Not working bro.   Not sure why I should thank you to send me questions, and regarding bug reports, so far, I got none of yours in either discord, gitlab, or forums. I'm sorry if you feel "ignored", but that's more a psychanalyst you need to speak with if you put emotions towards someones' appreciation over a forum. I never ignore a bug report, and if so (like skills reports), it's because I got a bigger plan (skills refactor, in that case). In any case, I delivered cookies for the bug report/fix, even if it dated of months, with proper credits over changesets. "Victim card" ? Not really working, but ok, maybe you're "emotional".   I barely make money out of aCis, for the spent time - simply selling my services, or even coding/administrating a minecraft/L2J server would make far more money. Breaking intentionally things would be stupid. If you don't understand I'm not the only one working on that pack, I can't help you. Also, the scale of edits is sometimes extreme - AI L2OFF ? 1800 files added. How do you want everything works in a single shot ? "Exploiting noobz for money" card ? Still not working, or I'm a terrible businessman.   Meanwhile - you shadow advertise your project, L2JOne (since 2017 btw) - you should maybe start by the beginning saying you're a competitor and aCis is actually a spike in your foot. That also explains why you act like that. RusAcis got the exact same strategy, speaking bad of me, saying they got unique fixes (you speak about I break things, they break and recode things 4 times sometimes, btw), but successfully reselling latest revision with poorly executed stuff. "aCis is good, Tryskell is ok, but I solve all issues in extreme low time so I can piss over him" card ? Mmmmhhhh.   Our conversation ends here if you want, I don't force ppl to speak with me if they don't want - hopefully, people would understand I'm not the arrogant one and the one who doesn't want to talk, or even collaborate. :). I understand you got your own project and got no will to improve aCis.   NOTE : I'm extremely happy for your call of ExShowServerPrimitive with getValidGeoLocation, extremely impressive. Arrogant, no. Sarcastic ? Maybe.   Good night everyone.
    • Hi. @GX-Ext, svn does not work. is there anywhere else where we can get source code? Thank you so much.
  • 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock