Guest User

Untitled

a guest
Oct 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.83 KB | None | 0 0
  1. import org.rsbot.script.*;
  2. import org.rsbot.script.methods.Skills;
  3. import org.rsbot.script.wrappers.*;
  4. import java.awt.*;
  5. import java.awt.event.*;
  6. import javax.swing.*;
  7. import java.awt.*;
  8. import org.rsbot.event.listeners.PaintListener;
  9. import org.rsbot.event.events.MessageEvent;
  10. import org.rsbot.event.listeners.MessageListener;
  11.  
  12. @ScriptManifest(authors = {"BlindTheNet"}, keywords = {""}, name = "BTN FireMaker", description = "Burns logs within the POH to prevent ban", version = 1)
  13.  
  14. public class skeleton extends Script implements PaintListener{
  15.  
  16. /////////////////
  17. // Npc Id's //
  18. /////////////////
  19. int bankeratdung = 9710;
  20. /////////////////
  21.  
  22.  
  23. /////////////////
  24. // Locations //
  25. /////////////////
  26. int dungbankcordx = 3449;
  27. int dungbankcordy = 3719;
  28. /////////////////
  29.  
  30.  
  31. /////////////////
  32. // Gui Stuff //
  33. ////////////////
  34. Tutorial g = new Tutorial();
  35. private boolean guiWait = true;
  36. /////////////////
  37.  
  38. /////////////////
  39. // Paint Stuff //
  40. ////////////////
  41. private int startExp;
  42. private int expGained;
  43. public int expHour = 0;
  44. public long startTime = 0;
  45. public long millis = 0;
  46. public long hours = 0;
  47. public long minutes = 0;
  48. public long seconds = 0;
  49. public long last = 0;
  50. public int logsHour = 0;
  51. ///////////////////
  52.  
  53.  
  54. /////////////////
  55. // Item Id's //
  56. /////////////////
  57. int houseteletabid = 8013;
  58. int tinderboxid = 590;
  59. int logsfromgui;
  60. /////////////////
  61.  
  62. /////////////////
  63. // Temp Ints //
  64. /////////////////
  65. int xyz = 1;
  66. int yz = 1;
  67. /////////////////
  68.  
  69. @Override
  70. public boolean onStart() {
  71. {
  72. startExp = skills.getCurrentExp(11);
  73. startTime = System.currentTimeMillis();
  74. g.setVisible(true);
  75. while(guiWait)sleep(500);
  76. try {
  77. SwingUtilities.invokeAndWait(new Runnable() {
  78.  
  79. public void run() {
  80. new Tutorial();
  81. }
  82. });
  83. } catch (Throwable e) {
  84. }
  85. }
  86. return game.isLoggedIn();
  87.  
  88. }
  89.  
  90. public int loop() {
  91.  
  92. /////////////////
  93. // Rstiles //
  94. /////////////////
  95. RSTile dungbank, twoofftelehomeloc;
  96.  
  97. dungbank = new RSTile(dungbankcordx,dungbankcordy);
  98. twoofftelehomeloc = new RSTile(20000, 0);
  99. ////////////
  100.  
  101. /////////////////
  102. // RSNPC //
  103. /////////////////
  104. RSNPC bankatdung = npcs.getNearest(bankeratdung);
  105. /////////////////
  106.  
  107. /////////////////
  108. // RSItem //
  109. /////////////////
  110. RSItem hometab = inventory.getItem("Teleport to house");
  111. RSInterface houseint = interfaces.get(399);
  112. /////////////////
  113.  
  114. if (inventory.containsOneOf(logsfromgui) == false){
  115.  
  116. if (calc.distanceTo(dungbank) > 40 && players.getMyPlayer().getAnimation() == -1)
  117. {
  118. equipment.getCount();
  119. if (calc.distanceTo(dungbank) > 40){
  120. interfaces.getComponent(387,34).interact("Teleport");}
  121. sleep(80, 300);}
  122. if (calc.distanceTo(dungbank) > 3 && calc.distanceTo(dungbank) < 40){
  123. walking.walkTileMM(walking.getClosestTileOnMap(dungbank));
  124. sleep(1500, 3000);}
  125. if (players.getMyPlayer().getAnimation() == -1 && calc.distanceTo(dungbank) < 3){
  126. bankatdung.interact("Bank Fremennik");
  127. }
  128. if (bank.isOpen() && !inventory.isFull())
  129. {
  130. bank.withdraw(logsfromgui, 26);
  131. xyz = 1;
  132. yz = 1;
  133. sleep(80, 300);
  134. }
  135. if (bank.isOpen()){
  136. bank.close();}
  137. }
  138.  
  139. if (inventory.containsOneOf(logsfromgui) == true)
  140. {
  141. if (bank.isOpen()){
  142. bank.close();}
  143.  
  144. if (calc.distanceTo(dungbank) < 3 && players.getMyPlayer().getAnimation() == -1){
  145. inventory.selectItem(hometab);
  146. sleep(80, 300);}
  147.  
  148. if (calc.distanceTo(dungbank) > 40 && !houseint.isValid() && xyz == 1){
  149. walking.getPath(twoofftelehomeloc);
  150.  
  151. sleep(3000,5000);
  152. xyz = xyz + 1;
  153.  
  154. }
  155. if (xyz == 2){
  156. walking.walkTileMM(new RSTile(players.getMyPlayer().getLocation().getX()+9,players.getMyPlayer().getLocation().getY()-9 ));
  157. sleep(3000,4500);
  158. xyz = xyz + 1;
  159. }
  160. if (xyz == 3 && players.getMyPlayer().getAnimation() == -1){
  161. inventory.useItem(inventory.getItem("Tinderbox"), inventory.getItem(logsfromgui));
  162. }
  163.  
  164.  
  165. }
  166.  
  167.  
  168.  
  169.  
  170.  
  171. return random(500, 1500);
  172. }
  173.  
  174. @Override
  175. public void onFinish() {
  176. }
  177.  
  178. //START: Code generated using Enfilade's Easel
  179. private final Color color1 = new Color(102, 102, 102, 185);
  180. private final Color color2 = new Color(0, 0, 0);
  181. private final Color color3 = new Color(0, 0, 0, 247);
  182.  
  183. private final BasicStroke stroke1 = new BasicStroke(1);
  184.  
  185. private final Font font1 = new Font("Arial Black", 1, 17);
  186. private final Font font2 = new Font("Times New Roman", 0, 13);
  187.  
  188. public void onRepaint(Graphics g1) {
  189. Graphics2D g = (Graphics2D)g1;
  190. // expGained = skills.getCurrentExp(11) - startExp;
  191. // expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
  192.  
  193. // long secondsTNL = skills.getCurrentExp(11) / (expHour / 3600); long hoursTNL = secondsTNL / (60 * 60); secondsTNL -= hoursTNL * (60 * 60); long minutesTNL = secondsTNL / 60; secondsTNL -= minutesTNL * 60;
  194. millis = System.currentTimeMillis() - startTime;
  195. hours = millis / (1000 * 60 * 60);
  196. millis -= hours * (1000 * 60 * 60);
  197. minutes = millis / (1000 * 60);
  198. millis -= minutes * (1000 * 60);
  199. seconds = millis / 1000;
  200. g.setColor(color1);
  201. g.fillRect(226, 346, 269, 127);
  202. g.setColor(color2);
  203. g.setStroke(stroke1);
  204. g.drawRect(226, 346, 269, 127);
  205. g.setFont(font1);
  206. g.drawString("BlindThe.Net POH Firemaker", 223, 329);
  207. g.setFont(font2);
  208. g.setColor(color3);
  209. g.drawString("Runtime:" + hours + ":" + minutes + ":" + seconds, 241, 370);
  210. g.drawString("Gained:" + expGained + " (" + expHour + " xp/h)", 249, 392);
  211. g.drawString(".", 248, 412);
  212. // g.drawString(" Time TNL:"+ hoursTNL + ":" + minutesTNL + ":" + secondsTNL, 233, 432);
  213. g.drawString("Version: 0.002", 234, 452);
  214. }
  215. //END: Code generated using Enfilade's Easel
  216. public class Tutorial extends JFrame {
  217. public Tutorial() {
  218. initComponents();
  219. }
  220.  
  221.  
  222.  
  223. private void initComponents() {
  224. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  225. // Generated using JFormDesigner Evaluation license - Ryan Rumkee
  226. label1 = new JLabel();
  227. comboBox1 = new JComboBox();
  228. button1 = new JButton();
  229.  
  230. //======== this ========
  231. Container contentPane = getContentPane();
  232.  
  233. //---- label1 ----
  234. label1.setText("Select Logs To Burn");
  235. label1.setFont(new Font("Tahoma", Font.BOLD, 20));
  236.  
  237. //---- comboBox1 ----
  238. comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  239. "Normal", "Oak", "Willow", "Maple", "Yew", "Magic"
  240. }));
  241.  
  242. //---- button1 ----
  243. button1.setText("Let's burn");
  244. button1.addActionListener(new ActionListener() {
  245. @Override
  246. public void actionPerformed(ActionEvent e) {
  247. guiWait = false;
  248. g.setVisible(false);
  249. String chosen = comboBox1.getSelectedItem(). toString();
  250. if (chosen.equals("Normal")) {
  251. logsfromgui = 1511;}
  252. if (chosen.equals("Oak")) {
  253. logsfromgui = 1521;}
  254. if (chosen.equals("Willow")) {
  255. logsfromgui = 1519;}
  256. if (chosen.equals("Maple")) {
  257. logsfromgui = 1517;}
  258. if (chosen.equals("Yew")) {
  259. logsfromgui = 1515;}
  260. if (chosen.equals("Magic")) {
  261. logsfromgui = 1513;}
  262.  
  263.  
  264.  
  265. }
  266. });
  267.  
  268. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  269. contentPane.setLayout(contentPaneLayout);
  270. contentPaneLayout.setHorizontalGroup(
  271. contentPaneLayout.createParallelGroup()
  272. .addGroup(contentPaneLayout.createSequentialGroup()
  273. .addGroup(contentPaneLayout.createParallelGroup()
  274. .addGroup(contentPaneLayout.createSequentialGroup()
  275. .addGap(108, 108, 108)
  276. .addComponent(label1))
  277. .addGroup(contentPaneLayout.createSequentialGroup()
  278. .addContainerGap()
  279. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 68, GroupLayout.PREFERRED_SIZE))
  280. .addGroup(contentPaneLayout.createSequentialGroup()
  281. .addGap(128, 128, 128)
  282. .addComponent(button1)))
  283. .addContainerGap(115, Short.MAX_VALUE))
  284. );
  285. contentPaneLayout.setVerticalGroup(
  286. contentPaneLayout.createParallelGroup()
  287. .addGroup(contentPaneLayout.createSequentialGroup()
  288. .addContainerGap()
  289. .addComponent(label1)
  290. .addGap(18, 18, 18)
  291. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  292. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
  293. .addComponent(button1))
  294. );
  295. pack();
  296. setLocationRelativeTo(getOwner());
  297. // JFormDesigner - End of component initialization //GEN-END:initComponents
  298. }
  299.  
  300. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  301. // Generated using JFormDesigner Evaluation license - Ryan Rumkee
  302. private JLabel label1;
  303. private JComboBox comboBox1;
  304. private JButton button1;
  305. // JFormDesigner - End of variables declaration //GEN-END:variables
  306. }
  307. }
Add Comment
Please, Sign In to add comment