Butters Posted November 20, 2016 Share Posted November 20, 2016 Hey, Maybe someone could help me out with mining in OSBot? Can't figure out how to code a miner. Different rocks don't have a distinct name, so I though about hard coding ID's, but as it turns out, the ID's change. I failed to get objects (rocks) by position. Maybe it's possible to get rock objects and check if they are mined by colour/position? Any snippets regarding this will the greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Jammer Posted November 20, 2016 Share Posted November 20, 2016 Since all rocks are called the same i guess you need to use the position or color as you said. Don't know how tho, i just used id's. Quote Link to comment Share on other sites More sharing options...
Zerker Posted November 20, 2016 Share Posted November 20, 2016 public enum Rock { CLAY(6705), COPPER(4645), TIN(53), //modified colours of the ore of each rock in rs IRON(2576), SILVER(74), COAL(10508), GOLD(8885), MITHRIL(-22239), ADAMANTITE(21662), RUNITE(-31437); public final short COLOUR; Rock(int colour) { this.COLOUR = (short) colour; } } ? Quote Link to comment Share on other sites More sharing options...
Butters Posted November 20, 2016 Author Share Posted November 20, 2016 public enum Rock { CLAY(6705), COPPER(4645), TIN(53), //modified colours of the ore of each rock in rs IRON(2576), SILVER(74), COAL(10508), GOLD(8885), MITHRIL(-22239), ADAMANTITE(21662), RUNITE(-31437); public final short COLOUR; Rock(int colour) { this.COLOUR = (short) colour; } } ? Thanks, usefull info. But I can't find a method to get an object by colour. Quote Link to comment Share on other sites More sharing options...
Lemons Posted November 20, 2016 Share Posted November 20, 2016 Thanks, usefull info. But I can't find a method to get an object by colour. short[] colors = rock.getDefinition().getModifiedModelColors(); Quote Link to comment Share on other sites More sharing options...
Butters Posted November 20, 2016 Author Share Posted November 20, 2016 short[] colors = rock.getDefinition().getModifiedModelColors(); Thanks a lot Quote Link to comment Share on other sites More sharing options...
Explv Posted November 21, 2016 Share Posted November 21, 2016 (edited) Hey, Maybe someone could help me out with mining in OSBot? Can't figure out how to code a miner. Different rocks don't have a distinct name, so I though about hard coding ID's, but as it turns out, the ID's change. I failed to get objects (rocks) by position. Maybe it's possible to get rock objects and check if they are mined by colour/position? Any snippets regarding this will the greatly appreciated. I wrote a snippet for this a while ago: http://osbot.org/forum/topic/88389-mining-rocks-with-ore-no-ids/ Edited November 21, 2016 by Explv Quote Link to comment Share on other sites More sharing options...
Butters Posted November 22, 2016 Author Share Posted November 22, 2016 (edited) I wrote a snippet for this a while ago: http://osbot.org/forum/topic/88389-mining-rocks-with-ore-no-ids/ Greats, thanks. Way cleaner than the one I wrote Edited November 22, 2016 by krapstaunosi Quote Link to comment Share on other sites More sharing options...