Jump to content

Hot[Share] Command Open URL, and best /Vote command


xdem

Recommended Posts

With this code you will be able to open users Default Browser with one or more URLs you choose, for example you dont need anymore to send the URL via text message which must be copied and paste to browser letter by letter BUT it will automatically open the browser with the URLs you choose, the code works on JAVA6+

String URLs[]=
{
	"www.maxcheaters.com",//Delete or add more
	"www.maxcheaters.com/forum/index.php",
};
try 
{
    if (Desktop.isDesktopSupported()) 
	{
        Desktop desktop = Desktop.getDesktop();
        if (desktop.isSupported(Desktop.Action.BROWSE)) 
        {
        	for (int i=0; i!=URLs.length; i++)
				desktop.browse(new URI(URLs[i]));
        }
    }
} 
catch (Exception e) 
{
	e.printStackTrace();
}		

You can put this code in any command or in any action, even in enterworld.java!

 

For example I created a /vote command so you can test(which AUTOMATICALLY redirects you to your vote web page), you add your URLs or a single URL into the String border and the command opens those URLs automatically, so lets start...

Download the command http://www.4shared.com/file/bMDkyi-u/Vote.html? and paste it on your scripts\handlers\usercommandhandlers, then add the imports on your MasterHandler.java,

and make it:

import handlers.usercommandhandlers.Time;
+import handlers.usercommandhandlers.Vote;

 

AND on same file MasterHandler.java

		Time.class,
		+Vote.class,
		OlympiadStat.class,

 

 

Also for the command to work you must add this line to your CommandName-e located in your System file (if you get errors open it reply here) i opened mine with ct2.4 file edit

133	109	a,Olympiad Score\0
+134	133	a,vote\0

 

Credits me for both of the code and vote, and OFC google books for help:)

Link to comment
Share on other sites

okey, but this command isn't opening the URLs on the computer where server runs? I don't see any player/client related thing that would use the requestor of command, but correct me if I am wrong.

Link to comment
Share on other sites

okey, but this command isn't opening the URLs on the computer where server runs? I don't see any player/client related thing that would use the requestor of command, but correct me if I am wrong.

it will open the URL from the default broswer of the pc where the player is logged in ! So it will work 100 %!
Link to comment
Share on other sites

it will open the URL from the default broswer of the pc where the player is logged in ! So it will work 100 %!

okey, but what sets it to "player" ? parameter activeChar isn't used

Link to comment
Share on other sites

i mean for interlude freya h5?

its for all clients man, but not for all packs, each pack depending on release date has diffrent java version, for example freya/H5 use java7

Link to comment
Share on other sites

Guest Elfocrash

Guys I don't wanna disappoint you but this won't work. First it is really bad coded and second it will only open the browser at the server pc and not the character's/user's pc.

 

I tried this months ago and I know. The only way of getting it work is to decompile or add a dll file that will link the client with this browser usage (pretty much how it works on freya++ from retail).

 

There is also another way but it is a bit mind-beep- to get it working.

 

So just so you know there is no way something like that will ever work without client modification.

 

 

it will open the URL from the default broswer of the pc where the player is logged in ! So it will work 100 %!

There are really many things you have to learn and consider about coding. It is better that someone should not have an opinion when his knowledge is poor.

Link to comment
Share on other sites

Guys I don't wanna disappoint you but this won't work. First it is really bad coded and second it will only open the browser at the server pc and not the character's/user's pc.

 

I tried this months ago and I know. The only way of getting it work is to decompile or add a dll file that will link the client with this browser usage (pretty much how it works on freya++ from retail).

 

There is also another way but it is a bit mind-beep- to get it working.

 

So just so you know there is no way something like that will ever work without client modification.

 

Ok lock it then

Link to comment
Share on other sites

Guys I don't wanna disappoint you but this won't work. First it is really bad coded and second it will only open the browser at the server pc and not the character's/user's pc.

 

I tried this months ago and I know. The only way of getting it work is to decompile or add a dll file that will link the client with this browser usage (pretty much how it works on freya++ from retail).

 

There is also another way but it is a bit mind-beep- to get it working.

 

So just so you know there is no way something like that will ever work without client modification.

 

There are really many things you have to learn and consider about coding. It is better that someone should not have an opinion when his knowledge is poor.

It seems that your knowledge  is poor ! There is a way to make it work without any kind of client modification. I got it working on my server files but i not gonna share it here ...

Actualy the method xdem shared here it can work as i said if you know how to do it !

 

 

Link to comment
Share on other sites

Guest Elfocrash

It seems that your knowledge  is poor ! There is a way to make it work without any kind of client modification. I got it working on my server files but i not gonna share it here ...

Actualy the method xdem shared here it can work as i said if you know how to do it !

 

 

Yeah sure it does. You are definatelly wrong but i won't continue it here.

 

PS: Even Issle said i was right. Nvm.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

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