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.

 

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.



×
×
  • Create New...