November 23, 20169 yr import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Umut", info = "Testing", name = "Mining Test", logo = "", version = 0) public class main extends Script { @@Override public void onStart() { log("Test"); } private enum State { MINE, DROP, WAIT }; private State getState() throws InterruptedException { Entity stall = objects.closest("Rocks"); inventory.dropAllExcept(1265); sleep(random(1000, 1500)); if (stall != null) return State.MINE; return State.WAIT; } @@Override public int onLoop() throws InterruptedException { switch (getState()) { case MINE: Entity stall = objects.closest("Rocks"); if (stall != null && !myPlayer().isAnimating()) { stall.interact("Mine"); } break; case DROP: inventory.dropAll(); break; case WAIT: sleep(random(500, 700)); break; } return random(200, 300); } { } } What could I improve on this script maybe like walking but I don´t know how to implement it any other suggestion or any help how to "bank walk" or walk to any specify area of rocks. Thanks anways
November 23, 20169 yr private State getState() throws InterruptedException { Entity stall = objects.closest("Rocks"); inventory.dropAllExcept(1265); sleep(random(1000, 1500)); if (stall != null) return State.MINE; return State.WAIT; } Live code does not belong in your getState() - don't even have to read through the script. This will only give you problems in the end.
November 23, 20169 yr Author private State getState() throws InterruptedException { Entity stall = objects.closest("Rocks"); inventory.dropAllExcept(1265); sleep(random(1000, 1500)); if (stall != null) return State.MINE; return State.WAIT; } Live code does not belong in your getState() - don't even have to read through the script. This will only give you problems in the end. Hmm okay thanks for that! Well im beginning :P
November 24, 20169 yr Author private State getState() throws InterruptedException { Entity stall = objects.closest("Rocks"); inventory.dropAllExcept(1265); sleep(random(1000, 1500)); if (stall != null) return State.MINE; return State.WAIT; } Live code does not belong in your getState() - don't even have to read through the script. This will only give you problems in the end. What should I do any advice?
November 24, 20169 yr What should I do any advice? dont drop anything in your get state or sleep in your get state. that all belongs in the loop