TheGreatests Posted October 20, 2016 Share Posted October 20, 2016 Hello, I am reconstructing my script, and having just a tad of a issue with my brief code wondering if anyone has any time to give a hand or just put in your opinions on what is goiing on so I can troubleshoot it through that way. Here is the code, I will Highlight the issues that my eclipse is reading. package nodes; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.Client; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.Objects; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import data.Data; import Scripts.Node; public class ClayMine extends Node{ final int clay = 7454; final String ClayOre = "Clay"; Entity Ore = Objects.closest(data.clay); public ClayMine(Script sA) { super(sA); // TODO Auto-generated constructor stub } private Script s; private Data data; private Player me; private Inventory inv; @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer()); String status = "We're at north mining area"; } @[member=Override] public boolean execute() throws InterruptedException { if(Ore != null && data.ClayAreaN.contains(s.myPlayer())){ if(!s.myPlayer().isAnimating()){ Ore.interact("Mine"); String status = "Mining ore"; } return random(250,400); } break; } } The issues are highlighted in red, I am not entirely sure why I have to create a random method when its in the script package, and also if I am declaring entity wrong because its giving me a suggestion but I am pretty sure I am doing it right. I am grabbing the Clay Int from the data class. Quote Link to comment Share on other sites More sharing options...
Chris Posted October 20, 2016 Share Posted October 20, 2016 (edited) sA.random(250,400) or MethodProvider.random(250, 400); return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer()); script is already pass through. just do return sA.inventory.isEmpty() && data.ClayAreaN.contains(sA.myPlayer()); public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer()); //String status = "We're at north mining area"; } status will never be reached i dont think Edited October 20, 2016 by Chris Quote Link to comment Share on other sites More sharing options...
Team Cape Posted October 20, 2016 Share Posted October 20, 2016 (edited) im very confused by what youre doing theres a lot about what you're doing that i dont understand, but maybe this will help. public class ClayMine extends Node{ final int clay = 7454; final String ClayOre = "Clay"; private String status = ""; private Script sA; public ClayMine(Script sA) { super(sA); this.sA = sA; //you'll only need this if the parent class has //Script sA as private } @[member='Override'] public boolean validate() throws InterruptedException { if(sA.inventory.isEmpty() && Data.ClayAreaN.contains(s.myPlayer()) { status = "We're at north mining area"; return true; } return false; } @ Override public boolean execute() throws InterruptedException { Entity ore = sA.objects.closest(data.clay); if(ore != null && Data.ClayAreaN.contains(sA.myPlayer())){ if(!sA.myPlayer().isAnimating()){ ore.interact("Mine"); status = "Mining ore"; } return random(250,400); } break; } } also, you're aware that you just keep defining a new string status, but never use it, right? this code needs to be seriously restructured and heavily changed, would recommend starting over tbh. also i would recommend making any data from 'Data' public and static instead of defining an object 'Data' without apparent purpose... Edited October 20, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted October 20, 2016 Author Share Posted October 20, 2016 Entity Ore is also giving me suggestions but not entirely sure. I fixed the random sleeps. Tyvm Chris for the extra example!. s.objects.closest(data.clay); is giving me a suggestion// error also. Tried using RS2Object also... Quote Link to comment Share on other sites More sharing options...