Jump to content

01053

Members
  • Posts

    54
  • Joined

  • Last visited

  • Feedback

    100%

Profile Information

  • Gender
    Male

Recent Profile Visitors

1817 profile views

01053's Achievements

Iron Poster

Iron Poster (3/10)

10

Reputation

  1. Yeah thanks a lot, I didn't realise it worked like that thanks mate.
  2. I'm having a strange issue with the interact method for an object, basically I'm attempting to interact with a cooking range and occasionally an NPC is standing next to me and it's possible I click in a position where the NPC is the first click and it just gets stuck I thought it should right click if it's not the first option is it broken or something? ;o. Here's a gif to show what I mean, another issue I notice is the mouse position every time it 'attempts' to interact with cook stays the same I thought that maybe it would be good to have the position of the mouse change every attempt or something to help prevent this kind of issue. https://gyazo.com/096b1ab7f387f375df37457c9c2257d7
  3. Lol good 1. @OP Nice work, why people have the need or want to bot in Resize able is beyond me though tbh.
  4. Firstly, don't even bother doing random sleep lengths it doesn't help you at all, secondly your conditional sleep logic is wrong. You have to assign it a condition not just set it to false, so basically this code below I changed some stuff for you. It will sleep for 5 seconds or until your player is in combat. 5000 = Length of sleep. 250 = How often it checks if the condition is met, if condition is met it will no longer sleep. private boolean inCombat() { return getCombat().isFighting() || myPlayer().isUnderAttack() || myPlayer().isAnimating(); } new ConditionalSleep(5000, 250) { @Override public boolean condition() { return inCombat(); } }.sleep();
  5. Looks like that link is down currently so that could be your issue?
  6. public int getCurrentAbsorptionLevel() { final RS2Widget widget = script.getWidgets().get(202, 1, 9); if (widget != null && widget.isVisible() && widget.getMessage() != null) return Integer.parseInt(widget.getMessage().replace(",", "")); return 0; } Should work.
  7. Try doing something like, RS2Widget createRoom = getWidgets().get(422, 5, 99); if (createRoom != null) { if (createRoom.interact("Add room") Sleep.sleepUntil(() -> someSortOfCheckToSeeIfTheRoomIsCreated, 1500, 250); //Or if you don't have the Sleep class for this you can do new ConditionalSleep(1500, 250) { public boolean condition() { return someSortOfCheckToSeeIfTheRoomIsCreated; //could be wrong on the syntax of this but it gives you an idea! } } } Also one thing I'd advice against is using widget ids as they can often change, so using text within the interface is always better! Using the containingText# function https://osbot.org/api/org/osbot/rs07/api/Widgets.html
  8. Most of these videos are super out-dated, whilst it's good to have a basic grasp on Java but it takes a bit more than a basic understanding to write an efficient and functional script if you're doing it right. EDIT: Reading the API and understanding how things work is a very good start also.
  9. Could possibly be using System.exit() When Cancel or Exit listener is called, you would have to ask the script writer.
  10. I don't consider any ban very lucky m8.
  11. It seems it has a chance to start up in a PVP world (343, 324) they are new worlds so I guess you need to add it to the PVP World enum. 325 / 337 are no longer PVP worlds. @Explv
  12. Nice work on your first script only thing I really see that could be changed is; else if (tree == null) { //If it doesn't see a tree it moves the camera and then moves. getCamera().toEntity(tree); log("Searching for a tree..."); if (getWalking().webWalk(treeArea)) { log("Walking to trees..."); new ConditionalSleep(5000, 6000) { @Override public boolean condition() throws InterruptedException { return false; } }; } } } Should probably check if the tree isVisible() and not if it's null because if the tree is null then your trying to face a null object, also that sleep wouldn't work properly. you should probably make it something like, new ConditionalSleep(5000, 250) { @Override public boolean condition() throws InterruptedException { return tree.isVisible(); } };
  13. Nice job, although only thing I'd point out for in future. private String formatTime(long duration) { String formattedTime = ""; long days = TimeUnit.MILLISECONDS.toDays(duration); long hours = TimeUnit.MILLISECONDS.toHours(duration) - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration)); long minutes = TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)); long seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)); if (days == 0) { formattedTime = (hours + ":" + minutes + ":" + seconds); } else { formattedTime = (days + ":" + hours + ":" + minutes + ":" + seconds); } return formattedTime; } Could be: private String formatTime(long duration) { String formattedTime = ""; long days = TimeUnit.MILLISECONDS.toDays(duration); long hours = TimeUnit.MILLISECONDS.toHours(duration) - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration)); long minutes = TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)); long seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)); formattedTime = days > 0 ? (days + ":" + hours + ":" + minutes + ":" + seconds) : (hours + ":" + minutes + ":" + seconds); return formattedTime; } Using ternary operators, How it works basically is formattedTime = condition ? true : false; Well done on the script though looks alright!
  14. https://osbot.org/api/org/osbot/rs07/api/Equipment.html script.getEquipment().getItemInSlot(EquipmentSlot.SLOT);
×
×
  • Create New...