Guest User

Untitled

a guest
Oct 18th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.56 KB | None | 0 0
  1. import org.rsbot.script.*;
  2. import org.rsbot.script.wrappers.*;
  3. import java.awt.*;
  4. import java.awt.event.*;
  5. import javax.swing.*;
  6. import javax.swing.GroupLayout;
  7. import javax.swing.LayoutStyle;
  8.  
  9. @ScriptManifest(authors = {""}, keywords = {""}, name = "skeleton", description = "A basic skeleton. Does nothing.", version = 1)
  10.  
  11. public class skeleton extends Script{
  12.  
  13. /////////////////
  14. // Npc Id's //
  15. /////////////////
  16. int bankeratdung = 9710;
  17. /////////////////
  18. /////////////////
  19.  
  20. /////////////////
  21. // Locations //
  22. /////////////////
  23. int dungbankcordx = 3449;
  24. int dungbankcordy = 3719;
  25.  
  26.  
  27. /////////////////
  28. /////////////////
  29.  
  30. Tutorial g = new Tutorial();
  31. private boolean guiWait = true;
  32.  
  33. /////////////////
  34. // Item Id's //
  35. /////////////////
  36.  
  37. int houseteletabid = 8013;
  38. int tinderboxid = 590;
  39. /////////////////
  40. /////////////////
  41.  
  42. RSItem logbeingused;
  43.  
  44. int xyz = 1;
  45. int yz = 1;
  46.  
  47.  
  48. @Override
  49. public boolean onStart() {
  50. {
  51. g.setVisible(true);
  52. while(guiWait)sleep(500);
  53. try {
  54. SwingUtilities.invokeAndWait(new Runnable() {
  55.  
  56. public void run() {
  57. new Tutorial();
  58. }
  59. });
  60. } catch (Throwable e) {
  61. }
  62. }
  63. return game.isLoggedIn();
  64. }
  65.  
  66. public int loop() {
  67.  
  68. // Rstiles//
  69. RSTile dungbank, telehomeloc, twoofftelehomeloc;
  70.  
  71. dungbank = new RSTile(dungbankcordx,dungbankcordy);
  72. telehomeloc = new RSTile(dungbankcordx,dungbankcordy);
  73. twoofftelehomeloc = new RSTile(20000, 0);
  74.  
  75. ////////////
  76.  
  77. // RSNPC //
  78. RSNPC bankatdung = npcs.getNearest(bankeratdung);
  79. ///////////
  80.  
  81. // RSItem //
  82. RSItem hometab = inventory.getItem("Teleport to house");
  83. RSItem Tinderboxrsitem = inventory.getItem("Tinderbox");
  84. ///////////
  85.  
  86. RSInterface houseint = interfaces.get(399);
  87. RSInterface nofire = interfaces.get(137);
  88.  
  89. if (inventory.containsOneOf(1511) == false){
  90.  
  91. if (calc.distanceTo(dungbank) > 40)
  92. {
  93. equipment.getCount();
  94. interfaces.getComponent(387,34).interact("Teleport");}
  95. if (calc.distanceTo(dungbank) > 3){
  96. walking.walkTileMM(walking.getClosestTileOnMap(dungbank));
  97. sleep(1500, 3000);}
  98. if (players.getMyPlayer().getAnimation() == -1 && calc.distanceTo(dungbank) < 3){
  99. bankatdung.interact("Bank Fremennik");
  100. }
  101. if (bank.isOpen() && !inventory.isFull())
  102. {
  103. bank.withdraw("logs", 26);
  104. xyz = 1;
  105. yz = 1;
  106. sleep(80, 300);
  107. }
  108. if (bank.isOpen()){
  109. bank.close();}
  110. }
  111.  
  112. if (inventory.containsOneOf(1511) == true)
  113. {
  114. if (bank.isOpen()){
  115. bank.close();}
  116.  
  117. if (calc.distanceTo(dungbank) < 3 && players.getMyPlayer().getAnimation() == -1){
  118. inventory.selectItem(hometab);
  119. sleep(80, 300);}
  120.  
  121. if (calc.distanceTo(dungbank) > 40 && !houseint.isValid() && xyz == 1){
  122. walking.getPath(twoofftelehomeloc);
  123.  
  124. sleep(3000,5000);
  125. xyz = xyz + 1;
  126.  
  127. }
  128. if (xyz == 2){
  129. walking.walkTileMM(new RSTile(players.getMyPlayer().getLocation().getX()+7,players.getMyPlayer().getLocation().getY()-9 ));
  130. sleep(2000,3000);
  131. xyz = xyz + 1;
  132. }
  133. if (xyz == 3 && players.getMyPlayer().getAnimation() == -1){
  134. inventory.useItem(inventory.getItem("Tinderbox"), inventory.getItem(1511));
  135. }
  136.  
  137.  
  138. }
  139.  
  140.  
  141.  
  142.  
  143.  
  144. return random(500, 1500);
  145. }
  146.  
  147. @Override
  148. public void onFinish() {
  149. }
  150. public class Tutorial extends JFrame {
  151. public Tutorial() {
  152. initComponents();
  153. }
  154.  
  155.  
  156.  
  157. private void initComponents() {
  158. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  159. // Generated using JFormDesigner Evaluation license - Ryan Rumkee
  160. label1 = new JLabel();
  161. comboBox1 = new JComboBox();
  162. button1 = new JButton();
  163.  
  164. //======== this ========
  165. Container contentPane = getContentPane();
  166.  
  167. //---- label1 ----
  168. label1.setText("GUI Tutorial");
  169. label1.setFont(new Font("Tahoma", Font.BOLD, 20));
  170.  
  171. //---- comboBox1 ----
  172. comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  173. "Banking",
  174. "Powerchop"
  175. }));
  176.  
  177. //---- button1 ----
  178. button1.setText("Start Script");
  179. button1.addActionListener(new ActionListener() {
  180. @Override
  181. public void actionPerformed(ActionEvent e) {
  182. guiWait = false;
  183. g.setVisible(false);
  184. }
  185. });
  186.  
  187. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  188. contentPane.setLayout(contentPaneLayout);
  189. contentPaneLayout.setHorizontalGroup(
  190. contentPaneLayout.createParallelGroup()
  191. .addGroup(contentPaneLayout.createSequentialGroup()
  192. .addGroup(contentPaneLayout.createParallelGroup()
  193. .addGroup(contentPaneLayout.createSequentialGroup()
  194. .addGap(108, 108, 108)
  195. .addComponent(label1))
  196. .addGroup(contentPaneLayout.createSequentialGroup()
  197. .addContainerGap()
  198. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 68, GroupLayout.PREFERRED_SIZE))
  199. .addGroup(contentPaneLayout.createSequentialGroup()
  200. .addGap(128, 128, 128)
  201. .addComponent(button1)))
  202. .addContainerGap(115, Short.MAX_VALUE))
  203. );
  204. contentPaneLayout.setVerticalGroup(
  205. contentPaneLayout.createParallelGroup()
  206. .addGroup(contentPaneLayout.createSequentialGroup()
  207. .addContainerGap()
  208. .addComponent(label1)
  209. .addGap(18, 18, 18)
  210. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  211. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
  212. .addComponent(button1))
  213. );
  214. pack();
  215. setLocationRelativeTo(getOwner());
  216. // JFormDesigner - End of component initialization //GEN-END:initComponents
  217. }
  218.  
  219. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  220. // Generated using JFormDesigner Evaluation license - Ryan Rumkee
  221. private JLabel label1;
  222. private JComboBox comboBox1;
  223. private JButton button1;
  224. // JFormDesigner - End of variables declaration //GEN-END:variables
  225. }
  226. }
Add Comment
Please, Sign In to add comment