All pastes #515425 Raw Edit

Unnamed

public text v1 · immutable
#515425 ·published 2007-05-28 05:44 UTC
rendered paste body
import impsoft.nexus.bots.color.constants.Info;
import impsoft.nexus.bots.color.methods.ColorScript;
import impsoft.nexus.bots.color.scriptobjects.RGBCluster;
import impsoft.nexus.bots.color.scriptobjects.RGB;
import impsoft.nexus.bots.color.constants.*;
import impsoft.nexus.bots.color.methods.*;
import impsoft.nexus.bots.color.scriptobjects.RGBClusters.*;
import impsoft.nexus.bots.reflection.scriptobjects.walking.*;
import impsoft.nexus.bots.color.scriptobjects.*;
import java.awt.*;

public class lumbyflaxspinner extends ColorScript{

   public static double version = 1.0;
   public static String[] commands = new String[] {""};
   public String author = "Beezkneez";
   public String description = "Lumby Flaxer Spinner v1.0";


	private BankBooth lumbyBank;
	private RGB BankBoothCloseButton;


	//Declare tiles and paths.
	AryanTile Lumby_Bank = new AryanTile(3208, 3220, 1, this);
	AryanTile Bank_Stairs = new AryanTile(3205, 3209, 4, this);
	AryanTile Flax_Room = new AryanTile(3209, 3213, 3, this);
	AryanTile Flax_Stairs = new AryanTile(3205, 3209, 1, this);
	AryanPath bank = new AryanPath(new AryanTile[] {Lumby_Bank, Bank_Stairs}, this);
   private int randomClick(int start, int range) {

		if (random(0,1) == 0) // negative

			return start + random(-range, 0);

		return start + random(range, 0);

	}
   private long rsleep(int min, int max) throws InterruptedException {
		long time = random(min, max);
		sleep(time);
		return time;
	}

   public boolean doStart(String cmd, String[] args) throws InterruptedException {
	   lumbyBank = new BankBooth(new RGB[] {new RGB(119, 92, 56)}, this);
       return true;
   }

   public void script() throws InterruptedException {
       log("Starting Flax Spinner...");

       setTab(Info.TAB_INVENTORY);

			lumbyBank.openBankInterface();
			rsleep(200, 500);

		      while(isLoggedIn()){
		    	  WithdrawFlax();
				sleep(random(1000, 3000));
			}

   			}
  		private void WithdrawFlax() throws InterruptedException {
  			log("Withdrawing flax from bank.");
  			lumbyBank.openBankInterface();
  			sleep(random(1000, 2000));

  			Rectangle FirstBankSlot = new Rectangle(81, 63, 25, 25);
  			mouseMove(FirstBankSlot);
  			rsleep(300, 700);
  			if(getTopText().contains("Flax")) {
  				log("Withdrawing...");
  			} else {
  				log("You have no more flax. Turning off iBot.");
  				theBot.destroy();
  			}
  			sleep(random(1, 100));
  			mouseClickRight(currentMouseXY());
  			sleep(random(200, 1000));
  			getMenu(Areas.GAME, 2000).selectContains("ll");
  			sleep(random(200, 1000));

  			log("Closing bank.");
  			lumbyBank.closeBankInterface();
  			CloseBankInterface();
  		}



  		private void StoreStrings() throws InterruptedException {
  			log("Storing Completed Bow Strings.");
  			lumbyBank.openBankDepositAllBut(new String[] {""});
  			rsleep(500, 1000);
  			CloseBankInterface();
  		}
  		private void CloseBankInterface() throws InterruptedException {
  			if(getRGB(484, 38).r == BankBoothCloseButton.r) {
  				log("Bank booth is open, closing.");
  				lumbyBank.closeBankInterface();
  				rsleep(1000, 3000);
  			} else {
  				log("Bank booth is already closed.");
  			}
  		}
  		private RGB GetBankCloseButtonColour() throws InterruptedException {
  			return getRGB(484, 38);
  		}

  			private void DepositAndWithdraw() throws InterruptedException {
  				StoreStrings();
  				WithdrawFlax();
  			}

   }