Advertisement
Guest User

Untitled

a guest
May 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.55 KB | None | 0 0
  1. import impsoft.bots.ColorBot;
  2. import impsoft.scripting.ibot.interfaces.AutoPaint;
  3. import impsoft.scripting.types.ColorScript;
  4. import impsoft.utils.general.Timer;
  5. import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
  6. import java.awt.event.KeyEvent;
  7. import java.awt.Graphics;
  8. import java.awt.Rectangle;
  9. import impsoft.scripting.types.parallel.scriptjobs.ScriptJob;
  10. import impsoft.scripting.types.ColorSkeltonScriptable;
  11. import impsoft.bots.reflection.NPC;
  12. import impsoft.bots.reflection.WorldObject;
  13. import impsoft.scripting.ibot.structs.XY;
  14. import impsoft.scripting.ibot.builtin.Camera;
  15. import impsoft.bots.input.KeyboardCommand;
  16.  
  17.  
  18. import bergCoder.BergUtils;
  19. import impsoft.bots.reflection.Interface;
  20. import impsoft.scripting.ibot.structs.AryanTile;
  21. import java.awt.event.KeyEvent;
  22.  
  23.  
  24. public class FastFletcher extends ColorScript implements AutoPaint {
  25. public FastFletcher(ColorBot c) {
  26. super(c);
  27. }
  28. /*Hello and this is GOD*/
  29.  
  30. BergUtils util = new BergUtils(this);
  31.  
  32. //Information
  33. public static String author = "Jazza";
  34. public static String description = "A new definition to Fast!";
  35. public static double version = 1.2;
  36.  
  37. //AryanTile
  38. AryanTile walk = new AryanTile(1893,3179);
  39.  
  40. //Stings and INTs
  41. public String Status;
  42. public int FletchLvlsGained = 0;
  43. public int CurrentLvl;
  44. public int Fletched = 0;
  45. public int bowsFletched = 0;
  46.  
  47. //Rectangles
  48. Rectangle bowRectangle;
  49. Rectangle Shortbow = new Rectangle (110,403,10,12);
  50. Rectangle Longbow = new Rectangle (245,398,33,20);
  51. Rectangle Shaft = new Rectangle (397,401,20,22);
  52.  
  53. public boolean longbow = false, shortbow = false, xbow = false, StartScript = false;
  54.  
  55. //Timer
  56. public Timer timeRan = new Timer(0);
  57. public Timer wait = null;
  58.  
  59. public void script() throws InterruptedException, Exception {
  60. log("Welcome to FastFletcher V1.2!");
  61. log("You will experience a new definition to Fast");
  62. log("Please report all bugs to Jazza123 on the forums!");
  63. startAllRandoms();
  64. stopRandom("PublicChatOff");
  65. while(!isLoggedIn())
  66. sleep(1000);
  67. fletcherGUI Gui = new fletcherGUI();
  68. Gui.setVisible(true);
  69. while (!StartScript)
  70. sleep(1500);
  71. Gui.setVisible(false);
  72. Gui.dispose();
  73. if(longbow){
  74. bowRectangle = Longbow;
  75. }
  76. if(shortbow){
  77. bowRectangle = Shortbow;
  78. }
  79. if(xbow){
  80. bowRectangle = Shaft;
  81. }
  82. checkState();
  83. }
  84.  
  85. private void checkState() throws InterruptedException
  86. {
  87. if (theTabs.Inventory.count("ogs") != 0) {
  88. fletchLogs();
  89. } else {
  90. doBanking();
  91. }
  92. }
  93.  
  94. private void fletchLogs() throws InterruptedException
  95. {
  96. ItemSlot log = theTabs.Inventory.findItemSlot("ogs");
  97. ItemSlot knife = theTabs.Inventory.findItemSlot("Knife");
  98. if(!theTabs.Inventory.isSelected())
  99. {
  100. theTabs.Inventory.click();
  101. }
  102. if(theTabs.Inventory.isSelected())
  103. {
  104. log.mouseClickLeftOn();
  105.  
  106. knife.mouseClickLeftOn();
  107. sleep(random(800,900));
  108. while(!theMenuFinder.isMenuUp()){
  109. mouseClickRight(bowRectangle);
  110. }
  111. theMenuFinder.doMenuContains("X");
  112. String text = "";
  113. while(text.equalsIgnoreCase("")){
  114. try{
  115. Interface temp = getInterfaceAtIndex(752,4);
  116. if(temp.isValid()){
  117. text = temp.getText();
  118. }
  119. } catch(IndexOutOfBoundsException e){}
  120. sleep(50);
  121. }
  122.  
  123. enterCommand(KeyboardCommand.typeLettersFast(Thread.currentThread().getPriority(),Thread.currentThread(),Integer.toString(random(99,999))));
  124. SendKey(KeyEvent.VK_ENTER);
  125.  
  126. while(theTabs.Inventory.count("ogs")> 4){
  127. sleep(100);
  128. }
  129. NPC banker = theWorldObjectFinder.findNPC(new String[]{"Bank Banker","chest"});
  130. try{
  131. XY bankercoordinates = banker.getRecommendPointToClick();
  132.  
  133. mouseClickRight(bankercoordinates);
  134.  
  135. theMenuFinder.doMenuContains("Bank Banker");
  136. theMenuFinder.doMenuContains("Chest");
  137.  
  138. } catch (NullPointerException e){}
  139.  
  140. waitForNoAnimation();
  141. }
  142. }
  143.  
  144. void waitForNoAnimation() throws InterruptedException
  145. {
  146. while(theTabs.Inventory.count("ogs")>0){
  147. sleep(100);
  148. }
  149. while (getAnimation() == -1 && theTabs.Inventory.count("ogs") < 1) {
  150. NPC banker = theWorldObjectFinder.findNPC(new String[]{"Banker","Bank chest"});
  151. try{
  152. XY bankercoordinates = banker.getRecommendPointToClick();
  153. mouseMove(bankercoordinates);
  154. String d = theTopText.getTopText();
  155. if(d.contains("ank chest") || d.contains("anker"))
  156. {
  157. if(d.contains("Use")){
  158. mouseClickLeft(bankercoordinates);
  159. } else {
  160. mouseClickRight(bankercoordinates);
  161. while (!theMenuFinder.isMenuUp())
  162. sleep(500);
  163. }
  164. theMenuFinder.doMenu("Use-quickly");
  165. }
  166.  
  167. } catch (NullPointerException e){}
  168.  
  169. bowsFletched += theTabs.Inventory.count("bow");
  170.  
  171. doBanking();
  172. }
  173. }
  174.  
  175. private void doBanking() throws InterruptedException
  176. {
  177. String[] knifes = {"Knife"};
  178. theBank.doDepositAllBut(knifes);
  179. theBank.doWithDrawAll("ogs", true);
  180. theBank.exit();
  181. if (theTabs.Inventory.count("ogs") > 0) {
  182. fletchLogs();
  183. } else {
  184. doBanking();
  185. }
  186. }
  187.  
  188. public void type(String toType) throws InterruptedException //Nightmares18
  189. {
  190.  
  191. char[] chars = toType.toCharArray();
  192. for(int i = 0;i<chars.length;i++)
  193. {
  194. ScriptJob sj;
  195. if(i != chars.length-1)
  196. sj = new trueTypeLettersFast(this,String.valueOf(chars[i]));
  197. sleep(random(50,200));
  198. }
  199. }
  200.  
  201. public class trueTypeLettersFast extends ScriptJob
  202. {
  203. String value = "";
  204.  
  205. public trueTypeLettersFast(ColorSkeltonScriptable cs, String value)
  206. {
  207. super(cs);
  208. this.value = value;
  209. ColorSkeltonScriptable.addScriptJob(this);
  210. }
  211.  
  212. @Override
  213. public void runV() throws InterruptedException
  214. {
  215. SendText(value);
  216. } //wheres the error?
  217. }
  218.  
  219.  
  220. public void paint(Graphics g)
  221. {
  222. //paint code here, such as g.drawRect...
  223. g.setColor(new java.awt.Color(255, 51, 51));
  224. g.fillRect(37, 43, 327, 104);
  225. g.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 22));
  226. g.setColor(new java.awt.Color(255, 255, 255));
  227. g.drawString("Bows fletched" +bowsFletched, 53, 89);
  228.  
  229. }
  230.  
  231. class fletcherGUI extends javax.swing.JFrame {
  232.  
  233. /** Creates new form fletcherGUI */
  234. public fletcherGUI() {
  235. initComponents();
  236. }
  237.  
  238. //public boolean longbow = false, shortbow = false, xbow = false;
  239. public boolean logboolean = false, oakboolean = false, willowboolean = false, mapleboolean = false, yewboolean = false, magicboolean = false; //add a =false to every one of them
  240. @SuppressWarnings("unchecked")
  241. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  242. private void initComponents() {
  243.  
  244. jCheckBox4 = new javax.swing.JCheckBox();
  245. jCheckBox2 = new javax.swing.JCheckBox();
  246. jPanel1 = new javax.swing.JPanel();
  247. jButton1 = new javax.swing.JButton();
  248. jComboBox1 = new javax.swing.JComboBox();
  249. jLabel1 = new javax.swing.JLabel();
  250. jCheckBox5 = new javax.swing.JCheckBox();
  251. jCheckBox1 = new javax.swing.JCheckBox();
  252. jCheckBox3 = new javax.swing.JCheckBox();
  253.  
  254. jCheckBox4.setText("Shaft");
  255. jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
  256. public void actionPerformed(java.awt.event.ActionEvent evt) {
  257. jCheckBox4ActionPerformed(evt);
  258. }
  259. });
  260.  
  261. jCheckBox2.setText("Shortbow");
  262. jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
  263. public void actionPerformed(java.awt.event.ActionEvent evt) {
  264. jCheckBox2ActionPerformed(evt);
  265. }
  266. });
  267.  
  268. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  269.  
  270. jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
  271.  
  272. jButton1.setText("Start");
  273. jButton1.addActionListener(new java.awt.event.ActionListener() {
  274. public void actionPerformed(java.awt.event.ActionEvent evt) {
  275. jButton1ActionPerformed(evt);
  276. }
  277. });
  278.  
  279. jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose bow:", "Log", "Oak", "Willow", "Maple", "Yew", "Magic" }));
  280. jComboBox1.addActionListener(new java.awt.event.ActionListener() {
  281. public void actionPerformed(java.awt.event.ActionEvent evt) {
  282. jComboBox1ActionPerformed(evt);
  283. }
  284. });
  285.  
  286. jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
  287. jLabel1.setText("FastFletcher");
  288.  
  289. jCheckBox5.setText("Shortbow");
  290. jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
  291. public void actionPerformed(java.awt.event.ActionEvent evt) {
  292. jCheckBox5ActionPerformed(evt);
  293. }
  294. });
  295.  
  296. jCheckBox1.setText("Longbow");
  297. jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
  298. public void actionPerformed(java.awt.event.ActionEvent evt) {
  299. jCheckBox1ActionPerformed(evt);
  300. }
  301. });
  302.  
  303. jCheckBox3.setText("Crossbow");
  304. jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
  305. public void actionPerformed(java.awt.event.ActionEvent evt) {
  306. jCheckBox3ActionPerformed(evt);
  307. }
  308. });
  309.  
  310. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  311. jPanel1.setLayout(jPanel1Layout);
  312. jPanel1Layout.setHorizontalGroup(
  313. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  314. .addGroup(jPanel1Layout.createSequentialGroup()
  315. .addContainerGap()
  316. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
  317. .addContainerGap(102, Short.MAX_VALUE))
  318. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  319. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  320. .addGroup(jPanel1Layout.createSequentialGroup()
  321. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  322. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  323. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
  324. .addGroup(jPanel1Layout.createSequentialGroup()
  325. .addContainerGap()
  326. .addComponent(jButton1)
  327. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
  328. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  329. .addComponent(jCheckBox5)
  330. .addGroup(jPanel1Layout.createSequentialGroup()
  331. .addComponent(jCheckBox3)
  332. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  333. .addComponent(jCheckBox1)))
  334. .addGap(16, 16, 16))
  335. );
  336. jPanel1Layout.setVerticalGroup(
  337. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  338. .addGroup(jPanel1Layout.createSequentialGroup()
  339. .addContainerGap()
  340. .addComponent(jLabel1)
  341. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  342. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  343. .addComponent(jCheckBox3)
  344. .addComponent(jCheckBox1)
  345. .addComponent(jButton1))
  346. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  347. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  348. .addComponent(jCheckBox5)
  349. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  350. .addContainerGap(18, Short.MAX_VALUE))
  351. );
  352.  
  353. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  354. getContentPane().setLayout(layout);
  355. layout.setHorizontalGroup(
  356. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  357. .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  358. );
  359. layout.setVerticalGroup(
  360. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  361. .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  362. );
  363.  
  364. pack();
  365. }// </editor-fold>
  366.  
  367. private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
  368. String a = jComboBox1.toString();
  369. if(a.contains("Log")) {
  370. logboolean = true;
  371. } else {
  372. logboolean = false;
  373. }
  374.  
  375. if(a.contains("Oak")) {
  376. oakboolean = true; //repeat until done
  377. } else if (a.contains("Willow")) {
  378. willowboolean = true;
  379. } else if (a.contains("Maple")) {
  380. mapleboolean = true;
  381. } else if (a.contains("Yew")) {
  382. yewboolean = true; //Sto and dont click the "Insert" buttonk
  383. } else {
  384. magicboolean = true;
  385. }
  386.  
  387. }
  388.  
  389. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  390. StartScript = true;
  391. }
  392. private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
  393. if(jCheckBox1.isSelected()) longbow = true;
  394. }
  395.  
  396. private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {
  397. // TODO add your handling code here:
  398. }
  399.  
  400. private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {
  401. if(jCheckBox3.isSelected()) xbow = true;
  402. }
  403.  
  404. private void jCheckBox4ActionPerformed(java.awt.event.ActionEvent evt) {
  405. // TODO add your handling code here:
  406. }
  407.  
  408. private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt) {
  409. if(jCheckBox5.isSelected()) shortbow = true;
  410. }
  411.  
  412. public void main(String args[]) {
  413. java.awt.EventQueue.invokeLater(new Runnable() {
  414. public void run() {
  415. new fletcherGUI().setVisible(true);
  416. }
  417. });
  418.  
  419. }
  420.  
  421.  
  422. // Variables declaration - do not modify
  423. private javax.swing.JButton jButton1;
  424. private javax.swing.JCheckBox jCheckBox1;
  425. private javax.swing.JCheckBox jCheckBox2;
  426. private javax.swing.JCheckBox jCheckBox3;
  427. private javax.swing.JCheckBox jCheckBox4;
  428. private javax.swing.JCheckBox jCheckBox5;
  429. private javax.swing.JComboBox jComboBox1;
  430. private javax.swing.JLabel jLabel1;
  431. private javax.swing.JPanel jPanel1;
  432. // End of variables declaration
  433.  
  434. }
  435.  
  436. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement