Guest User

Untitled

a guest
Oct 18th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 KB | None | 0 0
  1. import javax.swing.SwingUtilities;
  2.  
  3. import org.rsbot.script.*;
  4. import org.rsbot.script.wrappers.*;
  5. import java.awt.BorderLayout;
  6. import java.awt.EventQueue;
  7.  
  8. import javax.swing.JFrame;
  9. import javax.swing.JPanel;
  10. import javax.swing.border.EmptyBorder;
  11. import javax.swing.JLabel;
  12. import javax.swing.JComboBox;
  13. import javax.swing.DefaultComboBoxModel;
  14. import javax.swing.JButton;
  15. import java.awt.event.ActionListener;
  16. import java.awt.event.ActionEvent;
  17.  
  18. @ScriptManifest(authors = {""}, keywords = {""}, name = "skeleton", description = "A basic skeleton. Does nothing.", version = 1)
  19.  
  20. public class skeleton extends Script{
  21.  
  22. /////////////////
  23. // Npc Id's //
  24. /////////////////
  25. int bankeratdung = 9710;
  26. /////////////////
  27. /////////////////
  28.  
  29. /////////////////
  30. // Locations //
  31. /////////////////
  32. int dungbankcordx = 3449;
  33. int dungbankcordy = 3719;
  34.  
  35.  
  36. static /////////////////
  37. /////////////////
  38.  
  39. none gui = new none();
  40. private static boolean guiWait = true;
  41.  
  42. /////////////////
  43. // Item Id's //
  44. /////////////////
  45.  
  46. int houseteletabid = 8013;
  47. int tinderboxid = 590;
  48. /////////////////
  49. /////////////////
  50.  
  51. RSItem logbeingused;
  52.  
  53. int xyz = 1;
  54. int yz = 1;
  55.  
  56.  
  57. @Override
  58. public boolean onStart() {
  59. {
  60. gui.setVisible(true);
  61. while(guiWait)sleep(500);
  62. try {
  63. SwingUtilities.invokeAndWait(new Runnable() {
  64.  
  65. public void run() {
  66. new none();
  67. }
  68. });
  69. } catch (Throwable e) {
  70. }
  71. }
  72. return game.isLoggedIn();
  73. }
  74.  
  75. public int loop() {
  76.  
  77. // Rstiles//
  78. RSTile dungbank, telehomeloc, twoofftelehomeloc;
  79.  
  80. dungbank = new RSTile(dungbankcordx,dungbankcordy);
  81. telehomeloc = new RSTile(dungbankcordx,dungbankcordy);
  82. twoofftelehomeloc = new RSTile(20000, 0);
  83.  
  84. ////////////
  85.  
  86. // RSNPC //
  87. RSNPC bankatdung = npcs.getNearest(bankeratdung);
  88. ///////////
  89.  
  90. // RSItem //
  91. RSItem hometab = inventory.getItem("Teleport to house");
  92. RSItem Tinderboxrsitem = inventory.getItem("Tinderbox");
  93. ///////////
  94.  
  95. RSInterface houseint = interfaces.get(399);
  96. RSInterface nofire = interfaces.get(137);
  97.  
  98. if (inventory.containsOneOf(1511) == false){
  99.  
  100. if (calc.distanceTo(dungbank) > 40)
  101. {
  102. equipment.getCount();
  103. interfaces.getComponent(387,34).interact("Teleport");}
  104. if (calc.distanceTo(dungbank) > 3){
  105. walking.walkTileMM(walking.getClosestTileOnMap(dungbank));
  106. sleep(1500, 3000);}
  107. if (players.getMyPlayer().getAnimation() == -1 && calc.distanceTo(dungbank) < 3){
  108. bankatdung.interact("Bank Fremennik");
  109. }
  110. if (bank.isOpen() && !inventory.isFull())
  111. {
  112. bank.withdraw("logs", 26);
  113. xyz = 1;
  114. yz = 1;
  115. sleep(80, 300);
  116. }
  117. if (bank.isOpen()){
  118. bank.close();}
  119. }
  120.  
  121. if (inventory.containsOneOf(1511) == true)
  122. {
  123. if (bank.isOpen()){
  124. bank.close();}
  125.  
  126. if (calc.distanceTo(dungbank) < 3 && players.getMyPlayer().getAnimation() == -1){
  127. inventory.selectItem(hometab);
  128. sleep(80, 300);}
  129.  
  130. if (calc.distanceTo(dungbank) > 40 && !houseint.isValid() && xyz == 1){
  131. walking.getPath(twoofftelehomeloc);
  132.  
  133. sleep(3000,5000);
  134. xyz = xyz + 1;
  135.  
  136. }
  137. if (xyz == 2){
  138. walking.walkTileMM(new RSTile(players.getMyPlayer().getLocation().getX()+7,players.getMyPlayer().getLocation().getY()-9 ));
  139. sleep(2000,3000);
  140. xyz = xyz + 1;
  141. }
  142. if (xyz == 3 && players.getMyPlayer().getAnimation() == -1){
  143. inventory.useItem(inventory.getItem("Tinderbox"), inventory.getItem(1511));
  144. }
  145.  
  146.  
  147. }
  148.  
  149.  
  150.  
  151.  
  152.  
  153. return random(500, 1500);
  154. }
  155.  
  156. @Override
  157. public void onFinish() {
  158. }
  159. public static class none extends JFrame {
  160.  
  161. private JPanel contentPane;
  162.  
  163. /**
  164. * Launch the application.
  165. */
  166. public static void main(String[] args) {
  167. EventQueue.invokeLater(new Runnable() {
  168. public void run() {
  169. try {
  170. none frame = new none();
  171. frame.setVisible(true);
  172. } catch (Exception e) {
  173. e.printStackTrace();
  174. }
  175. }
  176. });
  177. }
  178.  
  179. /**
  180. * Create the frame.
  181. */
  182. public none() {
  183. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  184. setBounds(100, 100, 404, 120);
  185. contentPane = new JPanel();
  186. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  187. contentPane.setLayout(new BorderLayout(0, 0));
  188. setContentPane(contentPane);
  189.  
  190. JLabel lblNewLabel = new JLabel("Select Log Type:");
  191. contentPane.add(lblNewLabel, BorderLayout.CENTER);
  192.  
  193. JComboBox comboBox = new JComboBox();
  194. comboBox.setModel(new DefaultComboBoxModel(new String[] {"Normal", "Oak", "Willow", "Maple", "Yew", "Magic"}));
  195. comboBox.setToolTipText("\r\n");
  196. contentPane.add(comboBox, BorderLayout.SOUTH);
  197.  
  198. JButton btnLetsBurn = new JButton("Lets Burn!");
  199. btnLetsBurn.addActionListener(new ActionListener() {
  200. public void actionPerformed(ActionEvent arg0) {
  201. guiWait = false;
  202. gui.setVisible(false);
  203. }
  204. });
  205. contentPane.add(btnLetsBurn, BorderLayout.EAST);
  206. }
  207.  
  208. }
  209.  
  210. }
Add Comment
Please, Sign In to add comment