Avali 0 Share Posted June 15, 2020 I have this from another post I was looking at from a while ago https://pastebin.com/rpxL6wWJ and in that, am I right to think that this script says that every rock close to the local player is one and if the color doesn't match the color of the rock that has ore in it, it wont mine it. Because I'm trying to write a script that will mine both copper and tin and then smelt it with the ability to bank ore and bars (I haven't gotten to making player smelt the ore, see as I'm asking how to mine) I already have areas setup for the different types of rocks to mine the ore at, but I don't know how to set the two types of rocks to be different. Also I need to figure out how to mine exactly half an inventory and then move to the next type of rock. Thanks! Link to comment Share on other sites More sharing options...
Xtra 31 Share Posted June 15, 2020 Hey, have you checked the javadocs for getModelColors() https://dreambot.org/javadocs/org/dreambot/api/wrappers/interactive/GameObject.html#getModelColors-- From another post: public enum Rock { CLAY(6705), COPPER(4645), TIN(53), IRON(2576), SILVER(74), COAL(10508), GOLD(8885), MITHRIL(-22239), ADAMANTITE(21662), RUNITE(-31437); public final short COLOUR; Rock(final int COLOUR) { this.COLOUR = (short) COLOUR; } } Example of usage: public GameObject getRockWithOre(Rock rock){ return getGameObjects().closest(obj -> { short[] colours = obj.getModelColors(); if(colours != null){ for(short c : colours){ if(c == rock.COLOUR) return true; } } return false; }); } Original post: Link to comment Share on other sites More sharing options...
Avali 0 Author Share Posted June 15, 2020 10 minutes ago, Xtra said: Hey, have you checked the javadocs for getModelColors() https://dreambot.org/javadocs/org/dreambot/api/wrappers/interactive/GameObject.html#getModelColors-- From another post: public enum Rock { CLAY(6705), COPPER(4645), TIN(53), IRON(2576), SILVER(74), COAL(10508), GOLD(8885), MITHRIL(-22239), ADAMANTITE(21662), RUNITE(-31437); public final short COLOUR; Rock(final int COLOUR) { this.COLOUR = (short) COLOUR; } } Example of usage: public GameObject getRockWithOre(Rock rock){ return getGameObjects().closest(obj -> { short[] colours = obj.getModelColors(); if(colours != null){ for(short c : colours){ if(c == rock.COLOUR) return true; } } return false; }); } Original post: Thank you for the reply, but I don't understand how to implement that into my script. I didn't learn java I have sorta been piecing together code and learner java along the way. So I really only know one method so far. But I think if there is a way to set it to only click a object with a specific ID in a specific tile that would at least work for now. Because I'm not clicking on one tile/rock the areas I have setup have 2-3 rocks next to them so I don't need a respawn timer, just click on the next rock. So if you know how to do that, that would be great. Also I'm using enums and cases for my script. Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted June 15, 2020 If your knowledge really is too low to implement what was posted above then you may want to consider visiting some java learning resources before trying to go any further, as you're going to struggle. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.