Jump to content
Sign in to follow this  
apache ah64

::vote / Open URL(s) [562 / 602]

Recommended Posts

Hi,

This tutorial only works for 562 / 602 servers for example TkoScape, this is "how to add ::vote".

Client Sided

Open tf.java and search "if ((i_333_ ^ 0xffffffff) != -100) {".

Add under,

[CODE]
if (!string_336_.equals("") && bm.a(string_336_, -122)) {
kg.s = -1;
return true;
}
[/CODE]

The code,

[CODE]
if (string_337_.contains(":url:")) {
String url = string_337_;
string_337_ = "Opening: "+url.substring(6);
client.launchURL(url.substring(6));
}
[/CODE]

Now open client.java and declare the LaunchURL method to make it open your URL.

[CODE]
public static void launchURL(String url) {
String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Windows"))
Runtime.getRuntime().exec(
"rundll32 url.dll,FileProtocolHandler " + url);
else {
String[] browsers = { "firefox", "opera", "konqueror",
"epiphany", "mozilla", "netscape" };
String browser = null;
for (int count = 0; count < browsers.length && browser == null; count++)
if (Runtime.getRuntime().exec(
new String[] { "which", browsers[count] })
.waitFor() == 0)
browser = browsers[count];
Runtime.getRuntime().exec(new String[] { browser, url });
}
} catch (Exception e) {
System.out.println( "Error in opening URL"
+ ":\n" + e.getLocalizedMessage());
}
}
[/CODE]

Now add if this imports arn't delcared in client.java yet the code below,

[CODE]
import java.io.*;
import java.net.*;
[/CODE]

Server Sided

Open src > com > rs2hd > PacketHandler > CommandPacketHandler.java the command below,

[CODE]
if(cmd[0].equals("vote")) {
player.sm(":url: http://www.rspscoding.org/toplist/vote.php?id=1");
}
[/CODE]

Open src > com > rs2hd > PacketHandler > CommandsPacketHandler.java the command below,

[CODE]
if(cmd[0].equals("::vote")) {
player.sm(":url: http://www.rspscoding.org/toplist/vote.php?id=1");
}
[/CODE]

Now you are done, this is a easy conversation because I saw someone making a post for this for normal 562 earlier, posted this because I had this its easy altough at all .

Credits,
- Apache Ah64

Kind regards,
Apache Ah64

Share this post


Link to post
Share on other sites
[quote name='Intensive Tony']I dont think anyone is using a 562/602 anymore.

But nice job.[/QUOTE]

Just did for the people that use it :rolleyes:.

Share this post


Link to post
Share on other sites
[quote name='Intensive Tony']I dont think anyone is using a 562/602 anymore.

But nice job.[/QUOTE]
Yeah, I haven't seen any 562/602 around.

Nevertheless, nice release Apache :).

Share this post


Link to post
Share on other sites
Sign in to follow this  

×