Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.sun.org.apache.bcel.internal.generic.GOTO;
- import org.osbot.rs07.api.GrandExchange;
- import org.osbot.rs07.api.model.Entity;
- import org.osbot.rs07.api.model.Item;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.api.ui.Skill;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import java.awt.*;
- import static com.sun.activation.registries.LogSupport.log;
- @ScriptManifest(author = "Impensus", info = "A Progressive Grand Exchange Fletcher", name = "Progressive GE Fletcher22", version = 1.0, logo = "")
- public class Main extends Script {
- private String LogName;
- private String knifename;
- private String toMakeInv;
- @Override
- public void onStart() {
- log("Welcome to my Progressive GE Fletcher.");
- this.knifename = "Knife";
- }
- private enum State {
- SHAFTS, SHORTBOWS, LONGBOWS, OAKSHORT, OAKLONG, WILLOWSHORT, WILLOWLONG, MAPLESHORT, MAPLELONG, BANK, GOLDFARM,
- }
- private State getState() {
- if (skills.getDynamic(Skill.FLETCHING) >= 1 && skills.getDynamic(Skill.FLETCHING) < 5)
- return State.SHAFTS;
- if (skills.getDynamic(Skill.FLETCHING) >= 5 && skills.getDynamic(Skill.FLETCHING) < 10)
- return State.SHORTBOWS;
- if (skills.getDynamic(Skill.FLETCHING) >= 10 && skills.getDynamic(Skill.FLETCHING) < 20)
- return State.LONGBOWS;
- if (skills.getDynamic(Skill.FLETCHING) >= 20 && skills.getDynamic(Skill.FLETCHING) < 25)
- return State.OAKSHORT;
- if (skills.getDynamic(Skill.FLETCHING) >= 25 && skills.getDynamic(Skill.FLETCHING) < 35)
- return State.OAKLONG;
- if (skills.getDynamic(Skill.FLETCHING) >= 35 && skills.getDynamic(Skill.FLETCHING) < 40)
- return State.WILLOWSHORT;
- if (skills.getDynamic(Skill.FLETCHING) >= 40 && skills.getDynamic(Skill.FLETCHING) < 50)
- return State.WILLOWLONG;
- if (skills.getDynamic(Skill.FLETCHING) >= 50 && skills.getDynamic(Skill.FLETCHING) < 55)
- return State.MAPLESHORT;
- if (skills.getDynamic(Skill.FLETCHING) >= 55)
- return State.GOLDFARM;
- return State.BANK;
- }
- @Override
- public int onLoop() throws InterruptedException {
- switch (getState()) {
- case SHAFTS:
- this.LogName = "Logs";
- this.toMakeInv = "Arrow Shaft";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Arrow Shaft", 405);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Logs");
- sleep(random(440, 1230));
- widgets.interact(270, 14, "Make");
- sleep(random(440, 1230));
- }
- }
- case SHORTBOWS:
- this.LogName = "Logs";
- this.toMakeInv = "Shortbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Shortbow (u)", 27);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Logs");
- sleep(random(440, 1230));
- widgets.interact(270, 16, "Make");
- sleep(random(440, 1230));
- }
- }
- break;
- case LONGBOWS:
- this.LogName = "Logs";
- this.toMakeInv = "Longbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Longbow (u)", 27);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Logs");
- sleep(random(440, 1230));
- widgets.interact(270, 17, "Make");
- sleep(random(440, 1230));
- }
- }
- break;
- case OAKSHORT:
- this.LogName = "Oak logs";
- this.toMakeInv = "Oak Shortbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Oak logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Oak logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Oak shortbow (u)", 27);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Oak logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Oak logs");
- sleep(random(440, 1230));
- widgets.interact(270, 15, "Make");
- sleep(random(440, 1230));
- }
- }
- break;
- case OAKLONG:
- this.LogName = "Oak logs";
- this.toMakeInv = "Oak Longbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Oak logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Oak logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Oak longbow (u)", 27);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Oak logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Oak logs");
- sleep(random(440, 1230));
- widgets.interact(270, 16, "Make");
- sleep(random(440, 1230));
- }
- }
- break;
- case WILLOWSHORT:
- this.LogName = "Willow logs";
- this.toMakeInv = "Willow shortbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Knife"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- if (!getBank().contains("Willow logs")) ;
- logoutTab.logOut();
- sleep(500);
- stop(true);
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Willow logs", 27);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Willow shortbow (u)", 27);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Willow logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Willow logs");
- sleep(random(440, 1230));
- widgets.interact(270, 15, "Make");
- sleep(random(440, 1230));
- }
- }
- break;
- case WILLOWLONG:
- this.LogName = "Willow logs";
- this.toMakeInv = "Willow longbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Willow logs"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(1500);
- if (!getBank().contains("Willow logs")) {
- logoutTab.logOut();
- sleep(500);
- stop(true);
- }
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Willow logs", 27);
- getBank().close();
- sleep(1500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Willow longbow (u)", 27);
- sleep(500);
- }
- }
- if (getInventory().contains("Willow logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(740, 1230));
- getInventory().interact("Use", "Willow logs");
- sleep(random(640, 1230));
- widgets.interact(270, 16, "Make");
- sleep(random(740, 1230));
- }
- }
- break;
- case MAPLESHORT:
- this.LogName = "Maple logs";
- this.toMakeInv = "Maple shortbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Maple logs"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(1500);
- if (!getBank().contains("Maple logs")) {
- logoutTab.logOut();
- sleep(500);
- stop(true);
- }
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Maple logs", 27);
- getBank().close();
- sleep(1500);
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Maple shortbow (u)", 27);
- sleep(500);
- }
- }
- if (getInventory().contains("Maple logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(740, 1230));
- getInventory().interact("Use", "Maple logs");
- sleep(random(640, 1230));
- widgets.interact(270, 15, "Make");
- sleep(random(740, 1230));
- }
- }
- }
- break;
- case MAPLELONG:
- this.LogName = "Maple logs";
- this.toMakeInv = "Maple longbow (u)";
- if (inventory.isEmpty() || (!inventory.contains("Maple logs"))) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(1500);
- if (!getBank().contains("Maple logs")) {
- logoutTab.logOut();
- sleep(500);
- stop(true);
- }
- } else {
- getBank().withdraw("Knife", 1);
- getBank().withdraw("Maple logs", 27);
- getBank().close();
- sleep(1500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Maple longbow (u)", 27);
- sleep(500);
- }
- }
- if (getInventory().contains("Maple logs") && getInventory().contains("Knife")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Knife");
- sleep(random(740, 1230));
- getInventory().interact("Use", "Maple logs");
- sleep(random(640, 1230));
- widgets.interact(270, 16, "Make");
- sleep(random(740, 1230));
- }
- }
- break;
- case GOLDFARM:
- if (skills.getDynamic(Skill.FLETCHING) >= 55 && skills.getDynamic(Skill.FLETCHING) < 65) {
- this.LogName = "Bow string";
- this.toMakeInv = "Maple longbow";
- if (inventory.isEmpty()) {
- log("Materials not found, Banking");
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- }
- if (!getBank().contains("Bow string") && (!getBank().contains("Maple longbow (u)"))) {
- getBank().depositAll();
- sleep(random(240, 532));
- getBank().withdrawAllButOne("Coins");
- sleep(random(240, 1637));
- getBank().close();
- sleep(random(240, 832));
- long money = getInventory().getAmount("Coins");
- ItemResource BowString = new ItemResource("Bow String", 1777);
- ItemResource MapleLong = new ItemResource("Maple Longbow (u)", 62);
- String BowStringConvertor = BowString.toString();
- int BowStringPrice = Integer.parseInt(BowStringConvertor);
- String UnstrungConverter = MapleLong.toString();
- int UnstrungPrice = Integer.parseInt(UnstrungConverter);
- long AmountAffordBowstring = money - 100_000 / BowStringPrice;
- long AmountAffordUnstrung = money - 100_000 / UnstrungPrice;
- long amountToBuyStrings = AmountAffordBowstring / 2;
- long amountToBuyUnstrung = AmountAffordUnstrung / 2;
- Math.round(amountToBuyStrings);
- Math.round(amountToBuyUnstrung);
- if (!grandExchange.isOpen()) {
- int stringamount = (int) amountToBuyStrings;
- int unstrungamount = (int) amountToBuyUnstrung;
- npcs.closest("Grand Exchange Clerk").interact("Exchange");
- grandExchange.buyItem(1777, "Bow String", BowStringPrice, stringamount);
- sleep(500);
- grandExchange.buyItem(62, "Maple Longbow (u)", UnstrungPrice, unstrungamount);
- sleep(random(15_000, 35_000));
- if (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.FINISHED_BUY && (grandExchange.getStatus(GrandExchange.Box.BOX_2) == GrandExchange.Status.FINISHED_BUY)) {
- getGrandExchange().collect();
- grandExchange.close();
- sleep(random(240, 832));
- getBank().open();
- sleep(random(240, 832));
- getBank().depositAll();
- sleep(random(240, 832));
- getBank().close();
- }
- } else {
- getBank().withdraw("Bow String", 14);
- getBank().withdraw("Maple longbow (u)", 14);
- getBank().close();
- sleep(500);
- }
- }
- if (inventory.contains(this.toMakeInv) && (!inventory.contains(this.LogName))) {
- if (!getBank().isOpen()) {
- getBank().open();
- sleep(500);
- } else {
- getBank().deposit("Maple longbow", 14);
- sleep(500);
- getBank().close();
- }
- }
- if (getInventory().contains("Maple longbow (u)") && getInventory().contains("Bow string")) {
- if (myPlayer().isAnimating()) {
- log("Fletching");
- sleep(5000);
- } else {
- inventory.interact("Use", "Bow String");
- sleep(random(440, 1230));
- getInventory().interact("Use", "Maple longbow (u)");
- sleep(random(440, 1230));
- widgets.interact(270, 16, "Make");
- sleep(random(440, 1230));
- }
- }
- }
- return random(200, 300);
- }
- }
- return random(200, 300);
- }
- @Override
- public void onExit () {
- log("Thanks for running my Tea Thiever!"); }
- @Override
- public void onPaint (Graphics2D g){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement