Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.*;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import java.awt.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- @ScriptManifest(authors = {"BlindTheNet"}, keywords = {""}, name = "BTN FireMaker", description = "Burns logs within the POH to prevent ban", version = 1)
- public class skeleton extends Script implements PaintListener{
- /////////////////
- // Npc Id's //
- /////////////////
- int bankeratdung = 9710;
- /////////////////
- /////////////////
- // Locations //
- /////////////////
- int dungbankcordx = 3449;
- int dungbankcordy = 3719;
- /////////////////
- /////////////////
- // Gui Stuff //
- ////////////////
- Tutorial g = new Tutorial();
- private boolean guiWait = true;
- /////////////////
- /////////////////
- // Paint Stuff //
- ////////////////
- private int startExp;
- private int expGained;
- public int expHour = 0;
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- public int logsHour = 0;
- ///////////////////
- /////////////////
- // Item Id's //
- /////////////////
- int houseteletabid = 8013;
- int tinderboxid = 590;
- int logsfromgui;
- /////////////////
- /////////////////
- // Temp Ints //
- /////////////////
- int xyz = 1;
- int yz = 1;
- /////////////////
- @Override
- public boolean onStart() {
- {
- startExp = skills.getCurrentExp(11);
- startTime = System.currentTimeMillis();
- g.setVisible(true);
- while(guiWait)sleep(500);
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- new Tutorial();
- }
- });
- } catch (Throwable e) {
- }
- }
- return game.isLoggedIn();
- }
- public int loop() {
- /////////////////
- // Rstiles //
- /////////////////
- RSTile dungbank, twoofftelehomeloc;
- dungbank = new RSTile(dungbankcordx,dungbankcordy);
- twoofftelehomeloc = new RSTile(20000, 0);
- ////////////
- /////////////////
- // RSNPC //
- /////////////////
- RSNPC bankatdung = npcs.getNearest(bankeratdung);
- /////////////////
- /////////////////
- // RSItem //
- /////////////////
- RSItem hometab = inventory.getItem("Teleport to house");
- RSInterface houseint = interfaces.get(399);
- /////////////////
- if (inventory.containsOneOf(logsfromgui) == false){
- if (calc.distanceTo(dungbank) > 40 && players.getMyPlayer().getAnimation() == -1)
- {
- equipment.getCount();
- if (calc.distanceTo(dungbank) > 40){
- interfaces.getComponent(387,34).interact("Teleport");}
- sleep(80, 300);}
- if (calc.distanceTo(dungbank) > 3 && calc.distanceTo(dungbank) < 40){
- walking.walkTileMM(walking.getClosestTileOnMap(dungbank));
- sleep(1500, 3000);}
- if (players.getMyPlayer().getAnimation() == -1 && calc.distanceTo(dungbank) < 3){
- bankatdung.interact("Bank Fremennik");
- }
- if (bank.isOpen() && !inventory.isFull())
- {
- bank.withdraw(logsfromgui, 26);
- xyz = 1;
- yz = 1;
- sleep(80, 300);
- }
- if (bank.isOpen()){
- bank.close();}
- }
- if (inventory.containsOneOf(logsfromgui) == true)
- {
- if (bank.isOpen()){
- bank.close();}
- if (calc.distanceTo(dungbank) < 3 && players.getMyPlayer().getAnimation() == -1){
- inventory.selectItem(hometab);
- sleep(80, 300);}
- if (calc.distanceTo(dungbank) > 40 && !houseint.isValid() && xyz == 1){
- walking.getPath(twoofftelehomeloc);
- sleep(3000,5000);
- xyz = xyz + 1;
- }
- if (xyz == 2){
- walking.walkTileMM(new RSTile(players.getMyPlayer().getLocation().getX()+9,players.getMyPlayer().getLocation().getY()-9 ));
- sleep(3000,4500);
- xyz = xyz + 1;
- }
- if (xyz == 3 && players.getMyPlayer().getAnimation() == -1){
- inventory.useItem(inventory.getItem("Tinderbox"), inventory.getItem(logsfromgui));
- }
- }
- return random(500, 1500);
- }
- @Override
- public void onFinish() {
- }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(102, 102, 102, 185);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(0, 0, 0, 247);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial Black", 1, 17);
- private final Font font2 = new Font("Times New Roman", 0, 13);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- // expGained = skills.getCurrentExp(11) - startExp;
- // expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
- // long secondsTNL = skills.getCurrentExp(11) / (expHour / 3600); long hoursTNL = secondsTNL / (60 * 60); secondsTNL -= hoursTNL * (60 * 60); long minutesTNL = secondsTNL / 60; secondsTNL -= minutesTNL * 60;
- 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;
- g.setColor(color1);
- g.fillRect(226, 346, 269, 127);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(226, 346, 269, 127);
- g.setFont(font1);
- g.drawString("BlindThe.Net POH Firemaker", 223, 329);
- g.setFont(font2);
- g.setColor(color3);
- g.drawString("Runtime:" + hours + ":" + minutes + ":" + seconds, 241, 370);
- g.drawString("Gained:" + expGained + " (" + expHour + " xp/h)", 249, 392);
- g.drawString(".", 248, 412);
- // g.drawString(" Time TNL:"+ hoursTNL + ":" + minutesTNL + ":" + secondsTNL, 233, 432);
- g.drawString("Version: 0.002", 234, 452);
- }
- //END: Code generated using Enfilade's Easel
- public class Tutorial extends JFrame {
- public Tutorial() {
- initComponents();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Ryan Rumkee
- label1 = new JLabel();
- comboBox1 = new JComboBox();
- button1 = new JButton();
- //======== this ========
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Select Logs To Burn");
- label1.setFont(new Font("Tahoma", Font.BOLD, 20));
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Normal", "Oak", "Willow", "Maple", "Yew", "Magic"
- }));
- //---- button1 ----
- button1.setText("Let's burn");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- guiWait = false;
- g.setVisible(false);
- String chosen = comboBox1.getSelectedItem(). toString();
- if (chosen.equals("Normal")) {
- logsfromgui = 1511;}
- if (chosen.equals("Oak")) {
- logsfromgui = 1521;}
- if (chosen.equals("Willow")) {
- logsfromgui = 1519;}
- if (chosen.equals("Maple")) {
- logsfromgui = 1517;}
- if (chosen.equals("Yew")) {
- logsfromgui = 1515;}
- if (chosen.equals("Magic")) {
- logsfromgui = 1513;}
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(108, 108, 108)
- .addComponent(label1))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 68, GroupLayout.PREFERRED_SIZE))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(128, 128, 128)
- .addComponent(button1)))
- .addContainerGap(115, Short.MAX_VALUE))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(18, 18, 18)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
- .addComponent(button1))
- );
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Ryan Rumkee
- private JLabel label1;
- private JComboBox comboBox1;
- private JButton button1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Add Comment
Please, Sign In to add comment