Jump to content

Woody

Members
  • Posts

    715
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Woody

  1. You'll get your balls (if you have some) all dried up.
  2. i like, but perhaps a different font? maybe bold?
  3. man, you guys surely know how to over-complicate things... Why dont you just chill and bang some tinder girls?
  4. Create own method using widgets
  5. Woody

    Firemaking script?

    y u alwais undercut me bro make it $30 monthly or ill make a dispute
  6. Not taking risks ≠ no chance to make lots of cash Dude, YOLO
  7. Item peaches = getInventory().getItem("Peach"); Item bones = .... Same as above If peaches != null Eat Else If bones != null Click bones to peaches Else Stop
  8. I will not spoonfeed you anymore. Learn some java instead of depending on the forum.
  9. My scripts will give you a Woody!

  10. First thing we need is an instance that supplies the methods we need (from MethodProvider). We can do this by extending upon the API type: final class DefaultAPI extends API { } You will be forced to declare an initializeModule method. Don't worry about it, just the devs not following interface segregation Leave it blank. You could fill it in, but you would be required to call it after instantiating API. Once you have your API type, create an instance of it in onStart in your Script subclass: final class MyScript extends Script { private API api; public void onStart() { api = new DefaultAPI(); } } Finally, we need to pass the context of our script to our api instance. We do this by calling exchangeContext on our api instance, passing in the script's bot: final class MyScript extends Script { private API api; public void onStart() { api = new DefaultAPI(); api.exchangeContext(getBot()); } } I quoted fixthissite's post. Read it through thoroughly and if you pay attention, you'll make it. Edit: If you did all of this above, here is an example: import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.API; public class Inventory { // ADDED THIS HERE @@@ private API api; public Inventory(API api) { this.api = api; } // @@@@@@@ // WARNING: Untested code /** Holds the amount of willows we have cut */ private int willowsCut = 0; /** Holds the last inventory that was compared */ private Item[] lastInv; /** * Simple getter * @return the number of willows cut */ public int getWillowsCut() { return willowsCut; } /** * Compares your last inventory with the current inventory. */ public void compareItems() { if (lastInv == null) { lastInv = api.getInventory().getItems(); return; // It will be the same, no need to check } String item = "Willow logs"; Item[] currInv = getInventory().getItems(); for (int i = 0; i < 28; i++) { // Check for the same thing if ((currInv[i] == null && lastInv == null) || currInv[i].getName().equals(lastInv[i].getName())) continue; // Its the same, continue if (currInv[i] != null) { // We have an item when we didn't if (currInv[i].getName().equals(item)) willowsCut++; // It was a willow log, ++ } else { // We don't have an item when we did if (lastInv[i].getName().equals(item)) willowsCut--; // It was a willow log, -- } } lastInv = currInv; // Update the inv } /** * Run this when the lastInv needs refreshing, aka after banking */ public void resetItems() { lastInv = api.getInventory().getItems(); } } If you want to get inventory in your Inventory class, simply do "api.getInventory()".
  11. Read the guide and do it step by step.
  12. http://osbot.org/forum/topic/73842-isolating-the-api-from-script/
  13. Dude, I am suggesting to NOT use try & catch like how you are using it. Try something like this: RS2Object tree = getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getPosition().equals(WILLOW_POSITION_1) || obj.getPosition().equals(WILLOW_POSITION_2); } }); then check if tree != null and do action. Play around with it and learn how to use filters; it will help you A LOT when using filters.
  14. Make a filter to only get the 2 desired willow trees. I would not recommend using a for loop like you did. Btw, do you know what try & catch is for? If not, read it up and you'll then understand why you don't have to use it like you are now.
  15. If you fixed it, then great. However, why are you a for loop here? for (int i = 0; i < Willow.length; i++) { // why? } Also, you don't really need to try and catch when doing an action. Just make sure the object is not null.
  16. It should ignore the level up widget... Post your code where it gets stuck
  17. This picture is from google, I know, but it's almost exactly like this one; minus side mirrors (mine are all white) and the rims (mine are cooler). It's a BMW 5 serie F10, 535D xDrive.
  18. There's a section for script upload request. Use log(message) in your script for console debug.
  19. @Mocro, this was your issue as Flamezzz posted. Look at the big difference in x coordinate. Edit: Use WalkingEvent. If you don't want it to click on the main screen, use WalkingEvent#setMiniMapDistanceTreshold. Incase you don't know how to use it, do some small tests and hopefully you'll get it.
  20. Did not know you are playing cs go play with meh, we will win
×
×
  • Create New...