Sean Posted March 8, 2016 Share Posted March 8, 2016 (edited) Was following this tutorial so shoutout to Apaec Bascially changing it up to make it pickpocket men in lumby. Problem I'm having currently is that the script won't start when I press the play button. So it doesn't run. Code here since people said post it import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.lang.Thread.State; @ScriptManifest(author = "Sean", info = "My first script", name = "Man Pickpocketer", version = 0, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to my Trial Script (Thieving)"); } private enum State { PICKPOCKET, WAIT; }; private State getState(){ NPC Man = npcs.closest("Man"); if (Man != null) return State.PICKPOCKET; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case PICKPOCKET: NPC Man = npcs.closest("Man"); if (Man !=null) { Man.interact("Pickpocket"); } break; case WAIT: sleep(random(400,600)); break; } return random(200, 300); } @Override public void onExit() { log("Thx for using this script"); } @Override public void onPaint(Graphics2D g) { } } Edited March 9, 2016 by Sean001 Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 (edited) You could probably just post your code here. I don't see why you're protective of a lumby pickpocker that (maybe) doesn't work. Unless you really don't want anyone to see it Edited March 8, 2016 by Shudsy 1 Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 (edited) You could probably just post your code here. I don't see why you're protective of a lumby pickpocker that doesn't work. Unless you really don't want anyone to see it I could but don't want to embarrass myself if I did something retarded lol Edited March 8, 2016 by Sean001 Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 I could but don't want to embarrass myself if I did something retarded lol If you're just starting out it doesn't really matter? take priority in learning over your one day of java pride. If you're starting out we expect to see faults in the code anyway. Quote Link to comment Share on other sites More sharing options...
Vilius Posted March 8, 2016 Share Posted March 8, 2016 (edited) I'm just guessing that you dont have your ScripManifest @ScriptManifest ... class test extends Script{ } You will need to import it and add the methods. And post your code, people are glad to help others, no shame in what you have. We will give you tips etc. Edited March 8, 2016 by Vilius Quote Link to comment Share on other sites More sharing options...
Chris Posted March 8, 2016 Share Posted March 8, 2016 Post code || make sure you have a ScriptManifest //Example @ScriptManifest(author = "Sinatra", name = "Trinity Dragons", info = "", logo = "http://i.imgur.com/MCq1qNX.png", version = 5.5) Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 If you're just starting out it doesn't really matter? take priority in learning over your one day of java pride. If you're starting out we expect to see faults in the code anyway. I'm just guessing that you dont have your ScripManifest @ScriptManifest ... class test extends Script{ } You will need to import it and add the methods. And post your code, people are glad to help others, no shame in what you have. We will give you tips etc. Post code || make sure you have a ScriptManifest //Example @ScriptManifest(author = "Sinatra", name = "Trinity Dragons", info = "", logo = "http://i.imgur.com/MCq1qNX.png", version = 5.5) posted code Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 (edited) Man is a NPC not a object. NPC man = npcs.closest("man"); You're also missing a " after your name in the manifest. Edited March 8, 2016 by Shudsy Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 (edited) Man is a NPC not a object. NPC man = npcs.closest("man"); You're also missing a " after your name in the manifest. Thank you changed that but the script still doesn't show up as a local script on the osbot client which is my main issue. Edit: I see alot of red "X" by the lines of my code. Is that an issue? (assuming) Edited March 8, 2016 by Sean001 Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 Thank you changed that but the script still doesn't show up as a local script on the osbot client which is my main issue. And you've compiled your script and put the .jar file in the osbot folder? Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 And you've compiled your script and put the .jar file in the osbot folder? Yea I put it here C:\Users\Sean\OSBot\Scripts\TrialScript.jar Also got an "x" here though Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.lang.Thread.State; @ScriptManifest(author = "Sean", info = "My first script", name = "Man Pickpocketer", version = 0, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to my Trial Script (Thieving)"); } private enum State { PICKPOCKET, WAIT; }; private State getState(){ NPC Man = npcs.closest("Man"); if (Man != null) return State.PICKPOCKET; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case PICKPOCKET: NPC Man = npcs.closest("Man"); if (Man !=null) { Man.interact("Pickpocket"); } break; case WAIT: sleep(random(400,600)); break; } return random(200, 300); } @Override public void onExit() { log("Thx for using this script"); } @Override public void onPaint(Graphics2D g) { } } Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.lang.Thread.State; @ScriptManifest(author = "Sean", info = "My first script", name = "Man Pickpocketer", version = 0, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to my Trial Script (Thieving)"); } private enum State { PICKPOCKET, WAIT; }; private State getState(){ NPC Man = npcs.closest("Man"); if (Man != null) return State.PICKPOCKET; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case PICKPOCKET: NPC Man = npcs.closest("Man"); if (Man !=null) { Man.interact("Pickpocket"); } break; case WAIT: sleep(random(400,600)); break; } return random(200, 300); } @Override public void onExit() { log("Thx for using this script"); } @Override public void onPaint(Graphics2D g) { } } Thx for the corrections Figured out why it wasn't appearing on my scripts list so that's fixed. Only problem Im having now is it won't start when I press the play button. Quote Link to comment Share on other sites More sharing options...
Shudsy Posted March 8, 2016 Share Posted March 8, 2016 (edited) Thx for the corrections Figured out why it wasn't appearing on my scripts list so that's fixed. Only problem Im having now is it won't start when I press the play button. If you're looking for help then you need to start giving more specific questions. "Not starting" doesn't really help. Does the script start but it stands there and does nothing? or you cant even start it? put logs on your states and see if they log. Edited March 8, 2016 by Shudsy Quote Link to comment Share on other sites More sharing options...
Sean Posted March 8, 2016 Author Share Posted March 8, 2016 (edited) If you're looking for help then you need to start giving more specific questions. "Not starting" doesn't really help. Does the script start but it stands there and does nothing? or you cant even start it? put logs on your states and see if they log. When I press the play button. The script in general doesn't start so nothing happens. I don't get the stop button appearing so I can't even start it. Edit: Im off pc now so any code changes will need to happen tomorrow. Edited March 8, 2016 by Sean001 Quote Link to comment Share on other sites More sharing options...