Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.GroupLayout;
- import javax.swing.LayoutStyle;
- @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;
- /////////////////
- /////////////////
- Tutorial g = new Tutorial();
- private boolean guiWait = true;
- /////////////////
- // Item Id's //
- /////////////////
- int houseteletabid = 8013;
- int tinderboxid = 590;
- /////////////////
- /////////////////
- RSItem logbeingused;
- int xyz = 1;
- int yz = 1;
- @Override
- public boolean onStart() {
- {
- 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, 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 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("GUI Tutorial");
- label1.setFont(new Font("Tahoma", Font.BOLD, 20));
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Banking",
- "Powerchop"
- }));
- //---- button1 ----
- button1.setText("Start Script");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- guiWait = false;
- g.setVisible(false);
- }
- });
- 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