Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.SwingUtilities;
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JLabel;
- import javax.swing.JComboBox;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.awt.event.ActionEvent;
- @ScriptManifest(authors = {""}, keywords = {""}, name = "skeleton", description = "A basic skeleton. Does nothing.", version = 1)
- public class skeleton extends Script{
- /////////////////
- // Npc Id's //
- /////////////////
- int bankeratdung = 9710;
- /////////////////
- /////////////////
- /////////////////
- // Locations //
- /////////////////
- int dungbankcordx = 3449;
- int dungbankcordy = 3719;
- static /////////////////
- /////////////////
- none gui = new none();
- private static boolean guiWait = true;
- /////////////////
- // Item Id's //
- /////////////////
- int houseteletabid = 8013;
- int tinderboxid = 590;
- /////////////////
- /////////////////
- RSItem logbeingused;
- int xyz = 1;
- int yz = 1;
- @Override
- public boolean onStart() {
- {
- gui.setVisible(true);
- while(guiWait)sleep(500);
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- new none();
- }
- });
- } catch (Throwable e) {
- }
- }
- return game.isLoggedIn();
- }
- public int loop() {
- // Rstiles//
- RSTile dungbank, telehomeloc, twoofftelehomeloc;
- dungbank = new RSTile(dungbankcordx,dungbankcordy);
- telehomeloc = new RSTile(dungbankcordx,dungbankcordy);
- twoofftelehomeloc = new RSTile(20000, 0);
- ////////////
- // RSNPC //
- RSNPC bankatdung = npcs.getNearest(bankeratdung);
- ///////////
- // RSItem //
- RSItem hometab = inventory.getItem("Teleport to house");
- RSItem Tinderboxrsitem = inventory.getItem("Tinderbox");
- ///////////
- RSInterface houseint = interfaces.get(399);
- RSInterface nofire = interfaces.get(137);
- if (inventory.containsOneOf(1511) == false){
- if (calc.distanceTo(dungbank) > 40)
- {
- equipment.getCount();
- interfaces.getComponent(387,34).interact("Teleport");}
- if (calc.distanceTo(dungbank) > 3){
- 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("logs", 26);
- xyz = 1;
- yz = 1;
- sleep(80, 300);
- }
- if (bank.isOpen()){
- bank.close();}
- }
- if (inventory.containsOneOf(1511) == 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()+7,players.getMyPlayer().getLocation().getY()-9 ));
- sleep(2000,3000);
- xyz = xyz + 1;
- }
- if (xyz == 3 && players.getMyPlayer().getAnimation() == -1){
- inventory.useItem(inventory.getItem("Tinderbox"), inventory.getItem(1511));
- }
- }
- return random(500, 1500);
- }
- @Override
- public void onFinish() {
- }
- public static class none extends JFrame {
- private JPanel contentPane;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- none frame = new none();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public none() {
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 404, 120);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- contentPane.setLayout(new BorderLayout(0, 0));
- setContentPane(contentPane);
- JLabel lblNewLabel = new JLabel("Select Log Type:");
- contentPane.add(lblNewLabel, BorderLayout.CENTER);
- JComboBox comboBox = new JComboBox();
- comboBox.setModel(new DefaultComboBoxModel(new String[] {"Normal", "Oak", "Willow", "Maple", "Yew", "Magic"}));
- comboBox.setToolTipText("\r\n");
- contentPane.add(comboBox, BorderLayout.SOUTH);
- JButton btnLetsBurn = new JButton("Lets Burn!");
- btnLetsBurn.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- guiWait = false;
- gui.setVisible(false);
- }
- });
- contentPane.add(btnLetsBurn, BorderLayout.EAST);
- }
- }
- }
Add Comment
Please, Sign In to add comment