uyfgfarOS Posted January 8, 2021 Share Posted January 8, 2021 Hi all, been a while since I've been doing any sort of coding, but I wanted to script something to buy some grapes for me. Simple script but I can't get it to show up on the client. Any ideas? import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(info = "GRAPE BUYER", version = 1.0, logo = "", author = "MATT", name = "First Script") public class main extends Script { enum State { OPENCHEST, BUYGRAPES, BANK, HOP; } private State state; public void onStart(){ if(getInventory().isFull()){ state = State.BANK; } if (getInventory().onlyContains("Coins")) { state = State.OPENCHEST; } if (getInventory().contains("Coins") && getInventory().contains("Grapes") && !getInventory().isFull()) { state = State.BUYGRAPES; } if (!getStore().contains("Grapes")) { state = State.HOP; } } public int onLoop() throws InterruptedException{ switch (state){ case OPENCHEST: return openChest(); case BUYGRAPES: return buyGrapes(); case BANK: return bank(); case HOP: return hopWorlds(); } return random(10, 20); } int openChest() throws InterruptedException { objects.closest("Chest").interact("Buy-food"); sleep(300); return 0; } int buyGrapes() throws InterruptedException{ store.buy("Grapes", 10); sleep(300); return 0; } int bank() throws InterruptedException{ getBank().depositAllExcept("Coins"); sleep(300); return 0; } int hopWorlds() throws InterruptedException { getWorlds().hopToP2PWorld(); sleep(300); return 0; } } Quote Link to comment Share on other sites More sharing options...
Space Posted January 8, 2021 Share Posted January 8, 2021 Have you exported it as a .jar file and saved it to C:\Users\YOUR NAME\OSBot\Scripts" Quote Link to comment Share on other sites More sharing options...
uyfgfarOS Posted January 8, 2021 Author Share Posted January 8, 2021 Just now, Space said: Have you exported it as a .jar file and saved it to C:\Users\YOUR NAME\OSBot\Scripts" Thanks for the quick reply. Yes I have, got a couple of versions sat in that folder with different Java versions, just trying to get it to work. Quote Link to comment Share on other sites More sharing options...
Space Posted January 8, 2021 Share Posted January 8, 2021 1 hour ago, uyfgfarOS said: Thanks for the quick reply. Yes I have, got a couple of versions sat in that folder with different Java versions, just trying to get it to work. I assume you've also pressed the refresh button and searched for the file? Quote Link to comment Share on other sites More sharing options...
uyfgfarOS Posted January 8, 2021 Author Share Posted January 8, 2021 11 minutes ago, Space said: I assume you've also pressed the refresh button and searched for the file? I have mate yeah, OSBot's GUI is different to the last time I've used it. But I just click the refresh button and it just shows server scripts, non local. Quote Link to comment Share on other sites More sharing options...
uyfgfarOS Posted January 8, 2021 Author Share Posted January 8, 2021 (edited) Just loaded in an old NMZ script I had and it shows up. So something in the code or something? I've seen people post about SDK version but not sure how to check which one I've compiled my script with. EDIT: I've also noticed Eclipse keeps making a "module" when I create a new project? I've never seen this before. Have I set something up wrong or something? Because I've noticed when I keep the module in there all my code is red, but when I delete the module then all the red disappears. Edited January 8, 2021 by uyfgfarOS Quote Link to comment Share on other sites More sharing options...
uyfgfarOS Posted January 9, 2021 Author Share Posted January 9, 2021 SOLVED: For anyone else having this issue, I had to change the JRE environment to JavaSE-1.8, as it was on JavaSE-15 and it now works. Quote Link to comment Share on other sites More sharing options...