cjeee Posted March 25, 2015 Posted March 25, 2015 (edited) EDIT: PROBLEM SOLVED, I JUST HAD TO CREATE A NEW PROJECT FILE I added a Log output within the onLoop method to see what is running and such, and im not recieving any output. My script isnt doing anything either. Maybe its the way i compiled it? I added the OSBot Jar to the build path, and Im using Eclipse. This Code was modified from this tutorial: http://osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/ I would really like to know what I am doing thats wrong. Please let me know ASAP, thanks Heres my simple ass code: import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "Droppa", author = "Daddy", version = 6.999999, info = "", logo = "") public class main extends Script { @Override public void onStart() { //Code here will execute before the loop is started log("Welcome to my script!!!"); } private enum State { DROP, WAIT }; private State getState() { if (!inventory.isEmpty()) return State.DROP; return State.WAIT; } @Override public int onLoop() throws InterruptedException { log("Running onLoop..."); switch (getState()) { log("Getting State..."); case DROP: inventory.dropAll(); log("Dropping..."); break; case WAIT: log("Waiting..."); sleep(random(50, 60)); break; } return random(200, 300); } @Override public void onExit() { //Code here will execute after the script ends log("Thanks!!!"); } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } Edited March 11, 2016 by cjeee
cjeee Posted March 25, 2015 Author Posted March 25, 2015 (edited) Nvm im dumb, i guess i cant add a log there because it messes with the decompiler lmao Edit: is there any way to get a log output between switch (getState()) { case DROP: within @Override public int onLoop() throws InterruptedException { log("Running onLoop..."); switch (getState()) { case DROP: inventory.dropAll(); log("Dropping..."); break; case WAIT: log("Waiting..."); sleep(random(50, 60)); break; } return random(200, 300); } i want to log it but i get a compiling error Edited March 25, 2015 by cjeee
Novak Posted March 25, 2015 Posted March 25, 2015 Nvm im dumb, i guess i cant add a log there because it messes with the decompiler lmao what? you are able to log in the loop, that is how i debug all of my scripts...
Novak Posted March 25, 2015 Posted March 25, 2015 you messed up your bracketing somewhere, make sure every opening bracket has a closing one
cjeee Posted March 25, 2015 Author Posted March 25, 2015 (edited) naa dude, when i take out that log output, everything is fine, So why cant i exactly use a log output in that specific location? btw, I coppied my code and made a new prject and everything is working just fine now!! woohoo! Edited March 11, 2016 by cjeee