March 8, 20169 yr 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, 20169 yr by Sean001
March 8, 20169 yr 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, 20169 yr by Shudsy
March 8, 20169 yr Author 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, 20169 yr by Sean001
March 8, 20169 yr 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.
March 8, 20169 yr 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, 20169 yr by Vilius
March 8, 20169 yr 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)
March 8, 20169 yr Author 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
March 8, 20169 yr 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, 20169 yr by Shudsy
March 8, 20169 yr Author 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, 20169 yr by Sean001
March 8, 20169 yr 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?
March 8, 20169 yr Author 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
March 8, 20169 yr 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) { } }
March 8, 20169 yr Author 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.
March 8, 20169 yr 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, 20169 yr by Shudsy
March 8, 20169 yr Author 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, 20169 yr by Sean001
Create an account or sign in to comment