Jump to content

Apaec

Scripter III
  • Posts

    11169
  • Joined

  • Last visited

  • Days Won

    91
  • Feedback

    100%

Everything posted by Apaec

  1. Just running over the code, there are lots of things that could be improved, but for the most part it is a good effort! Instead of critiquing each and every thing, i'll give some general pointers for things to consider in future scripts that you write: Think about conditions OSRS is a live game, and as a result you cannot rely on the bot to successfully execute every interaction command. You have to take this into account when writing your script by making it conditional. If you have multiple chained interactions, for example (arbitrarily), if you wanted to use a raw fish on a fire: getInventory().interact("Raw salmon", "Use"); getObjects().closest("Fire").interact("Use"); Consider what happens if the script misclicks the raw salmon. Then, the script would move on to the next line of code, and attempt to interact 'use' on the fire. However, since an item is not selected, the fire doesn't have a use option, and thus the script is stuck (potentially permanently) hovering over the fire. A better way to structure this would be as follows: if (getInventory().isItemSelected()) { // Optionally add a check for which item is selected here also RS2Object fire = getObjects().closest("Fire"); if (fire != null) fire.interact("Use"); } else { getInventory().interact("Raw salmon", "Use"); } With regards to your code, this especially applies with banking! Use names, not ids Game ids are subject to change following game updates, albeit less so with item ids. Instead, filter things with names. Names are much less likely to change, and using them can make your code significantly more readable! As a general rule of thumb, if you're using an id at any point in your code, there's probably a neater way to solve the problem. Conditional sleeps! Sleeping for a static amount of time, i.e sleep(random(200,500)); // OR sleep(4000); // ... etc is very bad practice. Latency fluctuations, resource allocation and other factors can cause these seemingly stable sleep duration to fall out of sync with what you want to achieve. Instead, use conditional sleeps which will sleep until a threshold is met, or a condition evaluates to true. For example: RS2Object tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down")) { boolean didIStartCutting = new ConditionalSleep(3000) { @Override public boolean condition() { return myPlayer().isAnimating(); } }).sleep(); } This will sleep for 3000ms, or until your player is animating. Avoid flags where possible Flagging is a means of tracking your script status by updating the value of a global variable at a certain stage. While it may work well, it is generally considered poor practice to over use this technique as there are typically better ways structure code to avoid this situation. While you are a beginner, this is not the most serious of problems, but as you learn more about object orientation and programming concepts, you should try and use your knowledge of code structure to avoid this situation. This will make larger projects more digestible and will make debugging a lot easier! ________________________________________________________________________ Hopefully that was useful, let me know if you have any further questions. Good luck! Best Apa
  2. Hey, I'll put these on my list of things to add - hopefully I can find a nice way to incorporate them into the paint. Glad everything else is running smoothly! Apa I have to say, I don't double click at all! But the script does sometimes mis-click, and moves the mouse around based on a gaussian timed movement event system. Whether or not any of this helps is arguable - if you're worried about bans, be sure to give this thread a read: https://osbot.org/forum/topic/124429-preventing-rs-botting-bans-v2/ Best Apa
  3. Sure, done!
  4. Ah - sorry about that; I should have made it more clear. The post is referring to the OSBot account - the rule is in place to follow OSBot trial regulations. I will update the post to make it less ambiguous now, in the mean time please come back in a week and i'll be more than happy to give you a trial! -Apa Certainly, done! (:
  5. Yes, it makes dart tips Please post again here when you want your trial to remind me - thanks! Apa
  6. Hey, Thanks for letting me know, I will add this to the list of error regions to add. I've been working on a recovery system recently which will locate common failure areas and attempt to return to the course. Naturally, implementing this system in a generic way is less stable, so i'm spending a bit of extra time making sure it handles each situation perfectly It's not quite ready for release yet though. Apa Certainly, done!
  7. Hey, Unfortunately I can't offer you a second trial as it looks like you already got to give it a quick go. Sorry about that! -Apa Sure thing, done! (:
  8. The below patch will fix this issue. Thanks for reporting it to me ________________________________________________________________________________________________ UPDATE: Version 1.02 Added selection checks prior to looting Marks of Grace. The script will no longer get stuck trying to loot a mark when alchemy is selected. I am also working on some other new features, such as spatial error detection and correction, but these are not quite ready for release. Best Apa
  9. Woah, that's pretty crazy progress! Hopefully the $5 investment was worth while Best Apa
  10. Hey! Yes- that must be it. I thought I already added a spell selection check to looting but apparently not. I'll get that done for you now. cheers! -Apa Unfortunately accounts must be over a week old to qualify for a trial - this is an OSBot rule. Sorry about that -Apa
  11. ^
  12. That's really weird. Does it loot them elsewhere in the course? There's no difference between the code running for that mark vs. others! I'll take a look Apa
  13. Hey, that should be possible. Please post again when you want the trial to start and i'll set it up then. Thanks!
  14. Sure, done!
  15. Hmm, that's odd. Perhaps there's something up with the casket looting system - I'll take a look. In the mean time, I suggest running the bot with looting disabled. Cheers!
  16. Done!
  17. Sure, done!
  18. Hey! Unfortunately I can't offer extra time as that is not the purpose of trials - I'm glad the script worked well for you though, and that it lived up to expectations Certainly, done!
  19. Hi all, Issued all trial requests Unfortunately I can't offer more than 24 hours, but hopefully that should be enough to try the script out! Best Apa
  20. Awesome to hear, thanks for your custom! (: -Apa
  21. OnPaint should be called consistently from when you start the script to when you end it; it has nothing to do with onLoop So in your onPaint, perhaps have a call to your area painting class or gui class (or whatever you're doing), which asks for an optional wrapped area for example. Best Apa
  22. Probably best to prise off the key caps and give them a wash while you clean out underneath them!
  23. Sure, done! (:
  24. Sure thing, done!
  25. Sure, done!
×
×
  • Create New...