Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fletchto99
Last active October 11, 2022 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fletchto99/2c804e5f114ea139cfbe32c95e0c91de to your computer and use it in GitHub Desktop.
Save fletchto99/2c804e5f114ea139cfbe32c95e0c91de to your computer and use it in GitHub Desktop.
Ayy lmao... Back to the days when I coded in notepad!
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.util.LinkedList;
import javax.swing.*;
import javax.imageio.ImageIO;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import org.rsbot.script.*;
import org.rsbot.event.listeners.*;
import org.rsbot.script.wrappers.*;
import org.rsbot.script.methods.Skills;
import org.rsbot.event.events.ServerMessageEvent;
@ScriptManifest(authors = "Fletch To 99", keywords = "Fletching", name = "Universal Fletcher", version = 2.39, description = "Settings In Gui")
public class UniversalFletcher extends Script implements ServerMessageListener,
PaintListener, MouseListener {
// Variables
int logID;
int bowID;
int bow2ID;
int knifeID;
int bowstringID = 1777;
int fletchingAnimation = 1248;
Image normal = null;
RSComponent child;
private final RenderingHints rh = new RenderingHints(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
int bowsCut = 0;
int bowsStrung = 0;
int bowshr = 0;
int bowsAvg = 0;
long startTime = System.currentTimeMillis();
public int startExp;
public int startLevel;
int guiStatus = 0;
private gui gui;
public boolean startScript = false;
int amountToFletch;
int amountToString;
long hours;
long minutes;
long seconds;
int logprice;
int bsprice;
int fbowprice;
int profit;
int profit2;
int profitper;
int profitper2;
int profitper3;
int bowprice;
int expGained = 0;
int expTill99 = 0;
double xpPerbow;
int levelsGained = 0;
String sendText;
int logstnl;
int nextLevel;
int xpToLevel;
int timeUntil99 = 0;
int hoursTNL, secsTNL, minsTNL;
int paintInt = 1;
int mouselines = 1;
int totalxp = 13034431;
int xpIsClose = 13020000;
int currentexp;
public static int Mouse1 = 50;
public int Mouse2 = 8;
private String status = "";
public int timer = 0;
private final Color color3 = new Color(255, 0, 0);
private final LinkedList mousePath = new LinkedList();
public BufferedImage img1 = null;
public boolean string;
private Point m;
public String PaintMessage;
public String latestVer;
boolean gotPrices = false;
public boolean StringingOption;
private double getVersion() {
return 2.39;
}
public boolean onStart() {
gui = new gui();
gui.setVisible(true);
paintInt = 1;
try {
final URL cursorURL = new URL(
"http://fletchto99scripting.webs.com/pictures/cursor.gif");
normal = ImageIO.read(cursorURL);
} catch (MalformedURLException e) {
log("Unable to buffer cursor.");
} catch (IOException e) {
log("Unable to open cursor image.");
}
while (guiStatus != 1) {
}
try {
final URL url = new URL(
"http://fletchto99scripting.webs.com/pictures/paint.png");
img1 = ImageIO.read(url);
} catch (final IOException e) {
log("Failed to get Fletch Pic.");
e.printStackTrace();
}
URLConnection url = null;
// Ask the user if they'd like to check for an update...
try {
JOptionPane.showMessageDialog(null, "Checking For updates...");
// Open the version text file
url = new URL(
"http://fletchto99scripting.webs.com/Scripts/universalFletcher2x/Version.txt")
.openConnection();
// Create an input stream for it
BufferedReader in = new BufferedReader(new InputStreamReader(
url.getInputStream()));
// Check if the current version is outdated
if (Double.parseDouble(in.readLine()) > getVersion()) {
log("Update Manually or with the loader before you can use the script again!");
JOptionPane
.showMessageDialog(null,
"Update Manually or with the loader before you can use the script again!");
return false;
} else
JOptionPane.showMessageDialog(null,
"You have the latest version.");
JOptionPane.showMessageDialog(null,
"Click RSbot to make it unfreeze!");
// User has the
// latest
// version. Tell
// them!
} catch (IOException e) {
log("Problem getting version.");
return false; // Return false if there was a problem
}
startScript = true;
while (!startScript) {
}
return true;
}
public void onFinish() {
if (game.isLoggedIn()) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
}
log("Thanks for using my script!");
log("There are " + logstnl + bowID + "until your next level.");
log("You fletched " + bowsAvg + " bows.");
log("You gained " + expGained + " exp and " + levelsGained
+ " fletching level(s).");
log("The script ran for " + hours + ":" + minutes + ":" + seconds);
}
public void bank() {
status = "Opening Bank";
if (!bank.isOpen()) {
bank.open();
}
}
public boolean cutLogs() {
status = "Knife on logs";
if (!bank.isOpen() && inventory.contains(logID)
&& inventory.containsOneOf(knifeID)) {
inventory.getItem(logID).doClick(true);
sleep(random(500, 650));
inventory.getItem(knifeID).doClick(true);
sleep(random(1250, 1500));
}
final RSInterface INTERFACE_FLETCH = interfaces.get(905);
status = "Fletching";
if (gui.logType.getSelectedItem() == "Normal") {
if (gui.bowType.getSelectedItem() == "Shafts") {
child = INTERFACE_FLETCH.getComponent(14);
}
if (gui.bowType.getSelectedItem() == "Shortbow") {
child = INTERFACE_FLETCH.getComponent(15);
}
if (gui.bowType.getSelectedItem() == "Longbow") {
child = INTERFACE_FLETCH.getComponent(16);
}
if (gui.bowType.getSelectedItem() == "Stocks") {
child = INTERFACE_FLETCH.getComponent(17);
}
} else if (gui.bowType.getSelectedItem() == "Short Bow") {
child = INTERFACE_FLETCH.getComponent(14);
} else if (gui.bowType.getSelectedItem() == "Long Bow") {
child = INTERFACE_FLETCH.getComponent(15);
} else if (gui.bowType.getSelectedItem() == "Stocks") {
child = INTERFACE_FLETCH.getComponent(16);
}
sleep(500);
if (child.isValid()) {
child.doAction("make all");
sleep(random(1000, 1250));
}
sleep(random(1000, 1250));
if (getMyPlayer().getAnimation() == fletchingAnimation) {
return true;
}
return false;
}
public boolean stringBows() {
status = "String on Ubow";
if (!bank.isOpen() && getMyPlayer().getAnimation() == -1
&& !inventory.contains(bow2ID)) {
inventory.getItem(bowstringID).doClick(true);
sleep(random(500, 650));
inventory.getItem(bowID).doClick(true);
}
status = "Stringing";
final RSInterface INTERFACE_FLETCH = interfaces.get(905);
child = INTERFACE_FLETCH.getComponent(14);
sleep(random(1500, 2000));
if (child.isValid()) {
child.doAction("make all");
sleep(random(500, 1000));
}
if (getMyPlayer().getAnimation() != -1) {
return true;
}
return false;
}
public void checkfor99() {
currentexp = skills.getCurrentExp(Skills.FLETCHING);
if (currentexp >= xpIsClose) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
if (bank.isOpen()) {
bank.close();
}
game.logout(false);
stopScript();
}
}
public void loadGEInfo(final int bowID, final int logID) {
try {
new Thread(new Runnable() {
public void run() {
bowprice = grandExchange.loadItemInfo(bowID)
.getMarketPrice();
logprice = grandExchange.loadItemInfo(logID)
.getMarketPrice();
bsprice = grandExchange.loadItemInfo(bow2ID)
.getMarketPrice();
fbowprice = grandExchange.loadItemInfo(bowstringID)
.getMarketPrice();
}
}).start();
} catch (Exception e) {
e.printStackTrace();
}
}
public boolean useBank1() {
status = "Banking: Fletching";
if (!inventory.contains(knifeID)) {
status = "Getting Knife";
bank.depositAll();
bank.withdraw(knifeID, 1);
sleep(random(600, 650));
}
if (!inventory.contains(logID)) {
bank.depositAllExcept(knifeID);
sleep(random(575, 600));
}
if (StringingOption == false) {
if (!inventory.contains(bowID)) {
if (bank.getItem(logID) == null) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
bank.close();
game.logout(false);
stopScript();
}
}
}
if (!inventory.containsOneOf(logID)) {
bank.withdraw(logID, 0);
sleep(random(450, 500));
}
if (inventory.contains(logID)) {
bank.close();
return true;
}
return false;
}
public boolean useBank2() {
status = "Banking: Stringing";
if (bank.getItem(bowstringID) == null
|| bank.getItem(bowID) == null) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
bank.close();
game.logout(false);
stopScript();
}
if (!inventory.contains(bowID)) {
bank.withdraw(bowID, 14);
sleep(50, 100);
}
if (!inventory.contains(bowstringID)) {
bank.withdraw(bowstringID, 14);
sleep(675, 700);
}
if (inventory.contains(bowstringID) && inventory.contains(bowID)) {
bank.close();
return true;
}
return false;
}
private boolean isBusy() { // Credits to speed
for (int i = 0; i < 50; i++) {
if (getMyPlayer().isMoving() || getMyPlayer().getAnimation() != -1) {
return true;
}
sleep(random(24, 26));
}
return false;
}
public int loop() {
getLatestVer();
getPaintMessage();
checkfor99();
if (StringingOption == false) {
amountToFletch = Integer.parseInt(gui.amountToFletch.getText());
if (!bank.isOpen() && getMyPlayer().getAnimation() == -1
&& inventory.contains(logID)) {
cutLogs();
sleep(random(500, 750));
}
if (getMyPlayer().getAnimation() == fletchingAnimation) {
antiban();
sleep(1000);
}
final RSInterface INTERFACE_LEVELUP = interfaces.get(740);
if (INTERFACE_LEVELUP.isValid()) {
if (gui.ssCheck2.isSelected()) {
env.saveScreenshot(true);
}
mouse.move(random(240, 340), random(465, 469));
sleep(random(400, 800));
mouse.click(true);
sleep(random(2400, 3000));
}
amountToFletch = Integer.parseInt(gui.amountToFletch.getText());
if (bowsCut >= amountToFletch && amountToFletch != 0) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
bank.close();
game.logout(false);
stopScript();
}
if (!inventory.containsOneOf(logID)
&& getMyPlayer().getAnimation() == -1 && !bank.isOpen()) {
bank();
}
if (bank.isOpen()) {
useBank1();
}
}
if (StringingOption == true) {
amountToFletch = Integer.parseInt(gui.amountToFletch.getText());
if (!bank.isOpen() && getMyPlayer().getAnimation() == -1
&& inventory.contains(logID)) {
cutLogs();
sleep(random(500, 750));
}
if (!bank.isOpen() && getMyPlayer().getAnimation() == -1
&& !inventory.contains(bow2ID)
&& inventory.contains(bowstringID)
&& inventory.contains(bowID)) {
stringBows();
sleep(random(1200, 1500));
}
if (getMyPlayer().getAnimation() == fletchingAnimation) {
antiban();
sleep(1000);
}
if (getMyPlayer().getAnimation() != -1) {
antiban();
sleep(1000);
}
final RSInterface INTERFACE_LEVELUP = interfaces.get(740);
if (INTERFACE_LEVELUP.isValid()) {
if (gui.ssCheck2.isSelected()) {
env.saveScreenshot(true);
}
mouse.move(random(240, 340), random(465, 469));
sleep(random(400, 800));
mouse.click(true);
sleep(random(2400, 3000));
}
amountToFletch = Integer.parseInt(gui.amountToFletch.getText());
if (bowsStrung >= amountToFletch && amountToFletch != 0) {
if (gui.ssCheck.isSelected()) {
env.saveScreenshot(true);
}
bank.close();
game.logout(false);
stopScript();
}
if (!inventory.containsOneOf(logID) && !isBusy()) {
if (getMyPlayer().getAnimation() == -1 && !bank.isOpen()) {
bank();
}
}
if (inventory.getCount() >= 0 && !inventory.contains(knifeID)) {
bank.depositAll();
sleep(random(825, 850));
}
amountToFletch = Integer.parseInt(gui.amountToFletch.getText());
if (bowsCut >= amountToFletch && amountToFletch != 0
|| bank.getItem(logID) == null) {
bank.depositAll();
sleep(random(500,600));
if (bank.isOpen()) {
useBank2();
}
} else if (bank.isOpen()) {
useBank1();
}
}
return random(200, 400);
}
private void antiban() {
status = "Antiban:";
int r = random(1, 26);
if (r == 1) {
status = "Antiban: Mouse";
mouse.moveRandomly(100, 200);
sleep(random(2000, 2500));
}
if (r == 2) {
status = "Antiban: Mouse";
mouse.moveRandomly(25, 150);
sleep(random(1000, 2500));
}
if (r == 3) {
status = "Antiban: Stats";
if (game.getCurrentTab() != 1) {
game.openTab(1);
sleep(350, 500);
mouse.move(random(615, 665), random(350, 375));
sleep(2000, 3000);
if (game.getCurrentTab() != 4) {
game.openTab(4);
sleep(random(1750, 2153));
}
}
}
if (r == 4) {
status = "Antiban: AFK";
sleep(random(2000, 2500));
}
if (r == 5) {
status = "Antiban: Camera";
camera.setAngle(random(0, 300));
camera.setPitch(random(35, 85));
sleep(random(1750, 1950));
}
if (r == 6) {
status = "Antiban: Other site";
mouse.moveOffScreen();
sleep(random(1000, 1500));
mouse.move(630, 655);
sleep(random(750, 850));
}
}
@Override
public void serverMessageRecieved(ServerMessageEvent e) {
String word = e.getMessage().toLowerCase();
if (word.contains("longbow") || word.contains("shortbow")
|| word.contains("stock") || word.contains("shaft")) {
bowsCut++;
}
if (word.contains("longbow") || word.contains("shortbow")
|| word.contains("stock") || word.contains("shaft") || word.contains("string")) {
bowsAvg++;
}
if (word.contains("string")) {
bowsStrung++;
}
}
public void mousePressed(MouseEvent e) {
}
public void mouseReleased(MouseEvent e) {
m = e.getPoint();
}
@Override
public void mouseClicked(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
public boolean getPaintMessage() {
URLConnection url = null;
BufferedReader in = null;
try {
url = new URL(
"http://fletchto99scripting.webs.com/Scripts/misc/Message.txt")
.openConnection();
in = new BufferedReader(new InputStreamReader(url.getInputStream()));
PaintMessage = in.readLine();
} catch (MalformedURLException e) {
} catch (IOException e) {
}
return true;
}
public boolean getLatestVer() {
URLConnection url = null;
BufferedReader in = null;
try {
url = new URL(
"http://fletchto99scripting.webs.com/Scripts/UniversalFletcher2x/Version.txt")
.openConnection();
in = new BufferedReader(new InputStreamReader(url.getInputStream()));
latestVer = in.readLine();
} catch (MalformedURLException e) {
} catch (IOException e) {
}
return true;
}
private int toColor(double d) { // credits to Enfilade
return Math.min(255, Math.max(0, (int) d));
}
@SuppressWarnings("serial")
private class MousePathPoint extends Point { // credits to Enfilade
private long finishTime;
private double lastingTime;
public MousePathPoint(int x, int y, int lastingTime) {
super(x, y);
this.lastingTime = lastingTime;
finishTime = System.currentTimeMillis() + lastingTime;
}
public boolean isUp() {
return System.currentTimeMillis() > finishTime;
}
public Color getColor() {
return new Color(
0,
255,
0,
toColor(256 * ((finishTime - System.currentTimeMillis()) / lastingTime)));
}
}
@Override
public void onRepaint(Graphics g) {
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
if (game.isLoggedIn() && startScript) {
if (gui.knifeType.getSelectedItem() == "Sacred_clay") {
knifeID = 14111;
} else if (gui.knifeType.getSelectedItem() == "Normal") {
knifeID = 946;
}
if (gui.Stringing.isSelected()) {
StringingOption = true;
} else if (!gui.Stringing.isSelected()) {
StringingOption = false;
}
if (gui.logType.getSelectedItem() == "Normal") {
logID = 1511;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 50;
xpPerbow = 5;
bow2ID = 841;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 48;
xpPerbow = 10;
bow2ID = 839;
}
if (gui.bowType.getSelectedItem() == "Shafts") {
bowID = 52;
xpPerbow = 0.33;
}
if (gui.bowType.getSelectedItem() == "Stocks") {
bowID = 9440;
xpPerbow = 6;
}
}
if (gui.logType.getSelectedItem() == "Oak") {
logID = 1521;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 54;
xpPerbow = 16.5;
bow2ID = 843;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 56;
xpPerbow = 25;
bow2ID = 845;
}
if (gui.bowType.getSelectedItem() == "Stocks") {
bowID = 9442;
xpPerbow = 16;
}
}
if (gui.logType.getSelectedItem() == "Willow") {
logID = 1519;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 60;
xpPerbow = 33.25;
bow2ID = 849;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 58;
xpPerbow = 41.5;
bow2ID = 847;
}
if (gui.bowType.getSelectedItem() == "Stocks") {
bowID = 9444;
xpPerbow = 22;
}
}
if (gui.logType.getSelectedItem() == "Maple") {
logID = 1517;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 64;
xpPerbow = 50;
bow2ID = 853;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 62;
xpPerbow = 58.25;
bow2ID = 851;
}
if (gui.bowType.getSelectedItem() == "Stocks") {
bowID = 9448;
xpPerbow = 32;
}
}
if (gui.logType.getSelectedItem() == "Yew") {
logID = 1515;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 68;
xpPerbow = 67.5;
bow2ID = 857;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 66;
xpPerbow = 75;
bow2ID = 855;
}
if (gui.bowType.getSelectedItem() == "Stocks") {
bowID = 9452;
xpPerbow = 40;
}
}
if (gui.logType.getSelectedItem() == "Magic") {
logID = 1513;
if (gui.bowType.getSelectedItem() == "Short Bow") {
bowID = 72;
xpPerbow = 83.25;
bow2ID = 861;
}
if (gui.bowType.getSelectedItem() == "Long Bow") {
bowID = 70;
xpPerbow = 91.5;
bow2ID = 859;
}
}
if (startTime == 0) {
startTime = System.currentTimeMillis();
}
if (startExp == 0) {
startExp = skills.getCurrentExp(Skills.FLETCHING);
}
if (startLevel == 0) {
startLevel = skills.getCurrentLevel(Skills.FLETCHING);
}
levelsGained = skills.getCurrentLevel(Skills.FLETCHING)
- startLevel;
expTill99 = totalxp - skills.getCurrentExp(Skills.FLETCHING);
logstnl = (int) (skills.getExpToNextLevel(Skills.FLETCHING)
/ xpPerbow + 1);
bowshr = (int) (new Double(bowsAvg)
/ new Double(System.currentTimeMillis() - startTime) * new Double(
60 * 60 * 1000));
expGained = skills.getCurrentExp(Skills.FLETCHING) - startExp;
long millis = System.currentTimeMillis() - startTime;
hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
seconds = millis / 1000;
float xpsec = 0;
if ((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
xpsec = ((float) expGained)
/ (float) (seconds + (minutes * 60) + (hours * 60 * 60));
}
float xpmin = xpsec * 60;
float xphour = xpmin * 60;
timeUntil99 = (int) Math.floor(expTill99 / xphour);
nextLevel = skills.getCurrentLevel(Skills.FLETCHING) + 1;
xpToLevel = skills.getExpToNextLevel(Skills.FLETCHING);
hoursTNL = (int) Math.floor(xpToLevel / xphour);
minsTNL = (int) Math.floor(((xpToLevel / xphour) - hoursTNL) * 60);
secsTNL = (int) Math
.floor(((((xpToLevel / xphour) - hoursTNL) * 60) - minsTNL) * 60);
profitper = bowprice - logprice;
profitper2 = logprice + bsprice;
profitper3 = fbowprice - profitper2;
profit = profitper * bowsCut;
profit2 = profitper2 * bowsStrung;
if (m.x >= 9 && m.x <>= 33 && m.y < 33 + 8) {
paintInt = 1;
} else if (m.x >= 9 && m.x <>= 49 && m.y < 47 + 11) {
paintInt = 2;
} else if (m.x >= 22 && m.x <>= 60 && m.y < 64 + 11) {
paintInt = 3;
}
if (bowID != 0 && logID != 0 && !gotPrices) {
loadGEInfo(bowID, logID);
gotPrices = true;
}
if (xphour == 0) {
hoursTNL = 0;
minsTNL = 0;
secsTNL = 0;
}
g.setColor(new Color(216, 197, 162));
g.fillRoundRect(3, 5, 63, 78, 16, 16);
g.setColor(color3);
g.drawRoundRect(3, 5, 63, 78, 16, 16);
g.setFont(new Font("Tahoma", 0, 12));
g.setColor(new Color(255, 0, 0));
g.drawString("Paint", 21, 21);
g.drawString("Fletching", 10, 41);
g.drawString("Stringing", 9, 58);
g.drawString("Off", 23, 75);
g.drawImage(normal, (int) mouse.getLocation().getX(), (int) mouse
.getLocation().getY(), null);
if (paintInt == 1) {
g.drawImage(img1, 5, 345, null);
g.setColor(new Color(31, 150, 31));
g.fillRect(
235,
427,
(skills.getPercentToNextLevel(Skills.FLETCHING) * 246 / 100),
25);
g.setFont(new Font("Tahoma", 0, 12));
g.setColor(new Color(209, 0, 0));
g.drawString(status, 57, 384);
g.drawString("" + expGained, 88, 399);
g.drawString("" + levelsGained, 88, 413);
g.drawString("" + timeUntil99, 88, 428);
g.drawString("" + bowshr, 98, 442);
g.drawString("" + (int) xphour, 98, 456);
g.drawString("" + logstnl + " Logs / " + xpToLevel + " EXP / "
+ hoursTNL + " Hours, " + minsTNL + " Mins.", 233, 415);
g.drawImage(normal, (int) mouse.getLocation().getX(),
(int) mouse.getLocation().getY(), null);
g.setColor(new Color(31, 150, 31));
g.fillRect(
235,
427,
(skills.getPercentToNextLevel(Skills.FLETCHING) * 246 / 100),
25);
g.setFont(new Font("Tahoma", 0, 12));
g.setColor(new Color(209, 0, 0));
g.drawString(
""
+ ("" + skills
.getPercentToNextLevel(Skills.FLETCHING))
+ "% until " + nextLevel + " fletching", 270,
443);
g.drawString("" + hours + ":" + minutes + ":" + seconds, 291,
385);
g.drawString("" + profit + "gp", 421, 385);
g.setColor(new Color(0, 148, 207));
g.drawString(PaintMessage + " ~ Latest Version: " + latestVer
+ " ~ Your Ver: " + getVersion(), 67, 472);
g.drawImage(normal, (int) mouse.getLocation().getX(),
(int) mouse.getLocation().getY(), null);
}
if (paintInt == 2) {
g.drawImage(img1, 5, 345, null);
g.setColor(new Color(31, 150, 31));
g.fillRect(
235,
427,
(skills.getPercentToNextLevel(Skills.FLETCHING) * 246 / 100),
25);
g.setFont(new Font("Tahoma", 0, 12));
g.setColor(new Color(209, 0, 0));
g.drawString(status, 57, 384);
g.drawString("" + expGained, 88, 399);
g.drawString("" + levelsGained, 88, 413);
g.drawString("" + timeUntil99, 88, 428);
g.drawString("" + bowshr, 98, 442);
g.drawString("" + (int) xphour, 98, 456);
g.drawString("" + logstnl + " Bows/ " + xpToLevel + " EXP / "
+ hoursTNL + " Hours, " + minsTNL + " Mins.", 233, 415);
g.setColor(new Color(31, 150, 31));
g.fillRect(
235,
427,
(skills.getPercentToNextLevel(Skills.FLETCHING) * 246 / 100),
25);
g.setFont(new Font("Tahoma", 0, 12));
g.setColor(new Color(209, 0, 0));
g.drawString(
""
+ ("" + skills
.getPercentToNextLevel(Skills.FLETCHING))
+ "% until " + nextLevel + " fletching", 270,
443);
g.drawString("" + hours + ":" + minutes + ":" + seconds, 291,
385);
g.drawString("" + profit2 + "gp", 421, 385);
g.setColor(new Color(0, 148, 207));
g.drawString(PaintMessage + " ~ Latest Version: " + latestVer
+ " ~ Your Ver: " + getVersion(), 67, 472);
g.drawImage(normal, (int) mouse.getLocation().getX(),
(int) mouse.getLocation().getY(), null);
}
if (gui.jCheckBox4.isSelected()) {
int gW = game.getWidth();
int gH = game.getHeight();
Point localPoint = mouse.getLocation();
g.setColor(new Color(0, 250, 0));
g.drawLine(0, localPoint.y, gW, localPoint.y);
g.drawLine(localPoint.x, 0, localPoint.x, gH);
}
if (gui.jCheckBox5.isSelected()) {
while (!mousePath.isEmpty() && mousePath.peek().isUp())
// credits to Enfilade
mousePath.remove();
Point clientCursor = mouse.getLocation();
MousePathPoint mpp = new MousePathPoint(clientCursor.x,
clientCursor.y, 3000);
if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
mousePath.add(mpp);
MousePathPoint lastPoint = null;
for (MousePathPoint p : mousePath) {
if (lastPoint != null) {
g.setColor(p.getColor());
g.drawLine(p.x, p.y, lastPoint.x, lastPoint.y);
}
lastPoint = p;
}
}
((Graphics2D) g).setRenderingHints(rh);
}
}
Point oldloc = new Point(0, 0);
public boolean ouseMoved() {
Point loc = mouse.getLocation();
if (oldloc.x != loc.x || oldloc.y != loc.y) {
oldloc = loc;
return true;
} else
return false;
}
@SuppressWarnings("serial")
public class gui extends javax.swing.JDialog {
public gui() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the
* form. WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jLabel1 = new JLabel();
startButton = new JButton();
jLabel2 = new JLabel();
ssCheck = new JCheckBox();
jLabel3 = new JLabel();
ssCheck2 = new JCheckBox();
jLabel4 = new JLabel();
amountToFletch = new JTextField();
jLabel5 = new JLabel();
MouseBox = new JSlider();
jLabel6 = new JLabel();
jLabel7 = new JLabel();
jLabel8 = new JLabel();
jLabel9 = new JLabel();
Stringing = new JCheckBox();
jLabel10 = new JLabel();
bowType = new JComboBox();
jLabel11 = new JLabel();
logType = new JComboBox();
jLabel12 = new JLabel();
knifeType = new JComboBox();
jLabel13 = new JLabel();
jCheckBox4 = new JCheckBox();
jLabel14 = new JLabel();
jCheckBox5 = new JCheckBox();
setTitle("Universal Fletcher");
setAlwaysOnTop(true);
;
setName("Universal Fletcher Settings");
setResizable(false);
jLabel1.setFont(new Font("Computer", 3, 36));
jLabel1.setForeground(new Color(51, 153, 0));
jLabel1.setText("Universal Fletcher");
startButton.setBackground(new Color(255, 255, 255));
startButton.setFont(new Font("Tahoma", 0, 24)); // NOI18N
startButton.setForeground(new Color(0, 0, 255));
startButton.setText("Start!");
startButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
startButtonActionPerformed(evt);
}
});
jLabel2.setFont(new Font("Tahoma", 0, 14)); // NOI18N
jLabel2.setForeground(new Color(255, 51, 0));
jLabel2.setText("By: Fletch To 99");
ssCheck.setSelected(true);
ssCheck.setText("When done?");
ssCheck.setCursor(new java.awt.Cursor(
java.awt.Cursor.DEFAULT_CURSOR));
ssCheck.setFocusable(false);
ssCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ssCheckActionPerformed(evt);
}
});
jLabel3.setText("Screenshot:");
ssCheck2.setSelected(true);
ssCheck2.setText("Upon Level?");
jLabel4.setText("Amount To Fletch:");
amountToFletch.setText("0");
amountToFletch
.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(
java.awt.event.ActionEvent evt) {
amountToFletchActionPerformed(evt);
}
});
jLabel5.setText("0 for nonstop Fletching!");
MouseBox.setMaximum(100);
MouseBox.setMinimum(10);
MouseBox.setMajorTickSpacing(10);
MouseBox.setMinorTickSpacing(10);
MouseBox.setPaintTicks(true);
MouseBox.setSnapToTicks(true);
MouseBox.setFocusable(false);
MouseBox.setValue(50);
MouseBox.setName(""); // NOI18N
jLabel6.setText("MouseSpeed:");
jLabel7.setText("Slow");
jLabel8.setText("Fast");
jLabel9.setText("String Bows:");
Stringing.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
StringingActionPerformed(evt);
}
});
jLabel10.setText("Bow Type:");
bowType.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"Short Bow", "Long Bow", "Shafts", "Stocks", }));
bowType.setSelectedIndex(1);
bowType.setFocusable(false);
bowType.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bowTypeActionPerformed(evt);
}
});
jLabel11.setText("Log Type:");
logType.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"Normal", "Oak", "Willow", "Maple", "Yew", "Magic" }));
logType.setSelectedIndex(3);
logType.setFocusable(false);
logType.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
logTypeActionPerformed(evt);
}
});
jLabel12.setText("Knife Type:");
knifeType.setModel(new javax.swing.DefaultComboBoxModel(
new String[] { "Normal", "Sacred_clay" }));
knifeType.setFocusable(false);
knifeType.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
knifetypeActionPerformed(evt);
}
});
jLabel13.setText("Mouse Cross:");
jCheckBox4.setSelected(true);
jCheckBox4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jCheckBox4ActionPerformed(evt);
}
});
jLabel14.setText(" Draw Mouse Lines: ");
jCheckBox5.setSelected(true);
jCheckBox5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
jCheckBox5ActionPerformed(evt);
}
});
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout
.createParallelGroup(Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addContainerGap()
.addGroup(
layout.createParallelGroup(
Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGroup(
layout.createParallelGroup(
Alignment.LEADING)
.addComponent(
jLabel4)
.addGroup(
layout.createSequentialGroup()
.addComponent(
jLabel6)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel7)))
.addPreferredGap(
ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
MouseBox,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel8)
.addGap(80,
80,
80))
.addGroup(
layout.createSequentialGroup()
.addComponent(
amountToFletch,
GroupLayout.PREFERRED_SIZE,
87,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
jLabel5))))
.addGroup(
layout.createSequentialGroup()
.addComponent(
jLabel9)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
Stringing)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
jLabel13)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
jCheckBox4)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel14)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jCheckBox5))
.addGroup(
layout.createSequentialGroup()
.addComponent(
jLabel3)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
ssCheck)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
ssCheck2)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel2))
.addGroup(
layout.createSequentialGroup()
.addComponent(
jLabel10)
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addComponent(
bowType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel11)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
logType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
jLabel12)
.addPreferredGap(
ComponentPlacement.RELATED)
.addComponent(
knifeType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE))
.addComponent(
jLabel1,
GroupLayout.PREFERRED_SIZE,
277,
GroupLayout.PREFERRED_SIZE)
.addComponent(
startButton,
GroupLayout.PREFERRED_SIZE,
359,
GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)));
layout.setVerticalGroup(layout
.createParallelGroup(Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addComponent(jLabel1,
GroupLayout.PREFERRED_SIZE, 40,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(ssCheck)
.addComponent(ssCheck2)
.addComponent(jLabel2))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
Alignment.LEADING)
.addGroup(
layout.createParallelGroup(
Alignment.LEADING,
false)
.addComponent(
jLabel13,
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(
jLabel9,
GroupLayout.DEFAULT_SIZE,
21,
Short.MAX_VALUE)
.addComponent(
Stringing,
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(
jCheckBox4,
Alignment.TRAILING,
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(
jLabel14,
Alignment.TRAILING,
GroupLayout.DEFAULT_SIZE,
23,
Short.MAX_VALUE))
.addComponent(jCheckBox5))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(
amountToFletch,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGroup(
layout.createParallelGroup(
Alignment.BASELINE)
.addComponent(
jLabel6,
GroupLayout.DEFAULT_SIZE,
29,
Short.MAX_VALUE)
.addComponent(
jLabel7,
GroupLayout.DEFAULT_SIZE,
29,
Short.MAX_VALUE))
.addPreferredGap(
ComponentPlacement.UNRELATED)
.addGroup(
layout.createParallelGroup(
Alignment.BASELINE)
.addComponent(
jLabel10)
.addComponent(
bowType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(
jLabel11)
.addComponent(
logType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(
jLabel12)
.addComponent(
knifeType,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)))
.addGroup(
layout.createSequentialGroup()
.addGroup(
layout.createParallelGroup(
Alignment.TRAILING,
false)
.addComponent(
jLabel8,
Alignment.LEADING,
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(
MouseBox,
Alignment.LEADING,
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGap(35,
35,
35)))
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(startButton,
GroupLayout.PREFERRED_SIZE, 39,
GroupLayout.PREFERRED_SIZE)
.addContainerGap()));
pack();
}
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {
UniversalFletcher.Mouse1 = (int) MouseBox.getValue();
guiStatus = 1;
gui.setVisible(false);
if (Mouse1 == 100) {
Mouse2 = random(1, 2);
} else if (Mouse1 == 90) {
Mouse2 = random(2, 4);
} else if (Mouse1 == 80) {
Mouse2 = random(3, 5);
} else if (Mouse1 == 70) {
Mouse2 = random(4, 6);
} else if (Mouse1 == 60) {
Mouse2 = random(5, 7);
} else if (Mouse1 == 50) {
Mouse2 = random(6, 8);
} else if (Mouse1 == 40) {
Mouse2 = random(7, 9);
} else if (Mouse1 == 30) {
Mouse2 = random(8, 10);
} else if (Mouse1 == 20) {
Mouse2 = random(10, 12);
} else if (Mouse1 == 10) {
Mouse2 = random(12, 14);
}
mouse.setSpeed(Mouse2);
}
private void logTypeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void amountToFletchActionPerformed(
java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void bowTypeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void StringingActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void ssCheckActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void knifetypeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jCheckBox4ActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
}
private void jCheckBox5ActionPerformed(ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args
* the command line arguments
*/
public void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new gui().setVisible(true);
}
});
}
// Variables declaration - do not modify
private JSlider MouseBox;
private JCheckBox Stringing;
private JTextField amountToFletch;
private JComboBox bowType;
private JCheckBox jCheckBox4;
private JCheckBox jCheckBox5;
private JLabel jLabel1;
private JLabel jLabel10;
private JLabel jLabel11;
private JLabel jLabel12;
private JLabel jLabel13;
private JLabel jLabel14;
private JLabel jLabel2;
private JLabel jLabel3;
private JLabel jLabel4;
private JLabel jLabel5;
private JLabel jLabel6;
private JLabel jLabel7;
private JLabel jLabel8;
private JLabel jLabel9;
private JComboBox knifeType;
private JComboBox logType;
private JCheckBox ssCheck;
private JCheckBox ssCheck2;
private JButton startButton;
// End of variables declaration
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment