September 8, 20223 yr Hello, I'm building a miningbot who mines coal at mining guild. It works perfectly but i cant get the next rock hoover while mining the first one. So i want to hoover to next rock already when mining the other. Im only able to identify rocks by: MethodProvider method = client.getMethods(); Entity rock = method.objects.closest(rockID1, So how i can detect more rocks already and decide the next one and hoover the mouse already there?
September 8, 20223 yr well you are loading the closest one, thats the one you are mining. load all rocks and filter out what you need 😉
September 9, 20223 yr Author 18 hours ago, Khaleesi said: well you are loading the closest one, thats the one you are mining. load all rocks and filter out what you need 😉 Thank you for replying. I ended up using: RS2Object[] kivi = objects.getAll().stream().filter(o -> o.getId() == 11366 || o.getId() == 11367).toArray(RS2Object[]::new); ekakivi = kivi[1]; tokakivi = kivi[2]; Like this
September 10, 20223 yr Same way you get the rock to mine, just pass the rock you're already mining and add to the filter to ignore that one.
September 10, 20223 yr Author 3 hours ago, Gunman said: Same way you get the rock to mine, just pass the rock you're already mining and add to the filter to ignore that one. Could you give me little snippet, i have been trying to make it work 2 days now and i just dont know...I'm making this for my purposes, not for selling
September 10, 20223 yr 2 hours ago, sdsdsd said: Could you give me little snippet, i have been trying to make it work 2 days now and i just dont know...I'm making this for my purposes, not for selling Some shit like this I guess private void mineRocks() { final RS2Object mineRock = getRock(null); final RS2Object hoverRock = getRock(mineRock); } private RS2Object getRock(final RS2Object ignoreRock) { //Just add this condition to your filter to get the next rock basically // r != ignoreRock return getObjects().closest(r -> r.getId() == 0 && r != ignoreRock); }
September 11, 20223 yr On 9/9/2022 at 1:35 PM, sdsdsd said: Thank you for replying. I ended up using: RS2Object[] kivi = objects.getAll().stream().filter(o -> o.getId() == 11366 || o.getId() == 11367).toArray(RS2Object[]::new); ekakivi = kivi[1]; tokakivi = kivi[2]; Like this Onbjest ids change often so you might wanna use names 😉
September 24, 20223 yr Author On 9/10/2022 at 5:48 PM, Gunman said: Some shit like this I guess private void mineRocks() { final RS2Object mineRock = getRock(null); final RS2Object hoverRock = getRock(mineRock); } private RS2Object getRock(final RS2Object ignoreRock) { //Just add this condition to your filter to get the next rock basically // r != ignoreRock return getObjects().closest(r -> r.getId() == 0 && r != ignoreRock); } Thank you very much sir! I'm new to java world and trying to learn programming
September 25, 20223 yr Author On 9/10/2022 at 5:48 PM, Gunman said: Spoiler Spoiler Could you guys help me at another task. I'm trying to read chatbox when bird nest spawns to me @Override public void onMessage(Message message) throws java.lang.InterruptedException { String txt = message.getMessage().toLowerCase(); if (txt.contains("nest")) { nest++ } } but when i try to implement the method onMessage(); i dont understand the (Message message) parameter. Typeid ?, My osrs username?, the message like "nest"?
September 25, 20223 yr 7 hours ago, sdsdsd said: i dont understand the (Message message) parameter. Typeid ?, My osrs username?, the message like "nest"? I don't understand what you're trying to ask
September 26, 20223 yr 21 hours ago, sdsdsd said: Hide contents Could you guys help me at another task. I'm trying to read chatbox when bird nest spawns to me @Override public void onMessage(Message message) throws java.lang.InterruptedException { String txt = message.getMessage().toLowerCase(); if (txt.contains("nest")) { nest++ } } but when i try to implement the method onMessage(); i dont understand the (Message message) parameter. Typeid ?, My osrs username?, the message like "nest"? You can check the docs for detailed information about classes, here is the java docs for Message You don't have to call onMessage() manually anywhere in the script, it will automatically be listening for new messages whenever you run the script
Create an account or sign in to comment