Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.util.HashMap;
- import org.rsbot.client.RSItem;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSTilePath;
- @ScriptManifest(name = "Burning Firemaker", authors = {"Firexranger8"}, keywords = "Firemaking", version = 1.0,
- description = "Select options in the GUI. Good luck with your goal.")
- public class BurningFiremaker extends Script implements PaintListener, MessageListener{
- int tinderboxID = 590;
- int bankBoothID = 0;
- int startExp;
- int startTime;
- int startLevel;
- public static FMLoc location;
- public static LOGS LOGS;
- private long activity_time;
- private static boolean gui_on = false;
- private RSTilePath path;
- private RSTilePath path_back;
- private long expGained;
- private int expHour;
- private static final FMLoc[] LOCATIONS = new FMLoc[]{
- new FMLoc("Varrock West", new RSArea(new RSTile(0000, 0000), new RSTile(0000, 0000)), new RSTile(0000, 0000), new RSTile(0000, 0000), new RSTile(0000, 0000), new RSTile(0000, 0000), new RSTile[]{new RSTile(0000, 0000)})
- };
- private static final LOGS[] Logs = new LOGS[]{
- new LOGS("Normal Logs", 123),
- new LOGS("Oak Logs", 234)};
- @Override
- public int loop() {
- return 0;
- }
- public boolean onStart(){
- new GUI().setVisible(true);
- while (gui_on) {
- sleep(20);
- }
- if (location.equals(LOCATIONS[0])) {
- log("We are firemaking at Varrock West.");
- } else if (location.equals(LOCATIONS[1])) {
- log("We are firemaking in Varrock East.");
- } else if (location.equals(LOCATIONS[2])) {
- log("We are firemaking in Varrock East.");
- } else if (location.equals(LOCATIONS[3])) {
- log("We are firemaking in Grand Exchange.");
- } else if (location.equals(LOCATIONS[4])) {
- log("We are firemaking in Draynor.");
- }
- path = walking.newTilePath(location.walk_path);
- path_back = walking.newTilePath(location.walk_path).reverse();
- startExp = skills.getCurrentExp(Skills.FIREMAKING);
- startLevel = skills.getCurrentLevel(Skills.FIREMAKING);
- startTime = (int) System.currentTimeMillis();
- if(!game.isLoggedIn()){
- log("Log before starting this script just cause I told you so!");
- stopScript();
- };
- log("Thanks for using my script today! Have fun botting!");
- log("Time to burn logs with a burning scipt!!! xD");
- return true;
- }
- private boolean inArea(RSArea area) {
- return area.contains(getMyPlayer().getLocation());
- }
- public void onFinish() {
- log("Thanks for using my script! Make reccomendations or tips at powerbot.org");
- log("This script is only to be used on rsbot version 2.25+ through powerbot.org");
- }
- private void depositAll() {
- if(bank.isOpen()){
- bank.depositAllExcept(tinderboxID);
- }
- }
- public void withdraw() {
- if(bank.isOpen()){
- org.rsbot.script.wrappers.RSItem logs = inventory.getItem(LOGS.inv_id);
- if(!inventory.containsOneOf(tinderboxID)){
- bank.withdraw(tinderboxID, 1);
- if(inventory.containsOneOf(tinderboxID)){
- bank.withdraw(LOGS, 0);
- for (int i = 0; i < 100
- && !inventory.contains(LOGS.inv_id); i++)
- sleep(20);
- }else {
- if (!inventory.contains(LOGS.inv_id)) {
- if (inventory.getCount() > 1) {
- bank.depositAll();
- }
- bank.withdraw(LOGS, 0);
- for (int i = 0; i < 100
- && !inventory.contains(LOGS.inv_id); i++)
- sleep(20);
- }
- }
- }
- }
- }
- private void openBank() {
- if(getMyPlayer().getAnimation() == -1){
- RSObject bank = objects.getNearest(bankBoothID);{
- if(bank !=null && !inventory.contains(LOGS.inv_id));
- bank.doAction("uickly");
- }if(bank !=null && inventory.contains(LOGS.inv_id));
- firemake();
- }else
- log("[ERROR] You are not anywhere near the bank and you are out of logs!");
- log("[ERROR] Logging out now");
- stopScript();
- game.logout(true);
- }
- private void closeBank() {
- }
- private void bank() {
- openBank();
- depositAll();
- withdraw();
- closeBank();
- }
- private void firemake() {
- org.rsbot.script.wrappers.RSItem logs = inventory.getItem(LOGS.inv_id);
- org.rsbot.script.wrappers.RSItem dinderbox = inventory.getItem(tinderboxID);
- if(inventory.contains(LOGS.inv_id) && getMyPlayer().getAnimation() == -1);
- inventory.useItem(dinderbox, logs);
- sleep(random(140, 170));
- }
- @Override
- public void onRepaint(Graphics render) {
- }
- @Override
- public void messageReceived(MessageEvent e) {
- }
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /*
- * GUI.java
- *
- * Created on Feb 5, 2011, 11:06:03 PM
- */
- /**
- *
- * @author Matt / Firexranger8 / th3_n4m3les5
- */
- public static class GUI extends javax.swing.JFrame {
- private final String[] LOGS = new String[Logs.length];
- private final String[] locations = new String[LOCATIONS.length];
- private HashMap<String, FMLoc> locMap = new HashMap<String, FMLoc>();
- private HashMap<String, LOGS> matMap = new HashMap<String, LOGS>();
- /** Creates new form GUI */
- 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.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- gui_on = true;
- for (int i = 0; i < Logs.length; i++) {
- LOGS[i] = Logs[i].name;
- matMap.put(LOGS[i], Logs[i]);
- }
- for (int i = 0; i < LOCATIONS.length; i++) {
- locations[i] = LOCATIONS[i].name;
- locMap.put(locations[i], LOCATIONS[i]);
- }
- jLabel1 = new javax.swing.JLabel();
- jLabel2 = new javax.swing.JLabel();
- jButton1 = new javax.swing.JButton();
- jComboBox1 = new javax.swing.JComboBox();
- jLabel3 = new javax.swing.JLabel();
- jLabel4 = new javax.swing.JLabel();
- jComboBox2 = new javax.swing.JComboBox();
- setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
- setTitle("Burnign Firemaker | Firexranger8");
- jLabel1.setFont(new java.awt.Font("Franklin Gothic Book", 1, 14)); // NOI18N
- jLabel1.setForeground(new java.awt.Color(153, 0, 0));
- jLabel1.setText("BURNING FIREMAKER");
- jLabel2.setText("1337 Script by Firexranger8");
- jButton1.setFont(new java.awt.Font("Monotype Corsiva", 0, 18)); // NOI18N
- jButton1.setText("START");
- jButton1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton1ActionPerformed(evt);
- }
- });
- jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Normal Logs", "Oak Logs", "Willow Logs", "Teak Logs", "Arctic Pine Logs", "Maple Logs", "Mahogany Logs", "Eucalyptus Logs", "Yew Logs", "Magic Logs", "Cursed Magic Logs" }));
- jLabel3.setText("Logs");
- jLabel4.setText("Location");
- jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Varrock West", "Varrock East", "Grand Exchange", "Draynor", "Fist of Guthix", "Edgeville", "Falador", "Yanille" }));
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel2))
- .addGroup(layout.createSequentialGroup()
- .addGap(35, 35, 35)
- .addComponent(jButton1))
- .addComponent(jLabel1))
- .addGap(47, 47, 47)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jLabel3)
- .addComponent(jLabel4))
- .addGap(40, 40, 40)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel2)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jButton1))
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel3)
- .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel4)
- .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- pack();
- }// </editor-fold>
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new GUI().setVisible(true);
- }
- });
- }
- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
- location = locMap.get(jComboBox1.getSelectedItem().toString());
- LOGS = matMap.get(jComboBox2.getSelectedItem().toString());
- gui_on = false;
- setVisible(false);
- }
- // Variables declaration - do not modify
- private javax.swing.JButton jButton1;
- private javax.swing.JComboBox jComboBox1;
- private javax.swing.JComboBox jComboBox2;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel4;
- // End of variables declaration
- }
- static class FMLoc {
- public String name;
- public RSArea bank_area;
- public RSTile spot1;
- public RSTile spot2;
- public RSTile spot3;
- public RSTile spot4;
- public RSTile[] walk_path;
- public FMLoc(String name, RSArea bankZones, RSTile spot1, RSTile spot2, RSTile spot3, RSTile spot4,
- RSTile[] WALK_PATH) {
- this.name = name;
- this.bank_area = bankZones;
- this.spot1 = spot1;
- this.spot2 = spot2;
- this.spot3 = spot3;
- this.spot4 = spot4;
- this.walk_path = WALK_PATH;
- }
- }
- static class LOGS {
- public String name;
- public int inv_id;
- public LOGS(String name, int INV_ID) {
- this.name = name;
- this.inv_id = INV_ID;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement