Code:
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class RSVoter extends JFrame implements Runnable {
private static final Pattern pattern = Pattern.compile("<td class=\"alL\"><a href=\"hiscorepersonal\\.ws\\?user1=[^\"]+\">([^<]+)</a></td>");
public RSVoter() {
initComponents();
setLocationRelativeTo(null);
proxyLink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
lookupDD = new JComboBox();
jLabel1 = new JLabel();
jLabel2 = new JLabel();
rankBox = new JTextField();
jLabel3 = new JLabel();
ipBox = new JTextField();
jLabel4 = new JLabel();
jLabel5 = new JLabel();
portBox = new JTextField();
startButton = new JButton();
stopButton = new JButton();
jLabel6 = new JLabel();
usernameLabel = new JLabel();
jLabel8 = new JLabel();
statusLabel = new JLabel();
proxyLink = new JLabel();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setTitle("Enfilade's Vote Spoofer");
setResizable(false);
lookupDD.setModel(new DefaultComboBoxModel(new String[] { "Overall (Total Levels)", "Attack", "Defence", "Strength", "Constitution", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecrafting", "Hunter", "Construction", "Summoning", "Dungeoneering" }));
jLabel1.setText("Retrieve names from:");
jLabel2.setText("Starting rank:");
rankBox.setText("500000");
jLabel3.setText("Proxy Settings:");
ipBox.setHorizontalAlignment(JTextField.RIGHT);
ipBox.setText("222.88.40.6");
jLabel4.setText("IP:");
jLabel5.setText("Port Number:");
portBox.setHorizontalAlignment(JTextField.RIGHT);
portBox.setText("8080");
startButton.setText("Start Voting!");
startButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
startButtonActionPerformed(evt);
}
});
stopButton.setText("Stop Voting");
stopButton.setEnabled(false);
stopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
stopButtonActionPerformed(evt);
}
});
jLabel6.setText("Last used username:");
usernameLabel.setText("N/A");
jLabel8.setText("Status:");
statusLabel.setText("N/A");
proxyLink.setText("<html><a href=\"http://www.hidemyass.com/proxy-list/\">Find a proxy</a></html>");
proxyLink.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
proxyLinkMouseClicked(evt);
}
});
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(lookupDD, 0, 173, Short.MAX_VALUE)
.add(jLabel1)
.add(jLabel2)
.add(rankBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
.add(jLabel3)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel4)
.add(jLabel5))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(portBox)
.add(ipBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)))
.add(proxyLink)
.add(layout.createSequentialGroup()
.add(10, 10, 10)
.add(statusLabel))
.add(layout.createSequentialGroup()
.add(10, 10, 10)
.add(usernameLabel))
.add(startButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
.add(stopButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
.add(jLabel6)
.add(jLabel8))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lookupDD, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(rankBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(ipBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel4))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel5)
.add(portBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(proxyLink)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(startButton)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(stopButton)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel6)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(usernameLabel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel8)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(statusLabel)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void startButtonActionPerformed(ActionEvent evt) {
new Thread(this).start();
}
private void stopButtonActionPerformed(ActionEvent evt) {
stop = true;
}
private void proxyLinkMouseClicked(MouseEvent evt) {
try {
URL link = new URL("http://www.hidemyass.com/proxy-list/");
Desktop.getDesktop().browse(link.toURI());
} catch(Exception e) {
alert("An error occured while opening the link.\nVisit http://www.hidemyass.com/proxy-list/ manually.");
}
}
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
RSVoter voterFrame = new RSVoter();
voterFrame.setVisible(true);
}
});
}
private boolean stop;
public void run() {
int portNumber;
try {
portNumber = Integer.parseInt(portBox.getText());
} catch(NumberFormatException e) {
alert("The port number must be an integer number!");
return;
}
final Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(ipBox.getText(), portNumber));
final int skill = lookupDD.getSelectedIndex();
int rank;
try {
rank = Integer.parseInt(rankBox.getText());
if(rank < 1 || rank > 999978) {
alert("The starting rank must be greater than 1\nand less than 999978.");
return;
}
} catch(NumberFormatException e) {
alert("The starting rank must be an integer number!");
return;
}
stop = false;
stopButton.setEnabled(true);
startButton.setEnabled(false);
String username;
ArrayList<String> list = new ArrayList<String>(22);
while(!stop) {
try {
if(list.isEmpty()) {
if(rank < 1) {
alert("Out of names. Please choose a different skill!");
break;
}
statusLabel.setText("Loading usernames...");
URL highscoreURL = new URL("http://services.runescape.com/m=hiscore/overall.ws?rank=" + rank + "&table=" + skill + "&scroll=true&category_type=0");
HttpURLConnection c = (HttpURLConnection)highscoreURL.openConnection(proxy);
c.setDoInput(true);
BufferedReader in = new BufferedReader(new InputStreamReader(c.getInputStream()));
String line;
Matcher m;
while((line = in.readLine()) != null) {
m = pattern.matcher(line);
if(m.find())
list.add(m.group(1));
}
in.close();
c.disconnect();
rank -= 22;
rankBox.setText("" + rank);
}
username = list.remove(0);
usernameLabel.setText(username);
statusLabel.setText("Voting...");
String data = URLEncoder.encode("name", "UTF-8") + "=" +
URLEncoder.encode(username, "UTF-8") + "&" +
URLEncoder.encode("submit", "UTF-8") + "=" + URLEncoder.encode("vote", "UTF-8") +
URLEncoder.encode("submit", "UTF-8") + "=";
URL urlToVote = new URL("http://runescape.com/m=poll/wildy.ws");
HttpURLConnection connection = (HttpURLConnection)urlToVote.openConnection(proxy);
connection.setRequestMethod("POST");
connection.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
wr.write(data);
wr.flush();
wr.close();
statusLabel.setText("Voted. Waiting for response...");
connection.getResponseMessage();
connection.disconnect();
statusLabel.setText("Server response received.");
} catch(IOException e) {
statusLabel.setText("Vote failed.");
}
}
statusLabel.setText("Done.");
stopButton.setEnabled(false);
startButton.setEnabled(true);
}
public void alert(String message) {
JOptionPane.showMessageDialog(this, message);
}
// Variables declaration - do not modify
private JTextField ipBox;
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel3;
private JLabel jLabel4;
private JLabel jLabel5;
private JLabel jLabel6;
private JLabel jLabel8;
private JComboBox lookupDD;
private JTextField portBox;
private JLabel proxyLink;
private JTextField rankBox;
private JButton startButton;
private JLabel statusLabel;
private JButton stopButton;
private JLabel usernameLabel;
// End of variables declaration
}
Please download this at: