Jump to content

Imthabawse

Members
  • Posts

    278
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Imthabawse

  1. @HeyImJamie Implemented you're suggestion into another project simple iron miner. Thanks again for the feedback! Code: private void bank() { if (Banks.VARROCK_EAST.contains(myPlayer())) { RS2Object banker = getObjects().closest("Bank booth"); log("In bank.. getting closest banker."); if (banker != null) { banker.interact("Bank"); log("Banking.."); new ConditionalSleep(2000) { @Override public boolean condition() { return bank.isOpen() && getInventory().isEmpty(); } }.sleep(); } if (bank.isOpen()) { bank.depositAll(); } } else { if (!Banks.VARROCK_EAST.contains(myPlayer())) { getWalking().webWalk(Banks.VARROCK_EAST); log("Not in bank.. walking there."); } } } private void mineIron() { if (ironArea.contains(myPlayer())) { if (!myPlayer().isAnimating()) { if (!myPlayer().isMoving()) { if (!getInventory().isFull()) { RS2Object ironore = getObjects().closest(7488); log("Getting closest iron ore."); if (ironore != null) { ironore.interact("Mine"); log("Mining.."); new ConditionalSleep(2000) { @Override public boolean condition() { return ironore.exists() && !myPlayer().isAnimating(); } }.sleep(); } } } } }else{ if(!ironArea.contains(myPlayer())) { getWalking().webWalk(ironArea); log("Walking to mining area.."); } } } @Override public int onLoop() { if(getInventory().isFull()) { bank(); }else{ mineIron(); } return 1500; } }
  2. Also realizing a path would be ideal in this situation since it's an A to B scenario. Webwalker like's to take some wild paths sometimes lol.
  3. @HeyImJamie my question was why the else if's and else wasn't working the way it should (well in my head anyway :P) You cleared that up for me though lol so thanks.
  4. Made a simple clay miner that mines clay and banks. Running into issues in the onLoop() when using else if's and else. To me when I read it, it makes sense to me but the bot just sits there. When I remove else if's and else works fine. Confused ? Any suggestions ?? Code I have now: import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(name = "Clay", logo = "", version = 1, author = "Imthabawse", info = "Mines clay and banks") public class Clay extends Script { private Area bankArea = new Area(3185, 3437, 3184, 3436); private Area clayArea = new Area(3179, 3370, 3181, 3372); private void bank() { RS2Object bankbooth = getObjects().closest("Bank booth"); if (bankbooth != null) { bankbooth.interact("Bank"); log("Banking.."); new ConditionalSleep(2500) { @Override public boolean condition() { return bank.isOpen(); } }.sleep(); } if (bank.isOpen()) { bank.depositAll(); log("Depositing clay.."); } } private void mineClay() { RS2Object clay = getObjects().closest(7454, 7487); if (!myPlayer().isAnimating()) { if (!getInventory().isFull()) if (clay != null) { clay.interact("Mine"); log("Mining clay.."); new ConditionalSleep(2500) { @Override public boolean condition() { return clay.exists() && !getInventory().isFull(); } }.sleep(); } } } @Override public int onLoop() { if (clayArea.contains(myPlayer())) { mineClay(); } if (!clayArea.contains(myPlayer())) { * had an else if here getWalking().webWalk(clayArea); mineClay(); *had an else here } if (getInventory().isFull()) { if (bankArea.contains(myPlayer())) { bank(); } if (!bankArea.contains(myPlayer())) { *had an else if here getWalking().webWalk(bankArea); bank(); } } return 1500; } }
  5. Been botting my main on n off gained numerous levels over many skills. It all boils down to botting smart. * Don't bot for stupid amounts of hours on just one skill, especially something like Agility for example * Try to "Babysit" your bot when possible because even the best of scripts can break and leave your bot randomly clicking or doing something un-human like for hours leading to a quick ban * Don't make an account do a couple quests and gain a few levels and think "Well now I can go run my mining script for 3 hours and get some quick gains!" You will most likely be banned all the same as a fresh level 3 Not saying I'm a botting expert this is just all personal experience. My point is bot in moderation. Take breaks. Don't rush levels, switch skills up, and reap the benefits in the end. Also I've only ever used Stealth Injection Hope this helps!
  6. @Xx pk xX Thanks for the feedback!
  7. Added to the eatFood method with an else to logout for now. else { if (!getInventory().contains("Lobster", "Tuna", "Swordfish")) { log("No food stopping script.."); stop(); } }
  8. Title says it all. Grab you're gear and select between 3 foods: Tuna, Lobsters, or Swordfish. Still working on banking method. Just messing around on pure account trying out random scripts. The scripts cluttered with IF's but for me and my low level of script knowledge it's easier to understand and also works. With that being said always looking for feedback, love the community discussion and how everyone's getting more involved and curious about scripting like myself. Thanks for the read. CODE: *Edited (Added banking support) looking into teleing to lumby then banking instead of walking if required level to tele and have runes import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(name = "Frogkiller", logo = "", version = 1, author = "Imthabawse", info = "Slaughters frogs for gains!") public class Frogkiller extends Script { private void killFrog() { if (!myPlayer().isAnimating()) { if (!myPlayer().isUnderAttack()) { NPC giantfrog = getNpcs().closest("Giant frog", "Big frog"); if (giantfrog != null) { if (giantfrog.getHealthPercent() > 10) { giantfrog.interact("Attack"); log("Slaughter time!"); new ConditionalSleep(5000) { @Override public boolean condition() { return myPlayer().isUnderAttack(); } }.sleep(); } } } } } private void eatFood() { if (myPlayer().getHealthPercent() < 48) { if(getInventory().contains("Tuna")) { log("Damn frogs fked me up.. let's eat!"); getInventory().interact("Eat", "Tuna", "Lobster", "Swordfish"); } } } private void bank() throws InterruptedException { if(getInventory().isEmptyExcept("Air rune","Earth rune")) { log("Inventory contains no food, banking."); getWalking().webWalk(Banks.LUMBRIDGE_UPPER); getBank().open(); bank.withdrawAll("Tuna"); new ConditionalSleep(2500) { @Override public boolean condition() { return getInventory().isFull(); } }.sleep(); } } private Area killArea = new Area(3186, 3187, 3209, 3160); @Override public void onStart() { log("Let's kill some frogs!"); } @Override public int onLoop() throws InterruptedException { if(!killArea.contains(myPlayer())) { log("Not in kill area.. lets get there and slaughter more frogs!"); getWalking().webWalk(killArea); }else { if (killArea.contains(myPlayer())) { killFrog(); eatFood(); bank(); } } return 1200; } }
  9. Gaining levels like: https://imgur.com/vDMdxX6
  10. @HeyImJamie and @redeems now now children this is for educational purposes not pointing out each others wrong doings ? Also me:
  11. @redeems Well I appreciate the feedback nonetheless and i'll have to give you're method a try. Also I use getMouse().moveOutsideScreen(); with Afk tasks like fishing cause most people click on the fishing spot then scroll over to Youtube or w\e else. Just seems more realistic to me.
  12. @redeems Thanks for the input but.. I fail to see how what you wrote is better. Seems to be just about the same as what I wrote just in a different way. Either way script is doing it's intended tasks.
  13. @redeems Good point would be a lot less clutter. Also added getWalking().webWalk(area); So if it can't see the area it'll run there. Edit: Added @redeems suggestion looks cleaner
  14. Made a simple barb village fisher that catches fish and drops and repeats for some easy levels on one of my pures. Figured id share. If anyone has tips on how to use IF and ELSE please give feedback below. Seems to be something I struggle with when scripting when and where to implement. Code: Edited * rivate void fish() throws InterruptedException { if(!getInventory().isFull() && (!myPlayer().isAnimating())) { NPC fishSpot = getNpcs().closest("Rod Fishing spot"); if(fishSpot != null) { fishSpot.interact("Lure"); log("Fishing.."); sleep(random(1500,2000)); getMouse().moveOutsideScreen(); } } } private void drop() throws InterruptedException { if(getInventory().isFull()) { log("Inventory full dropping fish.."); sleep(random(300,600)); getInventory().dropAllExcept("Feather","Fly fishing rod","Energy potion(3)"); } } private void levelUp() throws InterruptedException { if(getDialogues().isPendingContinuation()) { sleep(random(300,600)); getDialogues().clickContinue(); } } @Override public void onStart() { log("Welcome to my free fly fishing script.. enjoy the exp."); } @Override public int onLoop() throws InterruptedException { if(!area.contains(myPlayer())) { getWalking().webWalk(area); log("Not in fishing area.. walking there."); }else{ if(area.contains(myPlayer())) { fish(); drop(); levelUp(); } } return 1500; } }
  15. Update on Oak doors: Tweaked code a bit seems to be working fairly well. Still dicking around with Conditional Sleeps and a few other things but going to edit above code so be sure to check it out and tell me how bad it still is ? None the less many levels have been gained and been a fun project thus far.
  16. Same risk as using a bot script.. if not used in moderation will lead to a ban just the same. Bot smart. Take brakes. Period.
  17. Study this over a bit: https://en.m.wikipedia.org/wiki/Java_syntax also go to @Explv's scripting tutorial here: Give that a good read and study that Java syntax and you'll be on you're way. Hope this helps!
  18. @ProjectPact Thanks for the feedback! Will look into this ?
  19. @HunterRS Thanks for the feedback! I'm always trying to improve my scripts a little at a time with trial and error messing around with the API. Still learning Java as I go these are just fun projects for me that I like to share with the community to maybe learn something from them and also learn from you the community.
  20. Edited above code with added area. Seems to be working quite well still needs better sleeps but other than that pretty smooth.
  21. Started off with a simple Oak larder project that gained me quite a few levels. Now I've moved onto the next step for quicker exp.. Oak doors. Here's the code I have thus far, it's about as broken as my Oak larders code.. but gets the job done. If you're looking for some easy levels C&P the code below and use at your own free will. Code: Edited * import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(name = "Xpert Doors", logo = "", version = 1, author = "Imthabawse", info = "Build and remove oak doors, call butler when out of planks, repeat.") public class xpertdoors extends Script { private Area BUILDAREA = new Area(10139, 462, 10140, 462); private void BUILDDOOR() throws InterruptedException { RS2Object doorSpace = getObjects().closest("Door space"); if (doorSpace != null) { if (getInventory().getAmount("Oak plank") >= 10) { if (BUILDAREA.contains(doorSpace)) { doorSpace.interact("Build"); log("Interacting with Door space.."); sleep(random(1200, 1400)); RS2Widget oakDoor = getWidgets().get(458, 4, 4); if (oakDoor != null) { oakDoor.interact("Build"); log("Building Door.."); new ConditionalSleep(2000) { @Override public boolean condition() { return doorSpace.exists() && !myPlayer().isAnimating(); } }.sleep(); } } } } } private void REMOVEDOOR() throws InterruptedException { RS2Object oakDoor = getObjects().closest("Door"); if (oakDoor != null) { if (BUILDAREA.contains(oakDoor)) { oakDoor.interact("Remove"); log("Interacting with Door.."); sleep(random(1200, 1400)); RS2Widget reallyRemove = getWidgets().get(219, 1, 1); if (reallyRemove != null) { reallyRemove.interact(); log("Removing Door.."); new ConditionalSleep(2000) { @Override public boolean condition() { return oakDoor.exists() && !myPlayer().isAnimating(); } }.sleep(); } } } } private void DEMONBUTLER() throws InterruptedException { NPC demonButler = getNpcs().closest("Demon butler"); if (demonButler != null) { if (getInventory().getAmount("Oak plank") < 10) { demonButler.interact("Talk-to"); log("Interacting with Demon butler.."); sleep(random(1200, 1400)); RS2Widget fetchPlanks = getWidgets().get(219, 1, 1); if (fetchPlanks != null) { fetchPlanks.interact(); log("Waiting on planks.. Please wait."); sleep(random(600, 900)); getMouse().moveOutsideScreen(); new ConditionalSleep(7000) { @Override public boolean condition() { return getInventory().getAmount("Oak plank") > 10; } }.sleep(); } } } } @Override public int onLoop() throws InterruptedException { sleep(random(300,600)); if (!BUILDAREA.contains(myPlayer())) { getCamera().toPosition(BUILDAREA.getRandomPosition()); log("Not in build area.. moving there."); getWalking().walk(BUILDAREA); } else if(BUILDAREA.contains(myPlayer())) { log("We are in Build area.. "); BUILDDOOR(); REMOVEDOOR(); DEMONBUTLER(); } return 1500; } } I would love to hear feedback on how I can improve the script!
  22. Study basic java and check out @Apaec and @Explv's tutorials. This will give a good idea on where to start. Best of luck! Worth a read: https://en.m.wikipedia.org/wiki/Java_syntax
  23. Like @ez11 said you can right click varrock teleport and select GE tele OR use ring of wealth.
  24. Re-edited code above trying to find a way to stop script after all oak planks are gone and butler says a certain phrase but when I try to implement it I get errors any suggestions? Edit: I got the script to logout when out of planks but not sure it's full proof yet. Snippet: if (!myPlayer().isMoving()) { log("Not enough planks to build.. logging out."); if (getInventory().getAmount("Oak plank") < 5) { stop();
×
×
  • Create New...