Jump to content

Butters

Lifetime Sponsor
  • Posts

    650
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by Butters

  1. On 6/13/2018 at 12:16 AM, axldeth said:

    is this working? i may suggest adding pvp world lummy area 

    Yes it is. 

    I'm not really familiar with it. Does it have an extra bank or something?

  2. Hope that by now you understood conditional sleeps, so I won't say anything about that.

    I would recommend to rewrite your code from scratch and consider some things like not checking if you have law and water runes in two steps. This won't improve performance drastically, but will keep the code cleaner and easier to work with. e.g.

    private boolean hasRunes() {
    	return inventory.contains("Law rune") && inventory.contains("Air rune");
    }

    I would also rewrite this

    log("The telekinetic spell is selected");
                                    mouse.move(418, 164);
                                    camera.moveYaw(186);
                                    camera.movePitch(67);

    To something like if the wine or counter or certain position is not visible, then and only then move the camera around. Would put this in the topmost code block whenever you are sure that you are in the right place.

    You can leave the mouse.move(418, 164); after you select the spell.

    • Like 1
  3. 6 minutes ago, trainux said:

    How are they used?
    Could you do an example, please?

    ListInteger doorIds = new ArrayList<>();
    doorIds.add(1560);
    doorIds.add(1558); // I reckon better use positions (x, y)
    
    if (!map.canReach(SOME_POSITION_BEYOND_GATE) {
    	RS2Object gate = objects.closest(f -> doorIds.constains(f.getId()) && f.hasAction("Open"));
    	if (gate != null) {
    		gate.interact("Open");
        }	
    } else {
    walking.webwalk(SOME_POSITION_BEYOND_GATE);
    }

    Didn't test it, but should do the trick

  4. 7 minutes ago, RS123 said:

    if (Banks.GRAND_EXCHANGE.contains(myPlayer())) {
                if (bank.isOpen()) {
                      bank.depositAll();
                      new ConditionalSleep(1900, 5100) {
                          @Override
                          public boolean condition() throws InterruptedException {
                              return true;
                          }
                      };
                } else {
                  try {
                      bank.open();
                  } catch (Exception e) {
                  }
                }
            } else {
              walking.webWalk(Banks.GRAND_EXCHANGE);
            }

     

    fixed some errors But it's not working

    Replace conditional sleep with something like this

    new ConditionalSleep(5000 250) {
                          @Override
                          public boolean condition() throws InterruptedException {
                              return inventory.isEmpty();
                          }
                      };

    And reading some examples/playing around would help.

    What's not working?

  5. What errors are you getting?

    Easiest way to do it would be something like

    if (Banks.GRAND_EXCHANGE.constains(myPlayer()) {
    	if (bank.isOpen) {
          	bank.depositAll();
          	CONDITIONAL_SLEEP_UNTIL_INVENTORY_EMPTY // Search in forums for code to do this
        } else {
          try {
          	bank.open();
          } catch (Exception e) {
          }
        }
    } else {
      walking.webwalk(Banks.GRAND_EXCHANGE);
    }

    Didn't check code or syntax

  6. I do believe that Java is hated due to it being slow in the early days. 

    Probably also due to Java applets (once those stopped being "groundbreaking").

    Basically people think of Java as it was in the early days and compare it to new technologies.

    • Like 1
  7. Well if speaking purely from a general perspective, as Explv said the "best language" is fairly subjective. If your goal is to eventually land a job, good thing to do would be to snoop around recruiting/CV sites see what's the most popular language in your country.

    Where I live, .NET (C#) is quite popular and doesn't take too much effort to land a junior position at a company with rather minimal skills. From there on you can gain experience by working in real life projects and from more experienced colleges.  

  8. As someone mentioned, try removing the old script from OSBot/Scripts. If there are two or more scripts with the same name (script name set in code, not .jar name) I think OSBot says  "I ain't gonna put that in the script selector, cause I dunno which one to put in"

  9. 23 minutes ago, goldKeeper said:

     

    When starting the script create a list of items that contains all the Items in your inventory. Then you can drop everything else except those items with this

    
    getInventory().dropAllExcept(List<Item>)

     

    Excatly this

    String[] itemsToKeep = new String[] { "Rune pickaxe", "Uncut sapphire" } // Etc
    if (inventory.isFull()) {
    	inventory.dropAllExcept(itemsToKeep);
    } else {
    	// Do mining
    }

    Can also write your own stuff for dropping. Like iterating though the inventory and checking items.

  10. 6 minutes ago, deadfish said:

    this looks like it is what i needed. I mean to say, i think this is going to involve a bit more change than I thought. Thank you for the input!

     

     

    so really the part where im hung up is

    How tf do i write that using the osbot api?

    if (!inventory.contains("Item name") {
      //walking.webwalk(Banks.FALADOR_EAST);
      /* RS2Object oakTree = objects.closest("Oak");
        if (oakTree != null)
        	oakTree.interact("Cut");
      */
      // etc etc etc
    }

    Hard to understand what you really need.

    I recommend reading a few of OSBot API tutorials here on OSBot. Some are very good

  11. 12 minutes ago, deadfish said:

    i dont think that would work though for the same reason above. I need to to check that a specific item is missing, not that any item besides that is there. Because I need to to work weather the inventory is empty, AND/OR at least doesnt have that particular item there. 

    I don't get what's wrong with !inventory.contains() ?

    If inventory contains some fancy item - do something, if it doesn't - do something else

  12. 17 hours ago, lawjestaw said:

    I was standing at the fountain with 28 empty jugs in my inv

    Just tested, all is well.

    The fountain on the east side, right? Not the one in the center of Varrock.

    Also, did you select the location in GUI and press start?

  13. 5 hours ago, lawjestaw said:

    Not even walking

    Cause you're too far away from the Fountain/pump or bank in your selected location. Web walking is not used here.

    Say if you're doing soft clay in Varrock East, need to be somewhere near Varrock east bank or the fountain.

  14. 19 hours ago, Slipping said:

    This script is broken for me, it clicks behind the bench at V east and then breaks there not clicking the bucket or the fountain. When i manually walk it inbetween the fountain and bench it works fine but i have to assist it everytime it goes for the refills. Would be nice if it got fixed :)

    Thanks for the heads up. Looking at it now.

    Shouldn't be happening "always" though :D

×
×
  • Create New...