Jump to content

Explv

Scripter II
  • Posts

    2314
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Everything posted by Explv

  1. Fixed Fixed, sort of :xdoge:
  2. Explv's Dank Paint Tutorial Run Time (ms) Formatting Time Dynamic Time Formatting (Includes Days) Formatting Money and XP Starting the Experience Tracker Using the Experience Tracker The Skills class Percentage to next level Price of an item Overall price, Buying price, Buying quantity, Selling price, Selling quantity of an item The following code requires a Graphics 2D instance, and therefore should be used within the onPaint method (as this method has a Graphics 2D instance as a parameter). We assume that the name of the variable passed to the onPaint method is 'g'. Drawing text on screen Changing text font and size Drawing shapes on screen Changing text / shape colour Changing opacity Drawing an image Customising the mouse
  3. Except that doesn't work in this instance hence the other answers x 2
  4. I recommend you use configs for Tutorial Island. It greatly simplifies everything. For example, when config 281 == 30 you need to open the Inventory tab ( on the Survival stage of Tut Island ) if(script.getConfigs().get(281) == 30){ script.getTabs().open(Tab.INVENTORY); new ConditionalSleep(1500) { @Override public boolean condition() throws InterruptedException { return script.getTabs().getOpen() == Tab.INVENTORY; } }.sleep(); }
  5. I could not tell you what is wrong with your code without seeing the full source / testing it for myself. However this script I have just written, works perfectly well on all three Varrock Yews behind the castle, it automatically walks to the third tree if it is not in click-able distance, so perhaps you are over complicating it: import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Explv", name = "Wood Chop Chop", version = 1.0, info = "Chops wood", logo = "") public class WoodChopChop extends Script { @Override public int onLoop() throws InterruptedException { if (!myPlayer().isAnimating() && !myPlayer().isMoving()) { if(getInventory().isFull()) getInventory().dropAllExcept(item -> item.getName().contains("axe")); else chop(); } return 0; } private void chop() { RS2Object yew = getObjects().closest("Yew"); if (yew != null) { if (!yew.isVisible()) getCamera().toEntity(yew); yew.interact("Chop down"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } }
  6. Feel free to PM me and I can take a look at the full source code for you
  7. Probably just that there isn't a Yew tree nearby?? Also if you are near a Yew tree, and there is an Oak or Willow nearby it will try and cut those first. I suggest you change your yew code to: else { Entity Yew = getObjects().closest("Yew"); if (Yew != null) { if (Yew.isVisible()) { log("Chopping Yew"); Yew.interact("Chop down"); } else { log("Yew is not visible"); sleep(random(500, 700)); } } else{ log("Yew is null"); } } And view the logger so you can see what's happening. On a side note your code can be simplified to: case CHOP: Entity yew = getObjects().closest("Yew"), willow = getObjects().closest("Willow"), oak = getObjects().closest("Oak"); if (willow != null && willow.isVisible()) willow.interact("Chop down"); else if (oak != null && oak.isVisible()) oak.interact("Chop down"); else if (yew != null && yew.isVisible()) yew.interact("Chop down"); else sleep(random(500, 700)); Side note 2: variable names should always be lowercase I would also suggest you take a look at Java Swing, there are some tutorials here on OSBot, and create a GUI that lets the user select which kind of tree they want to chop.
  8. Edit: These are RS3 .zip archives of large item icons and item sprites for all items Large icons (96 x 96): http://www.mediafire...a3uq5/large.zip Sprites (32 x 32): http://www.mediafire...2d43/sprite.zip Large icons preview: Sprites preview:
  9. Do everyone a favour when you post code, post it using the code tool, and make sure it is properly formatted. Otherwise it is a headache to read. https://gyazo.com/5819a6c62741a431cb9fa7113d3f6dc9 Also there is a method in the API for determining if the player is under attack myPlayer().isUnderAttack()
  10. I believe this is a general issue with Local scripts at the moment. However, I will be uploading a new version of this script later today, so hopefully that will work for you. Thanks
  11. Something like this should do it: // Set colour to white g.setColor(Color.white); // Get current mouse position Point mousePoint = getMouse().getPosition(); // Draw a rectangle starting at x-10, y-10, with width and height of 20 g.drawRect(mousePoint.x - 10, mousePoint.y - 10, 20, 20); // Draw a line from top of screen (0), to bottom (500), with mouse x coordinate g.drawLine(mousePoint.x, 0, mousePoint.x, 500); // Draw a line from left of screen (0), to right (800), with mouse y coordinate g.drawLine(0, mousePoint.y, 800, mousePoint.y);
  12. In the case of Tutorial Island, every interaction with an NPC is followed by the user selecting continue. So you can use: final ConditionalSleep dialogSleep = new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return script.getDialogues().isPendingContinuation(); } };
  13. Problem was he had some other files in his .jar other than 'compiled output' .
  14. Try deleting the OSBot folder, restarting OSBot, and then re-building your script.
  15. Couldn't that be simplified to: boolean isMining = false; if(clayRock1 != null && (!myPlayer().isAnimating() || !isMining)){ clayRock1.interact("Mine"); isMining = true; sleep(random(2000, 2200)); } else if (clayRock1 == null){ isMining = false; } So that when isMining == false it ignores the fact that the player is animating, and tries to mine anyway?
  16. I think the problem is your PATH got fucked up somehow. Go to the Chat Box, and i'll try and help
  17. Maybe you need to update the Java path in Eclipse now that you have updated Java? Edit: http://bfy.tw/2p2K
  18. Entity clayRock1 = objects.closest(ID_CLAY1); if(clayRock1 != null && !myPlayer().isAnimating()){ clayRock1.interact("Mine"); sleep(random(2000, 2200)); } else if(clayRock1 == null){ // Do something else }
  19. Method 1) The rock will have a different ID when there is no ore Method 2) If the rock no longer has the "Mine" action, when there is no ore (i cant remember if it does or not) then you could check that
  20. That is probably because I didn't put in anything for bones.interact(); You need to specifiy the pick up action like bones.interact("Take"); To prevent it from clicking other stuff Edit: I fixed it Edit2: I also didn't really think about it, the bones when on the ground wont have the action "Bury", so I changed the filter
  21. I have commented it to maybe help you understand
  22. 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); } } } } }
  23. Fill inventory from what? your bank?
  24. 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"); }
×
×
  • Create New...