seasons 4 Posted November 16, 2015 Share Posted November 16, 2015 I was wondering how one goes about burying all bones in inventory. I understand ".dropALL();" and how it is able to drop all the items, but i wish to bury and "buryALL();" simply wont work. For this one a simple answer would be great but, if someone could direct me in the direction of which I can look this information up for myself that would be even better. 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted November 16, 2015 Share Posted November 16, 2015 (edited) if (condition) getInventory().interact("Bury","Bones"); or Edited November 16, 2015 by TheObserver Quote Link to comment Share on other sites More sharing options...
seasons 4 Posted November 16, 2015 Author Share Posted November 16, 2015 Thank you, where do i go about getting the information i need. Via the libraries and what not. I need to know how to pick everything up and basically everything else. Quote Link to comment Share on other sites More sharing options...
Chris Posted November 16, 2015 Share Posted November 16, 2015 (edited) Thank you, where do i go about getting the information i need. Via the libraries and what not. I need to know how to pick everything up and basically everything else. To pick up look at the GroundItems API : http://osbot.org/api/org/osbot/rs07/api/GroundItems.html anything else will be in API : http://osbot.org/api example: GroundItem g = getGroundItems().closest("item name"); //basic //always nullcheck if (g != null){ g.interact("action"); } Edited November 16, 2015 by TheObserver Quote Link to comment Share on other sites More sharing options...
seasons 4 Posted November 16, 2015 Author Share Posted November 16, 2015 To pick up look at the GroundItems API : http://osbot.org/api/org/osbot/rs07/api/GroundItems.html anything else will be in API : http://osbot.org/api example: GroundItem g = getGroundItems().closest("item name"); //basic //always nullcheck if (g != null){ g.interact("action"); } Thank you very much 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted November 16, 2015 Share Posted November 16, 2015 Item[] bones = getInventory().getItems(); Item[] var2 = bones; int var3 = bones.length; for(int var4 = 0; var4 < var3; ++var4) { Item item = var2[var4]; if(item != null && item.hasAction("Bury")) { item.interact("Bury"); //sleep } } wtf is this You could either use streams or there's a simpler way: for (Item i: inventory.getItems()) { if (i != null && i.getName().equals("Bones")) { inventory.interact(i,"Bury"); } } //wrote in response box so sorry if any errors merry christmas apa Quote Link to comment Share on other sites More sharing options...
Chris Posted November 16, 2015 Share Posted November 16, 2015 wtf is this You could either use streams or there's a simpler way: for (Item i: inventory.getItems()) { if (i != null && i.getName().equals("Bones")) { inventory.interact(i,"Bury"); } } //wrote in response box so sorry if any errors merry christmas apa im still noob appy plzzzz dont publicly shame me infront of teh noobs ty Quote Link to comment Share on other sites More sharing options...
Explv Posted November 16, 2015 Share Posted November 16, 2015 (edited) if (condition) getInventory().interact("Bury","Bones"); or Item[] bones = getInventory().getItems(); Item[] var2 = bones; int var3 = bones.length; for(int var4 = 0; var4 < var3; ++var4) { Item item = var2[var4]; if(item != null && item.hasAction("Bury")) { item.interact("Bury"); //sleep } } wtf is that Observer Arrays.stream(getInventory().getItems()) .filter(item -> item.hasAction("Bury")) .foreach(bones -> bones.interact("Bury")); or for(Item item : getInventory().getItems()){ if(item.hasAction("Bury")) item.interact("Bury"); } Edited November 16, 2015 by Explv 1 Quote Link to comment Share on other sites More sharing options...
seasons 4 Posted November 16, 2015 Author Share Posted November 16, 2015 lol, another question incase you're still around. How would one go about filling the entire inventory and then dropping? Quote Link to comment Share on other sites More sharing options...
Chris Posted November 16, 2015 Share Posted November 16, 2015 wtf is that Observer Arrays.stream(getInventory().getItems()) .filter(item -> item.hasAction("Bury")) .foreach(bones -> bones.interact("Bury")); or for(Item item : getInventory().getItems()){ if(item.hasAction("Bury")) item.interact("Bury"); } pllssssss fk u explvy Quote Link to comment Share on other sites More sharing options...
Explv Posted November 16, 2015 Share Posted November 16, 2015 lol, another question incase you're still around. How would one go about filling the entire inventory and then dropping? Fill inventory from what? your bank? Quote Link to comment Share on other sites More sharing options...
seasons 4 Posted November 16, 2015 Author Share Posted November 16, 2015 (edited) Let me give you a bit of the background i guess. It may make it easier to see what i'm doing i'm using apaec's simple tea thievers guides (thanks =P). so: @Override public int onLoop() throws InterruptedException { switch (getState()) { case TAKE: //Entity stall = objects.closest("Tea stall"); GroundItem bones = getGroundItems().closest("Bones"); if (bones != null){ bones.interact("Take"); } sleep(random(500,1000)); //if (stall != null) { // stall.interact("Steal-from"); break; case BURY: if (inventory.isFull()) getInventory().interact("Bury","Bones"); //inventory.dropAll(); break; case WAIT: sleep(random(700, 1000)); break; } return random(200, 300); } Basically taking it and changing slight code. Goal: pick up an entire inventory of bones and bury them after a full inventory Edited November 16, 2015 by seasons 4 Quote Link to comment Share on other sites More sharing options...
Explv Posted November 16, 2015 Share Posted November 16, 2015 (edited) Let me give you a bit of the background i guess. It may make it easier to see what i'm doing i'm using apaec's simple tea thievers guides (thanks =P). so: Basically taking it and changing slight code. Goal: pick up an entire inventory of bones and bury them after a full inventory Maybe something like import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.Script; @ScriptManifest(author = "Noob", name = "Noob Script", version = -15.0, logo = "", info = "Does some noob shit") public class Burier extends Script { private enum STATE{ PICKING, BURYING } // Enum for our two script states private STATE getState(){ if(!getInventory().isFull()) return STATE.PICKING; // When the inventory is not full, pick bones else return STATE.BURYING; // When the inventory is full, bury bones } @Override public int onLoop() throws InterruptedException { switch (getState()){ // Get the current state case PICKING: pick(); // If we are picking, call the pick method break; case BURYING: bury(); // If we are burying, call the bury method break; } return 0; } private void pick(){ /* Get the closest ground item that matches our filter, in this case items which name contains "bones". This could be simplified by storing the names of all bones in a String[] */ GroundItem bones = getGroundItems().closest(new Filter<GroundItem>() { @Override public boolean match(GroundItem groundItem) { return groundItem.getName().toLowerCase().contains("bones"); } }); if(bones != null){ // Check that we found bones on the ground bones.interact("Take"); // If we did, pick them up try{ sleep(random(1000, 1200)); // Sleep for between 1 and 1.2 seconds after clicking on the bones } catch(InterruptedException e){ log(e); } } } private void bury(){ for(Item item : getInventory().getItems()){ // Iterate over each inventory item if(item.hasAction("Bury")) { // If it has the "Bury" action item.interact("Bury"); // Bury it try{ sleep(random(1000, 1200)); // Sleep for between 1 and 1.2 seconds after burying } catch(InterruptedException e){ log(e); } } } } } Edited November 16, 2015 by Explv Quote Link to comment Share on other sites More sharing options...
seasons 4 Posted November 16, 2015 Author Share Posted November 16, 2015 Maybe something like import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.Script; @ScriptManifest(author = "Noob", name = "Noob Script", version = -15.0, logo = "", info = "Does some noob shit") public class Burier extends Script { private enum STATE{ PICKING, BURYING } private STATE getState(){ if(!getInventory().isFull()) return STATE.PICKING; else return STATE.BURYING; } @Override public int onLoop() throws InterruptedException { switch (getState()){ case PICKING: pick(); break; case BURYING: bury(); break; } return 0; } private void pick(){ getGroundItems().closest(new Filter<GroundItem>() { @Override public boolean match(GroundItem groundItem) { if(groundItem.hasAction("Bury")) return true; return false; } }).interact(); try{ sleep(random(1000, 1200)); } catch(InterruptedException e){ log(e); } } private void bury(){ for(Item item : getInventory().getItems()){ if(item.hasAction("Bury")) item.interact("Bury"); } try{ sleep(random(1000, 1200)); } catch(InterruptedException e){ log(e); } } } Alright give me a sec to read this. I will probably have some more questions. especially why it just does some noob shit =P lol Quote Link to comment Share on other sites More sharing options...
Nitrousek Posted November 16, 2015 Share Posted November 16, 2015 if (condition) getInventory().interact("Bury","Bones"); or Item[] bones = getInventory().getItems(); Item[] var2 = bones; int var3 = bones.length; for(int var4 = 0; var4 < var3; ++var4) { Item item = var2[var4]; if(item != null && item.hasAction("Bury")) { item.interact("Bury"); //sleep } } I lol'd I mean, if I was new to this, I'd only get confused more and more Quote Link to comment Share on other sites More sharing options...