Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.Woodcutter;
- import org.tribot.api.input.Keyboard;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.WebWalking;
- import org.tribot.api2007.types.RSInterfaceChild;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.script.Script;
- public class Fletcher extends Script {
- public static RSItem[] Logs;
- public RSItem[] knife = Inventory.find("Knife");
- public int FlaxCount;
- public int AmountToPick;
- public static boolean PickFlax = false;
- public static boolean WeWantToFletch = false;
- public boolean WeFletchedThem = false;
- public static int LogCount;
- public Fletcher() {
- Fletch();
- }
- private void Fletch() {
- Flax();
- CutLogs();
- }
- private void CutLogs() {
- sleep(300, 2104);
- while(WeNeedToFletch())
- if(WeCanFletch())
- if(NotFletching())
- { KnifeToLog();
- if(MakeXisUp())
- { Keyboard.typeSend("28");
- WeFletchedThem = true;
- sleep(1000, 3000); }
- StringBows(); }
- }
- private boolean WeCanFletch() {
- if(Logs.length > 20 && Inventory.find("Knife").length > 0)
- return true;
- else {
- GetSupplies();
- if(WeCanFletch())
- return true;
- else return false;
- }
- }
- private void GetSupplies() {
- while(!AtBank())
- { WebWalking.walkToBank();
- sleep(300); }
- Banking.openBank();
- Banking.depositAll();
- if(Inventory.find("Knife").length == 0)
- Banking.withdraw(1, "Knife");
- if(Logs.length <= 20)
- Banking.withdraw(27, Chopper.LogType);
- }
- private boolean AtBank() {
- for(int x = 0; x <= BankSquares.length - 1; x++)
- for(int y = 0; y <= BankLocations; y++)
- if(BankTile[x][y].isOnScreen)
- return true;
- }
- private void Flax() { //have to change GUI to get these values
- while(PickFlax && FlaxCount < AmountToPick)
- { GetToFlaxField();
- PickFlax();
- GetToStringRoom();
- StringFlax();
- BankFlax();
- FlaxCount += AmountToPick;}
- }
- private void BankFlax() {
- WebWalking.walkToBank();
- Banking.depositAllExcept("Knife");
- }
- private void StringFlax() {
- // TODO Auto-generated method stub
- }
- private void GetToStringRoom() {
- // TODO Auto-generated method stub
- }
- private void PickFlax() {
- // TODO Auto-generated method stub
- }
- private void GetToFlaxField() {
- // TODO Auto-generated method stub
- }
- private boolean WeNeedToString() {
- if(Chopper.StringBows && WeFletchedThem)
- return true; else return false;
- }
- private void StringBows() {
- if(WeNeedToString())
- { GetBowStrings();
- AttachThemToBow(); }
- }
- private void AttachThemToBow() {
- WeFletchedThem = false;
- }
- private void GetBowStrings() {
- // TODO Auto-generated method stub
- }
- private boolean NotFletching() {
- for(int x = 0; x <= 5; x++)
- { sleep(100);
- if(Player.getAnimation() == 1248)
- return true; }
- return false;
- }
- static boolean WeNeedToFletch() {
- if(LogCount > 27 && WeWantToFletch) return true;
- else return false;
- }
- private boolean MakeXisUp() {
- if(Interfaces.isInterfaceValid(304)) //make x screen
- { RSInterfaceChild shortbow = Interfaces.get(304, 8);
- shortbow.click("Make X");
- sleep(1000, 3000);
- if(Interfaces.isInterfaceValid(137)) return true;
- else return false; }
- return false;
- }
- private void KnifeToLog() {
- if(Logs.length > 0)
- { knife[0].click();
- sleep(140, 840);
- Logs[0].click();
- sleep(2000, 4000); }
- }
- @Override
- public void run() {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment