Jump to content

whipz

Members
  • Posts

    780
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by whipz

  1. Theres no error it just doesnt do anything its like my code is empty
  2. Hey guys; I was slowly updating my beef slave script; which used to run just fine other than bugs(which is why i rewrote some of it) but now it shows up in script selector but doesnt actually run you click it and nothing happens; Could you have a quick look over and see if i have completely missed something ? also if you have any feedback on what else I can do to make this run more smoothly dont hesitate to tell me ! as i want to learn more ! thanks heres the code import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Whipz", info = "Beef Slave Picks up stuff from cowpaddock", logo = "", name = "beefSlave", version = 1) public class main extends Script { // Areas Area cowArea = new Area(new int[][] { { 3253, 3253 }, { 3265, 3253 }, { 3265, 3255 }, { 3265, 3260 }, { 3265, 3297 }, { 3264, 3299 }, { 3262, 3299 }, { 3261, 3300 }, { 3259, 3300 }, { 3257, 3300 }, { 3256, 3299 }, { 3241, 3299 }, { 3240, 3298 }, { 3240, 3295 }, { 3240, 3287 }, { 3240, 3284 } }); Area lumbyBankArea = new Area(new int[][] { { 3210, 3221, 2 }, { 3207, 3217, 2 } }); // Paint @SuppressWarnings("unused") private long startTime; // Player to trade @SuppressWarnings("unchecked") Player muleAccount = getPlayers() .closest(o -> o.getName().replaceAll("\\u00a0", " ").equalsIgnoreCase("InsertNameHere")); private enum State { PICKUP, WALKTOBANK, BANK, GETNOTEDITEMS, TRADEMULE, OFFERITEMS, ACCEPTTRADE, ACCEPTTRADE2, WALKTOPICKUP, WAIT } private State getState() { if (!inventory.isFull() && cowArea.contains(myPlayer())) return State.PICKUP; if (inventory.isFull() && !lumbyBankArea.contains(myPlayer())) return State.WALKTOBANK; if (muleAccount != null && muleAccount.isVisible() && lumbyBankArea.contains(myPlayer())) return State.GETNOTEDITEMS; if (muleAccount == null && inventory.isFull() && lumbyBankArea.contains(myPlayer())) return State.BANK; if (inventory.contains(2133, 1740) && lumbyBankArea.contains(myPlayer())) return State.TRADEMULE; if (inventory.contains(2133, 1740) && trade.isFirstInterfaceOpen()) return State.OFFERITEMS; if (trade.getOurOffers().contains("Raw beef", "Cowhide") && trade.isFirstInterfaceOpen()) return State.ACCEPTTRADE; if (trade.isSecondInterfaceOpen() && trade.isCurrentlyTrading()) return State.ACCEPTTRADE2; if (!inventory.isFull() && !bank.isOpen() && !trade.isCurrentlyTrading() && !cowArea.contains(myPlayer())) return State.WALKTOPICKUP; return State.WAIT; } public void onStart() throws InterruptedException { startTime = System.currentTimeMillis(); log("Welcome to beef slave"); log("This is a quick money making method"); log("Please post errors to thread"); } @Override public int onLoop() throws InterruptedException { switch (getState()) { case PICKUP: doPickUp(); break; case WALKTOBANK: log("Walking to bank"); getWalking().webWalk(lumbyBankArea); break; case GETNOTEDITEMS: getNotedItems(); break; case BANK: doBank(); break; case TRADEMULE: tradeMule(); break; case OFFERITEMS: offerItems(); break; case ACCEPTTRADE: acceptTrade1(); break; case ACCEPTTRADE2: acceptTrade2(); break; case WALKTOPICKUP: log("Walking to CowArea"); getWalking().webWalk(cowArea); break; case WAIT: break; } return random(300, 500); } private void doPickUp() throws InterruptedException { GroundItem loot = getGroundItems().closest("Raw beef", "Cowhide"); if (!inventory.isFull() && cowArea.contains(myPlayer()) && (loot != null) && !myPlayer().isAnimating()) { loot.interact("Take"); log("Picking up Raw Beef or Cowhide"); sleep(random(750, 1500)); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isMoving(); } }.sleep(); } } private void getNotedItems() throws InterruptedException { NPC closestBanker = getNpcs().closest("Banker"); Entity closestBankBooth = objects.closest("Bank Booth"); if (bank.isOpen()) { if (inventory.isEmpty()) { if (getBank().getWithdrawMode().equals(Bank.BankMode.WITHDRAW_NOTE)) { log("Withdrawing Noted Beef & CowHide"); getBank().withdrawAll("Raw beef"); getBank().withdrawAll("Cowhide"); sleep(random(750, 1500)); bank.close(); sleep(random(750, 1500)); } else { log("changing to withdraw note mode"); bank.enableMode(Bank.BankMode.WITHDRAW_NOTE); sleep(random(750, 1500)); } } else { bank.depositAll(); } sleep(random(1000, 2500)); } else { int rand = random(3); if (rand == 1) { closestBankBooth.interact("Bank"); log("Using Bank Booth"); sleep(random(750, 1500)); } else { closestBanker.interact("Bank"); log("Using NPC Banker"); sleep(random(750, 1500)); } sleep(random(1000, 2500)); log("Opening Bank"); } } private void doBank() throws InterruptedException { NPC closestBanker = getNpcs().closest("Banker"); Entity closestBankBooth = objects.closest("Bank Booth"); if (bank.isOpen()) { if (!inventory.isEmpty()) { bank.depositAll(); } sleep(random(1000, 2500)); } else { int rand = random(3); if (rand == 1) { closestBankBooth.interact("Bank"); log("Using Bank Booth"); sleep(random(750, 1500)); } else { closestBanker.interact("Bank"); log("Using NPC Banker"); sleep(random(750, 1500)); } sleep(random(1000, 2500)); log("Opening Bank"); } } private void tradeMule() throws InterruptedException { if (muleAccount != null && muleAccount.isVisible() && lumbyBankArea.contains(myPlayer()) && inventory.contains(2133, 1740)) { log("Trying to trade mule"); if (muleAccount.interact("Trade with")) { sleep(random(750, 1500)); log("Waiting to be in trade menu"); } new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return trade.isFirstInterfaceOpen(); } }.sleep(); } } private void offerItems() throws InterruptedException { if (trade.isFirstInterfaceOpen() && trade.isCurrentlyTrading()) { log("Offering Loot"); getInventory().getItem("Raw beef").interact("Offer-All"); if (inventory.contains("Cowhide")) { getInventory().getItem("Cowhide").interact("Offer-All"); } else { sleep(random(750, 1000)); } sleep(random(750, 1500)); new ConditionalSleep(20000) { @Override public boolean condition() throws InterruptedException { return trade.getOurOffers().contains("Raw beef", "Cowhide"); } }.sleep(); } } private void acceptTrade1() throws InterruptedException { if (trade.isFirstInterfaceOpen() && trade.getOurOffers().contains("Raw beef", "Cowhide")) { trade.acceptTrade(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return trade.isSecondInterfaceOpen(); } }.sleep(); } } private void acceptTrade2() throws InterruptedException { if(trade.isSecondInterfaceOpen()) { sleep(random(500, 1500)); trade.acceptTrade(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return !trade.isCurrentlyTrading(); } }.sleep(); } } public void onExit() { log("Thanks for using beef Slave"); } }
  3. Good luck with the rest of it ! your my idol xD
  4. Do you find that members makes your account last longer ?
  5. Thats a bit of a kick to the stomach lol
  6. Will they ever stop lol
  7. Looks good (: cant wait till its a little more advanced !
  8. hasnt it been around 2.3 m for weeks ?
  9. haha heavy days ): its like that on every f2p world tho haha fucking bots everywhere xD
  10. Thanks mate appreciate it sorry went afk on chat
  11. Player muleAccount = getPlayers().closest(o -> o.getName().replaceAll("\\u00a0", " ").equalsIgnoreCase("Insert your UserName")); give this error Multiple markers at this line - o cannot be resolved - Syntax error on token "-", -- expected - o cannot be resolved - o cannot be resolved to a variable - o cannot be resolved to a variable any ideas ?
  12. I have uninstalled all other versions of java and jdk, and yet I still cant get 1.8 to work with my eclipse; is there another way ? if not looks like im going to have format -.- Player muleAccount = getPlayers().closest(o --> o.getName().replaceAll("\\u00a0", " ").equalsIgnoreCase("Insert your UserName")); On this line still getting this error Multiple markers at this line - o cannot be resolved to a variable - o cannot be resolved - o cannot be resolved to a variable - o cannot be resolved
  13. I did that but when I did it the way the guy at the top said It said I have 1.5 ? even though i did what was suggested by the guy underneath i still have the error? is it just better to get rid of all old javas ?
  14. yeah man eclipse; How can i tell what java eclipse is running ? as I need a lower lvl java for another application on my computer and it hasnt been updated; however i have both. EVERYONE QUICK THE MISSES IS COOKING HELP WHILE I HAVE 15 mins HAHAHAHAH *as she reads over my should cooking next to me hahaa
  15. OMG thanks mate; I have been looking for something like that for so long ! Thanks so much mate; Ill get on to adding that and ill update my top post; Like i keep saying this script will be permanently so people can learn; I will go threw and add //comments once its fully functional Hey mate; I am now getting this error ? o cannot be resolved to a variable
  16. Doing what you suggested I will update in the morning misses is angry I have been on computer to much today hahaha night guys keep you updated tomorrow
  17. Hey guys; Sorry to keep posting new threads this will be the last thread; I thought I might as well post it all so everyone can learn as there isnt to many open source scripts; I will keep this one open source but will not be adding anything else to the script as I just wanted to learn a few features for other scripts I want to release to the community; I mainly made this script to test my cooking script which is finished I just have nothing to cook with lol. Its an AIO that supports lumby falador edgeville and alkharid which will also be released on SDN as soon as i can finish testing it; which is why i need this script finished lol Everything works now; So mainly looking for feedback on how to improve this script; I will add a GUI within the day or so ! As i said this script will remain open source and free obviously as its open source ! Going over the script in the next few days to add comments to make it easier for someone to learn off; here is the code so far: import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Whipz", info = "Picks up Beef and trades to a Mule", logo = "", name = "BeefMule", version = 0.1) public class main extends Script { Area cowArea = new Area( new int[][]{ { 3253, 3255 }, { 3265, 3255 }, { 3265, 3296 }, { 3263, 3298 }, { 3260, 3299 }, { 3257, 3299 }, { 3256, 3298 }, { 3241, 3298 }, { 3240, 3296 }, { 3241, 3295 }, { 3241, 3294 }, { 3242, 3293 }, { 3242, 3292 }, { 3242, 3290 }, { 3242, 3288 }, { 3241, 3287 }, { 3241, 3286 }, { 3241, 3284 }, { 3242, 3283 }, { 3243, 3282 }, { 3244, 3281 }, { 3245, 3280 }, { 3246, 3278 }, { 3247, 3278 }, { 3248, 3278 }, { 3249, 3278 }, { 3250, 3278 }, { 3251, 3276 }, { 3253, 3272 } } ); Area muleArea = new Area(3265, 3173, 3272, 3161); private enum State { PICKUP, WALKTOMULE, TRADE, WALKTOPICKUP, BANK, STOP, WAIT }; private State getState() { if (!inventory.isFull() && cowArea.contains(myPlayer())) return State.PICKUP; if (inventory.isFull() && !muleArea.contains(myPlayer())) return State.WALKTOMULE; if(inventory.contains(2132, 1739) || bank.contains("Raw beef", "Cowhide") && muleArea.contains(myPlayer())) return State.BANK; if(inventory.contains(2133, 1740) || trade.isCurrentlyTrading() && muleArea.contains(myPlayer())) return State.TRADE; if (!inventory.isFull() && !bank.isOpen() && !bank.contains("Raw beef") && !cowArea.contains(myPlayer())) return State.WALKTOPICKUP; return State.WAIT; } public void onStart() throws InterruptedException { } public void onExit() { log("Thanks for using beefMule"); } @[member=Override] public int onLoop() throws InterruptedException { switch (getState()) { case PICKUP: doPickUp(); break; case WALKTOMULE: getWalking().webWalk(muleArea); break; case BANK: getNotedItems(); break; case TRADE: tradeMule(); offerItems(); acceptTrade1(); acceptTrade2(); break; case WALKTOPICKUP: getWalking().webWalk(cowArea); break; case STOP: this.stop(); break; case WAIT: sleep(random(200, 300)); break; } return random(200, 300); } private void doPickUp() throws InterruptedException { GroundItem loot = getGroundItems().closest("Raw beef", "Cowhide"); if (!inventory.isFull() && cowArea.contains(myPlayer()) && (loot != null) && !myPlayer().isAnimating()) { loot.interact("Take"); log("Picking up Raw Beef"); sleep(random(750, 1500)); new ConditionalSleep(5000) { @[member=Override] public boolean condition() throws InterruptedException { return !myPlayer().isMoving(); } }.sleep(); } } private void tradeMule() throws InterruptedException { @SuppressWarnings("unchecked") Player muleAccount = getPlayers().closest(o -> o.getName().replaceAll("\\u00a0", " ").equalsIgnoreCase("FlippingGold")); if (muleAccount != null && muleAccount.isVisible() && muleArea.contains(myPlayer()) && inventory.contains("Raw beef")) { log("Trying to trade mule"); if(muleAccount.interact("Trade with")){ log("Waiting for other player to accept trade"); } sleep(random(750, 1500)); new ConditionalSleep(5000) { @[member=Override] public boolean condition() throws InterruptedException { return trade.isFirstInterfaceOpen(); } }.sleep(); } } private void offerItems() throws InterruptedException { if(trade.isFirstInterfaceOpen() && trade.isCurrentlyTrading()) { log("Offering Loot"); getInventory().getItem("Raw beef").interact("Offer-All"); getInventory().getItem("Cowhide").interact("Offer-All"); sleep(random(750, 1500)); new ConditionalSleep(5000) { @[member=Override] public boolean condition() throws InterruptedException { return trade.getOurOffers().toString() == "Raw beef"; } }.sleep(); } } private void acceptTrade1() throws InterruptedException { if(trade.isFirstInterfaceOpen()) { trade.acceptTrade(); new ConditionalSleep(5000) { @[member=Override] public boolean condition() throws InterruptedException { return trade.isSecondInterfaceOpen(); } }.sleep(); } } private void acceptTrade2() { if(trade.isSecondInterfaceOpen()) { trade.acceptTrade(); new ConditionalSleep(5000) { @[member=Override] public boolean condition() throws InterruptedException { return !trade.isCurrentlyTrading(); } }.sleep(); } } private void getNotedItems() throws InterruptedException { NPC closestBanker = getNpcs().closest("Banker"); Entity closestBankBooth = objects.closest("Bank Booth"); if (bank.isOpen()) { if(inventory.isEmpty()) { if (getBank().getWithdrawMode().equals( Bank.BankMode.WITHDRAW_NOTE)) { getBank().withdrawAll("Raw beef"); getBank().withdrawAll("Cowhide"); sleep(random(750, 1500)); bank.close(); log("Withdrawing Noted Beef"); sleep(random(750, 1500)); } else { bank.enableMode(Bank.BankMode.WITHDRAW_NOTE); log("changing to withdraw note mode"); sleep(random(750, 1500)); } } else { bank.depositAll(); } sleep(random(1000, 2500)); } else { int rand = random(3); if (rand == 1) { closestBankBooth.interact("Bank"); log("Using Bank Booth"); sleep(random(750, 1500)); } else { closestBanker.interact("Bank"); log("Using NPC Banker"); sleep(random(750, 1500)); } sleep(random(1000, 2500)); log("Opening Bank"); } } } So any help is appreciated thanks to everyone who has helped so far;
  18. I thought that was what you ment; wasnt sure if you wanted me to make another state to check bank haha sorry all new to this stuff; been a long time last time i did it we used nodes; im testing it now (: if (!inventory.isFull() && !bank.isOpen() && !bank.contains("Raw beef") && !cowArea.contains(myPlayer())) return State.WALKTOPICKUP; So I have done this now; and now it just sits at the bank with it open; can close opened new thread open sourced
×
×
  • Create New...