Jump to content

Twin

Members
  • Posts

    1334
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Twin

  1. Didn't think of having a tree area change based on woodcutting level, will defiantly try it out. And I know it's not the best but i'm still trying to learn it, so if I can get something like this to work even if those code is written poorly it will still help me grasp the osbot api better and what not. Also, thanks for cleanig up the states, would have never really thought to change any of those. will defiantly try my best to not have my states just to be a bunch of jumbled of if statements. thanks for the reply!
  2. Still getting stuck, tried to just get rid of using the bank class and making an entity called booth and having it interact with that, but it still didn't work. I'm assuming its getting stuck within another case in the script and it doesn't know what its supposed to do. I'm stumped with this one.
  3. I've had a few hiccups with this script but apaec has helped me through with most of it, basically when, it cuts down trees, and depending on your level will choose between willows, oaks or trees. it all goes well until it goes into the bank, it just stands there cluelessly. import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.Skills; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.utility.Area; import java.awt.*; @ScriptManifest(author = "Twin 763", info = "1-30 auto woodcutting levler", name = "Twin Power WC", version = 1, logo = "") public class Bf extends Script { @Override public void onStart() { log("If you experience any issues while running this script please report them to me on the forums."); log("Enjoy the script, gain some woodcutting levels!."); } Area BANK_AREA = new Area(3092, 3246, 3097, 3240); private int wcLvl2; private enum State { CHOP, BANK_WALK, BANK, TREE_WALK, WAIT, CHOPO, CHOPW,UNDER_ATTACK }; private State getState() { if (myPlayer().isUnderAttack()) return State.UNDER_ATTACK; if (inventory.isFull()) return State.BANK_WALK; if (!myPlayer().isAnimating()&&!inventory.isFull()) return State.CHOP; if (!myPlayer().isAnimating() && wcLvl2 >= 15 && wcLvl2 < 30&&!inventory.isFull()) return State.CHOPO; if (!myPlayer().isAnimating() && wcLvl2 >= 30&&!inventory.isFull()) return State.CHOPW; if (BANK_AREA.contains(myPlayer())) return State.BANK; if(inventory.isEmpty()) return State.TREE_WALK; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case CHOP: Entity tree = objects.closest(1276, 1277, 1278); if (wcLvl2 < 15&&!myPlayer().isAnimating()&&!inventory.isFull()) { tree.interact("Chop down"); sleep(random(500, 1000)); break; } case CHOPO: Entity oak = objects.closest("Oak"); if (wcLvl2 < 30&&!myPlayer().isAnimating()&&!inventory.isFull()) { oak.interact("Chop down"); sleep(random(2000, 3000)); break; } case CHOPW: Entity willow = objects.closest("Willow"); if (wcLvl2 >= 30&&!myPlayer().isAnimating()) { willow.interact("Chop down"); sleep(random(500, 1000)); } case BANK: if (BANK_AREA.contains(myPlayer())) bank.open(); if(bank.isOpen()) { bank.depositAll("Logs,Oak logs, Willow logs"); break; } case BANK_WALK: if(inventory.isFull()) getLocalWalker().walk(3093, 3243); if (BANK_AREA.contains(myPlayer())) break; case TREE_WALK: if (wcLvl2 < 15&&!inventory.isFull()) { getLocalWalker().walk(3100, 3245); break; } else if (wcLvl2 >= 15 && wcLvl2 < 30&&!inventory.isFull()) { getLocalWalker().walk(3100, 3245); break; } else { getLocalWalker().walk(3090, 3234); break; } case UNDER_ATTACK: if(myPlayer().isUnderAttack()) getLocalWalker().walk(3093, 3244); break; case WAIT: sleep(random(500, 700)); break; } return random(200, 300); } @Override public void onExit() { log("Thanks for running my Auto Woodcutter!"); } @Override public void onPaint(Graphics2D g) { wcLvl2 = skills.getDynamic(Skill.WOODCUTTING); } } probably have thrown in way more logic than I need to try and figure this out but I just can't get it. i've found a few other issues with the code after posting this, but still couldnt find out what's wrong with the banking.
  4. int wclvl = getDynamic(Skill.WOODCUTTING); is what I have, basically I need it to get the woodcutting level and have it return it so the script can determine what to cut. edit: forgot to have skills in front of get. int wcLvl = skills.getDynamic(Skill.WOODCUTTING);
  5. That's a good point, i didnt think about that. Would you happen to know how I can make it only mine iron ore id's, and have it wait while it mines? I currently have Entity Iron = objects.closest("13455,13466"); but since they're right next to eachother, it would try and store both of them into iron at the same time and get nothing done, right? the ID changes when it's mined I figured having the ID there instead of just "Rocks" would prevent it from spam clicking the same vein over and over again.
  6. hmm i didnt see that, i ended up just doing inventory.drop("Iron Ore"); thank you for the response though!
  7. Trying to work my way up to making a basic motherlode mining script, but im having an issue doing this basic powermining iron script. everything in it should work, it drops my inventory then goes to mine iron. only issue is I can't mine without a pick. What's the code to ignore an item in the inventory?
  8. Thank you for this! Defiantly helped a lot since i'm still new with java, only about 6 months experience. I didn't even have any idea where to look in the api to find some of this since there's a lot there. Let me see if I can use this to get something basic out(just functionally, really) and I'll get back to you! thanks again =) I'm confused with this. Would I have to make another class with my project then make the snare object?Also, I never really thought arrays were useful so thanks for proving me wrong lol
  9. Reading through the api right now trying to understand it, but I'm still learning it. How would I make my bot fix a broken bird snare, or take a bird from one if it gets caught. Also, how would I keep my bot in a certain area so it doesn't wander off? Like I said i'm still trying to read the api but theres a bunch there to learn. Is there a getState for ground items? or something like that?
  10. vouch, made trade no issues, would recommend!
  11. I saw that you sold gold to so I was wondering if you would trade? 07 for csgo? I have an awp boom minimal wear that looks almost perfect, an ak47 redline minimal wear that only has a scruff on the barrel, and an m4a1 bullet rain that has some noticeable damage but it's still minimal wear. I know you still need to make a profit so obviously I won't get the full 36 dollar worth, but was just stating the steam value of the items.
  12. Does anyone do this? Looking to start doing some bigger merches and need some extra gold to help out. Have about 40 dollars in cs skins.
  13. Yeah, it makes a lot more sense now. I didn't really have a good understanding of how osbot/its api worked. Still trying to figure all that out.
  14. ahh okay that makes more sense. Everything I have written so far has just been standalone. Thanks for the quick reply! Don't know why I didnt think of this lol.
  15. I was reading the guide on how to setup a basic script and I didn't see it anywhere. I'm not new to java, I have about 6 months of experience with it, but i've never wrote anything that didn't use public static void main.
  16. my bad i should have went into more detail. It ran for about 100 lobsters, so m aybe 45 or so minutes. And then it was just standing in front of a fishing spot not doing anything spamming my console with those errors. And I stopped it manually. It ran for about 2 hours total
  17. yeah probably shouldnt have let it afk.. [ERROR][bot #1][01/17 05:31:32 PM]: Error in script executor! java.lang.NullPointerException at com.czar.a.aUX.J(z:8) at com.czar.a.aUX.G(z:162) at com.czar.nUL.onLoop(c:122) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(uk:172) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][01/17 05:32:46 PM]: Terminating script Perfect Fisher... [DEBUG][bot #1][01/17 05:32:46 PM]: / // PerfectFisher terminated [DEBUG][bot #1][01/17 05:32:46 PM]: / // Fish caught: 104. [iNFO][bot #1][01/17 05:32:46 PM]: Script Perfect Fisher has exited! [ERROR][bot #1][01/17 05:32:46 PM]: Error drawing canvas! java.util.ConcurrentModificationException at java.util.LinkedHashMap$LinkedHashIterator.nextNode(Unknown Source) at java.util.LinkedHashMap$LinkedKeyIterator.next(Unknown Source) at org.osbot.rs07.canvas.WrappedCanvas.drawScreen(jg:133) at org.osbot.rs07.canvas.WrappedCanvas.getGraphics(jg:6) at client.l(client.java:1000) at eb.pf(eb.java:229) at eb.run(eb.java:180) at java.lang.Thread.run(Unknown Source) [DEBUG][bot #1][01/17 05:32:55 PM]: Applet resize : (775, 513) caught about 100 fish before that
  18. will go to catherby now and see how well its running. afk for 2 hours, will report back by then. im running for about an hour then a 30 minute break
  19. I just switched to trout for the time being so It's not in the log anymore
  20. Yeah was just about to say im fishing lobs now, its not just stopping the script.
  21. any news on the update if its out or not?
  22. when will this be back on the SDN?
  23. It's stopping the script and logging out saying it doesn't have feathers/bait. This is when trying to catch lobsters in catherby [DEBUG][bot #1][01/16 05:39:47 PM]: / / My fish set to [Raw lobster] [DEBUG][bot #1][01/16 05:39:48 PM]: / / My spot set to [CATHERBY_CAGE] [DEBUG][bot #1][01/16 05:39:50 PM]: / / Keeping other fish (e.g. tuna when fishing for swordfish, trout when fishing for salmon) [DEBUG][bot #1][01/16 05:39:50 PM]: / ---------- ready ---------- [DEBUG][bot #1][01/16 05:39:50 PM]: / User doesn't have bait/feathers, stopping script [iNFO][bot #1][01/16 05:39:52 PM]: Terminating script Perfect Fisher... [DEBUG][bot #1][01/16 05:39:52 PM]: / // PerfectFisher terminated [DEBUG][bot #1][01/16 05:39:52 PM]: / // Fish caught: 1. [iNFO][bot #1][01/16 05:39:52 PM]: Script Perfect Fisher has exited!
×
×
  • Create New...