Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import impsoft.bots.ColorBot;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.types.ColorScript;
- import impsoft.utils.general.Timer;
- import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
- import java.awt.event.KeyEvent;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import impsoft.scripting.types.parallel.scriptjobs.ScriptJob;
- import impsoft.scripting.types.ColorSkeltonScriptable;
- import impsoft.bots.reflection.NPC;
- import impsoft.bots.reflection.WorldObject;
- import impsoft.scripting.ibot.structs.XY;
- import impsoft.scripting.ibot.builtin.Camera;
- import impsoft.bots.input.KeyboardCommand;
- import bergCoder.BergUtils;
- import impsoft.bots.reflection.Interface;
- import impsoft.scripting.ibot.structs.AryanTile;
- import java.awt.event.KeyEvent;
- public class FastFletcher extends ColorScript implements AutoPaint {
- public FastFletcher(ColorBot c) {
- super(c);
- }
- /*Hello and this is GOD*/
- BergUtils util = new BergUtils(this);
- //Information
- public static String author = "Jazza";
- public static String description = "A new definition to Fast!";
- public static double version = 1.2;
- //AryanTile
- AryanTile walk = new AryanTile(1893,3179);
- //Stings and INTs
- public String Status;
- public int FletchLvlsGained = 0;
- public int CurrentLvl;
- public int Fletched = 0;
- public int bowsFletched = 0;
- //Rectangles
- Rectangle bowRectangle;
- Rectangle Shortbow = new Rectangle (110,403,10,12);
- Rectangle Longbow = new Rectangle (245,398,33,20);
- Rectangle Shaft = new Rectangle (397,401,20,22);
- public boolean longbow = false, shortbow = false, xbow = false, StartScript = false;
- //Timer
- public Timer timeRan = new Timer(0);
- public Timer wait = null;
- public void script() throws InterruptedException, Exception {
- log("Welcome to FastFletcher V1.2!");
- log("You will experience a new definition to Fast");
- log("Please report all bugs to Jazza123 on the forums!");
- startAllRandoms();
- stopRandom("PublicChatOff");
- while(!isLoggedIn())
- sleep(1000);
- fletcherGUI Gui = new fletcherGUI();
- Gui.setVisible(true);
- while (!StartScript)
- sleep(1500);
- Gui.setVisible(false);
- Gui.dispose();
- if(longbow){
- bowRectangle = Longbow;
- }
- if(shortbow){
- bowRectangle = Shortbow;
- }
- if(xbow){
- bowRectangle = Shaft;
- }
- checkState();
- }
- private void checkState() throws InterruptedException
- {
- if (theTabs.Inventory.count("ogs") != 0) {
- fletchLogs();
- } else {
- doBanking();
- }
- }
- private void fletchLogs() throws InterruptedException
- {
- ItemSlot log = theTabs.Inventory.findItemSlot("ogs");
- ItemSlot knife = theTabs.Inventory.findItemSlot("Knife");
- if(!theTabs.Inventory.isSelected())
- {
- theTabs.Inventory.click();
- }
- if(theTabs.Inventory.isSelected())
- {
- log.mouseClickLeftOn();
- knife.mouseClickLeftOn();
- sleep(random(800,900));
- while(!theMenuFinder.isMenuUp()){
- mouseClickRight(bowRectangle);
- }
- theMenuFinder.doMenuContains("X");
- String text = "";
- while(text.equalsIgnoreCase("")){
- try{
- Interface temp = getInterfaceAtIndex(752,4);
- if(temp.isValid()){
- text = temp.getText();
- }
- } catch(IndexOutOfBoundsException e){}
- sleep(50);
- }
- enterCommand(KeyboardCommand.typeLettersFast(Thread.currentThread().getPriority(),Thread.currentThread(),Integer.toString(random(99,999))));
- SendKey(KeyEvent.VK_ENTER);
- while(theTabs.Inventory.count("ogs")> 4){
- sleep(100);
- }
- NPC banker = theWorldObjectFinder.findNPC(new String[]{"Bank Banker","chest"});
- try{
- XY bankercoordinates = banker.getRecommendPointToClick();
- mouseClickRight(bankercoordinates);
- theMenuFinder.doMenuContains("Bank Banker");
- theMenuFinder.doMenuContains("Chest");
- } catch (NullPointerException e){}
- waitForNoAnimation();
- }
- }
- void waitForNoAnimation() throws InterruptedException
- {
- while(theTabs.Inventory.count("ogs")>0){
- sleep(100);
- }
- while (getAnimation() == -1 && theTabs.Inventory.count("ogs") < 1) {
- NPC banker = theWorldObjectFinder.findNPC(new String[]{"Banker","Bank chest"});
- try{
- XY bankercoordinates = banker.getRecommendPointToClick();
- mouseMove(bankercoordinates);
- String d = theTopText.getTopText();
- if(d.contains("ank chest") || d.contains("anker"))
- {
- if(d.contains("Use")){
- mouseClickLeft(bankercoordinates);
- } else {
- mouseClickRight(bankercoordinates);
- while (!theMenuFinder.isMenuUp())
- sleep(500);
- }
- theMenuFinder.doMenu("Use-quickly");
- }
- } catch (NullPointerException e){}
- bowsFletched += theTabs.Inventory.count("bow");
- doBanking();
- }
- }
- private void doBanking() throws InterruptedException
- {
- String[] knifes = {"Knife"};
- theBank.doDepositAllBut(knifes);
- theBank.doWithDrawAll("ogs", true);
- theBank.exit();
- if (theTabs.Inventory.count("ogs") > 0) {
- fletchLogs();
- } else {
- doBanking();
- }
- }
- public void type(String toType) throws InterruptedException //Nightmares18
- {
- char[] chars = toType.toCharArray();
- for(int i = 0;i<chars.length;i++)
- {
- ScriptJob sj;
- if(i != chars.length-1)
- sj = new trueTypeLettersFast(this,String.valueOf(chars[i]));
- sleep(random(50,200));
- }
- }
- public class trueTypeLettersFast extends ScriptJob
- {
- String value = "";
- public trueTypeLettersFast(ColorSkeltonScriptable cs, String value)
- {
- super(cs);
- this.value = value;
- ColorSkeltonScriptable.addScriptJob(this);
- }
- @Override
- public void runV() throws InterruptedException
- {
- SendText(value);
- } //wheres the error?
- }
- public void paint(Graphics g)
- {
- //paint code here, such as g.drawRect...
- g.setColor(new java.awt.Color(255, 51, 51));
- g.fillRect(37, 43, 327, 104);
- g.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 22));
- g.setColor(new java.awt.Color(255, 255, 255));
- g.drawString("Bows fletched" +bowsFletched, 53, 89);
- }
- class fletcherGUI extends javax.swing.JFrame {
- /** Creates new form fletcherGUI */
- public fletcherGUI() {
- initComponents();
- }
- //public boolean longbow = false, shortbow = false, xbow = false;
- public boolean logboolean = false, oakboolean = false, willowboolean = false, mapleboolean = false, yewboolean = false, magicboolean = false; //add a =false to every one of them
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- jCheckBox4 = new javax.swing.JCheckBox();
- jCheckBox2 = new javax.swing.JCheckBox();
- jPanel1 = new javax.swing.JPanel();
- jButton1 = new javax.swing.JButton();
- jComboBox1 = new javax.swing.JComboBox();
- jLabel1 = new javax.swing.JLabel();
- jCheckBox5 = new javax.swing.JCheckBox();
- jCheckBox1 = new javax.swing.JCheckBox();
- jCheckBox3 = new javax.swing.JCheckBox();
- jCheckBox4.setText("Shaft");
- jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jCheckBox4ActionPerformed(evt);
- }
- });
- jCheckBox2.setText("Shortbow");
- jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jCheckBox2ActionPerformed(evt);
- }
- });
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
- jButton1.setText("Start");
- jButton1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton1ActionPerformed(evt);
- }
- });
- jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose bow:", "Log", "Oak", "Willow", "Maple", "Yew", "Magic" }));
- jComboBox1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jComboBox1ActionPerformed(evt);
- }
- });
- jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
- jLabel1.setText("FastFletcher");
- jCheckBox5.setText("Shortbow");
- jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jCheckBox5ActionPerformed(evt);
- }
- });
- jCheckBox1.setText("Longbow");
- jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jCheckBox1ActionPerformed(evt);
- }
- });
- jCheckBox3.setText("Crossbow");
- jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jCheckBox3ActionPerformed(evt);
- }
- });
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(102, Short.MAX_VALUE))
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jButton1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jCheckBox5)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(jCheckBox3)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jCheckBox1)))
- .addGap(16, 16, 16))
- );
- jPanel1Layout.setVerticalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jCheckBox3)
- .addComponent(jCheckBox1)
- .addComponent(jButton1))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jCheckBox5)
- .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(18, Short.MAX_VALUE))
- );
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- pack();
- }// </editor-fold>
- private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
- String a = jComboBox1.toString();
- if(a.contains("Log")) {
- logboolean = true;
- } else {
- logboolean = false;
- }
- if(a.contains("Oak")) {
- oakboolean = true; //repeat until done
- } else if (a.contains("Willow")) {
- willowboolean = true;
- } else if (a.contains("Maple")) {
- mapleboolean = true;
- } else if (a.contains("Yew")) {
- yewboolean = true; //Sto and dont click the "Insert" buttonk
- } else {
- magicboolean = true;
- }
- }
- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
- StartScript = true;
- }
- private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
- if(jCheckBox1.isSelected()) longbow = true;
- }
- private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {
- if(jCheckBox3.isSelected()) xbow = true;
- }
- private void jCheckBox4ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt) {
- if(jCheckBox5.isSelected()) shortbow = true;
- }
- public void main(String args[]) {
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new fletcherGUI().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton jButton1;
- private javax.swing.JCheckBox jCheckBox1;
- private javax.swing.JCheckBox jCheckBox2;
- private javax.swing.JCheckBox jCheckBox3;
- private javax.swing.JCheckBox jCheckBox4;
- private javax.swing.JCheckBox jCheckBox5;
- private javax.swing.JComboBox jComboBox1;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JPanel jPanel1;
- // End of variables declaration
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement