maferosrs 2 Author Share Posted June 24, 2017 You already have it Thank you Now I do not get the getModelColors () method in the DreamBot API documentation, I'm going crazy T_T Reading the API documentation I got this https://dreambot.org/javadocs/org/dreambot/api/utilities/ColorPicker.html#getColorAt-int-int- isColor(int x, int y, java.awt.Color color) Checks if the color at the provided point matches the color provided and getColorAt(int x, int y) It's interesting what can be done, but I can not do it with getColorAt(int x, int y) Link to comment Share on other sites More sharing options...
Soldtodie 76 Share Posted June 24, 2017 https://dreambot.org/javadocs/org/dreambot/api/wrappers/interactive/GameObject.html#getModelColors-- Thats the standard now you have to add the check if you already interacting with the rock. GameObject rock = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Rocks") && gameObject.getModelColors() != null); if(rock != null) { //Before you interacting with it check if you already did it. rock.interact("Mine"); //Click on rock to mine it. } Link to comment Share on other sites More sharing options...
Soldtodie 76 Share Posted June 25, 2017 fairly certian its not working because its called "Rocks" not "Rock" ... rock = getGameObjects().closest(f -> f.getName().contains("Rock")); Link to comment Share on other sites More sharing options...
maferosrs 2 Author Share Posted July 1, 2017 ... rock = getGameObjects().closest(f -> f.getName().contains("Rock")); ty ty How can I compare the color of the rock when it has mineral, and when it does not? package Miner; import javafx.scene.control.ColorPicker; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.interactive.GameObject; import java.awt.*; @ScriptManifest( category = Category.MINING, name = "PowerMiner_10", author = "Mafer", version = 10.0 ) public class Main extends AbstractScript{ private int countOre; private GameObject rock; private GameObject goColor; private Timer timeInProgress = new Timer(); private String itemCount = "Copper ore"; private String status = "none"; @Override public void onStart() { countOre = 0; } @Override public int onLoop() { countOre = getInventory().count(itemCount); int rockOn = 4645; int rockOFF = 436; int getColorRock = goColor.getModelColors(); if( getColorRock == rockOn ) rock = getGameObjects().closest(f -> f.getName().contains("Rock")); rock.interact("Mine"); } return Calculations.random(1, 3); } How can I compare the color of the rock when it has mineral, and when it does not? Link to comment Share on other sites More sharing options...
Dogerina 330 Share Posted July 1, 2017 ty ty How can I compare the color of the rock when it has mineral, and when it does not? package Miner; import javafx.scene.control.ColorPicker; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.interactive.GameObject; import java.awt.*; @ScriptManifest( category = Category.MINING, name = "PowerMiner_10", author = "Mafer", version = 10.0 ) public class Main extends AbstractScript{ private int countOre; private GameObject rock; private GameObject goColor; private Timer timeInProgress = new Timer(); private String itemCount = "Copper ore"; private String status = "none"; @Override public void onStart() { countOre = 0; } @Override public int onLoop() { countOre = getInventory().count(itemCount); int rockOn = 4645; int rockOFF = 436; int getColorRock = goColor.getModelColors(); if( getColorRock == rockOn ) rock = getGameObjects().closest(f -> f.getName().contains("Rock")); rock.interact("Mine"); } return Calculations.random(1, 3); } How can I compare the color of the rock when it has mineral, and when it does not? getModelColors() returns an array, so you need to learn how arrays work. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html Link to comment Share on other sites More sharing options...
maferosrs 2 Author Share Posted July 2, 2017 getModelColors() returns an array, so you need to learn how arrays work. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html How can I compare the color of the rock when it has mineral, and when it does not? package Miner; import javafx.scene.control.ColorPicker; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.interactive.GameObject; import java.awt.*; @ScriptManifest( category = Category.MINING, name = "PowerMiner_10", author = "Mafer", version = 10.0 ) public class Main extends AbstractScript{ private int countOre; private GameObject rock; private Timer timeInProgress = new Timer(); private String itemCount = "Copper ore"; @Override public void onStart() { countOre = 0; } @Override public int onLoop() { countOre = getInventory().count(itemCount); int[] rockOn = {4645,436}; int[] getColorRock = getModelColors(); if( getColorRock == rockOn ) rock = getGameObjects().closest(f -> f.getName().contains("Rock")); rock.interact("Mine"); } return Calculations.random(1, 3); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.