Everything posted by 01053
-
interact() with object.
Yeah thanks a lot, I didn't realise it worked like that thanks mate.
-
interact() with object.
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
-
[Stable] OSBot 2.5.19-21
Lol good 1. @OP Nice work, why people have the need or want to bot in Resize able is beyond me though tbh.
-
Just made my first script, but had a few problems
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();
-
attempt to consult, by rsbuddy, the price of an item
Looks like that link is down currently so that could be your issue?
-
Method to get current absorption points
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.
-
How to build new rooms in player owned house?
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
-
SpaceCats' Crab Killer | All food | All Crabs (Rock/Sand/Ammonite) | All spots | Banking | GUI | Paint
Code looks clean well done. Only thing I'd suggest is using Conditional sleeps.
-
Java courses
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.
-
some scripts close the client when I click the exit in gui
Could possibly be using System.exit() When Cancel or Exit listener is called, you would have to ask the script writer.
-
I got lucky or what?!
I don't consider any ban very lucky m8.
-
Explv's OSBot Manager
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
-
Simple woodcutting script.
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(); } };
-
SimpleFisherman - Effortless 1-99 fishing [Open Source]
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!
-
Grab equipment on start
https://osbot.org/api/org/osbot/rs07/api/Equipment.html script.getEquipment().getItemInSlot(EquipmentSlot.SLOT);
-
PC partial completed Nher
I'd say $50-100 the stats are not that impressive Firecape/Quests probably make up for most of the price.
-
error when trying to interact with fishing object
Yes, and make sure you do your null check. final NPC fishingSpot = script.getNpcs().closest("Fishing spot"); if (fishingSpot != null) fishingSpot.interact("Small net");
-
How do I declare an NPC and interact with it?
final RS2Object bankBooth = script.getObjects().closest(new NameFilter<>("Bank booth")); if (bankBooth != null) bankBooth.interact("Bank"); I'm assuming something like this is what you're after.
- Method not functioning.
-
Chin Hunter Script doesn't walk or pick up traps
Hi @TheManWhoBots, Could you please show us this method randomizePosition() also don't forget to place that trap I imagine you would need to break out of the WebWalking place the trap and then initialise it again. so something like. final WebWalkEvent trapLocation = new WebWalkEvent(randomPosition()); trapLocation.setBreakCondition(new Condition() { @Override public boolean condition() { return !maxTrapsLaid(); } }); script.execute(trapLocation); And then to check if you have enough traps laid don't quote me if I'm wrong but I'd imagine when you successfully place a trap something a long the lines of Should print out in the chat box I don't know too much about hunter myself so I'm not sure, anyways you would override the onMessage() and just check if the message contains anything of the likes of successfully placing a trap if so add on to your trapsLaid. @Override public void onMessage(Message msg) { if (msg.getMessage().contains("You successfully place a trap")) trapsLaid++; } I hope this helps you in some way best of luck.
-
Brand new to scripting. Quick question
Make sure you have the OSBot Client added to your libraries sounds like that is your issue.
-
Walk path not applicable argument?
Also make sure you populate the LinkedList when the script starts in the onStart() method. So you're not having to spend time repopulating the List everytime you call the HILLS_RUN() method, not a major problem but good practise. Also another thing I'd probably do is - Change wEvent.setPath(HILLS_PATH); To w.setPath(HILLS_PATH).setMinDistanceThreshold(2).setMiniMapDistanceThreshold(2); So you aren't literally walking to the exact same tile every time.
-
Walk path not applicable argument?
private List<Position> path = Arrays.asList(new Position(x,y,z), new Position(x,y,z)); script.getWalking().walkPath(path); I believe something like this is what you are after?
-
Successful tree felling counter
I'm kind of confused what you're asking for are you asking for a counter for how many logs you have received or a counter for how many trees are cut? @Override public void onMessage(Message msg) { if (msg.getMessage().contains("You get some logs")) logsChopped++; }
-
Anyone Traded with RSGOLDFAST??
Definitely keep your dispute open.