Guest User

Untitled

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