carellqs 0 Share Posted February 1, 2019 Hello, I started new script and trying to test it. I exported JAR and it appears in local scripts, but when i select it and press "START" nothing happens. No logs in debug console, just nothing. Every other script is fine and running, except for this. I can't find any answer, tried deleting Dreambot folder and restarting client. I'm running on ubuntu 18.10 with eclipse and running on oracle jdk 8. Does anyone had same problem or know how to solve it? Attached screenshot of script which i started. Link to comment Share on other sites More sharing options...
Vhagar 25 Share Posted February 2, 2019 Hi, I think your problem is caused by line 14 because you've assigned to the ash field too early, had something similar happen to me atleast. try assigning ash during the onLoop() method as I assume you want to continually pick up ash, probably worth also including a sleep so you're not constantly clicking on the item like: GroundItem ash; @Override public int onLoop() { ash = getGroundItems().closest(c -> c != null && c.getName().equals("Ash")); if (!getInventory().isFull()) { if (geArea.contains(getLocalPlayer())) { if (ash != null) { ash.interact("Take"); sleepUntil(() -> !ash.exists(), Calculations.random(2302, 3021)); } } } return Calculations.random(600, 1025); } If you did want to assign to 'ash ' only once do it during the onStart() method Link to comment Share on other sites More sharing options...
carellqs 0 Author Share Posted February 2, 2019 Thank you! It was the problem. But I can't understand why it wont work if i assigned value to ash object outside of onLoop method.. Link to comment Share on other sites More sharing options...
Vhagar 25 Share Posted February 2, 2019 No worries, I'm not sure exactly but I guess it's something to do with the getGameObject method being unavailable before the script has properly started. Link to comment Share on other sites More sharing options...
k0ni 7 Share Posted November 8, 2019 On 2/2/2019 at 1:22 PM, Vhagar said: On 2/2/2019 at 1:22 PM, Vhagar said: Hi, I think your problem is caused by line 14 because you've assigned to the ash field too early, had something similar happen to me atleast. try assigning ash during the onLoop() method as I assume you want to continually pick up ash, probably worth also including a sleep so you're not constantly clicking on the item like: GroundItem ash; @Override public int onLoop() { ash = getGroundItems().closest(c -> c != null && c.getName().equals("Ash")); if (!getInventory().isFull()) { if (geArea.contains(getLocalPlayer())) { if (ash != null) { ash.interact("Take"); sleepUntil(() -> !ash.exists(), Calculations.random(2302, 3021)); } } } return Calculations.random(600, 1025); } If you did want to assign to 'ash ' only once do it during the onStart() method Bro I fking love you. Ty Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.