Elixar Posted April 16, 2018 Share Posted April 16, 2018 Trying to make my first script Looked at lots of post from 2014-2017 on the forum Has basic understanding of java Stolen some scripts to try reverse engineer then gave up because its not THA WAE Checked API but couldnt find anything because its my first time working with an api Followed @Explv Paint guide which is seemed to be the most credible but the code won't run Can someone please tell me why i get the errorError:(23, 9) java: 'catch' without 'try' import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest( author = "Elixar", name = "F2p King", info = "Eats ass", version = 1.0, logo = "https://i.imgur.com/a4BQ0h2.png") public class F2pKing2 extends Script { BufferedImage background; @Override public void onStart() { { background = ImageIO.read(F2pKing2.class.getResourceAsStream("/resources/background.png")); } catch(IOException e){ log(e); } } @Override public int onLoop(){ if (getInventory().contains("Fly fishing rod", "Feather")) { NPC spot = getNpcs().closest("Lure"); } return 1000; } @Override public void onExit(){ this.log ("Shutting Down F2p King"); } @Override public void onPaint(Graphics2D g) { if(background != null){ g.drawImage(background, null, x, y); } } } I assume theirs a problem with the 'Catch" method or whatever it is, Is their a library I'm missing that contains this code? Do i need some kind of java Import? Is catch Deprecated?! Link to comment Share on other sites More sharing options...
Chris Posted April 16, 2018 Share Posted April 16, 2018 learn basic java google try catch 2 Link to comment Share on other sites More sharing options...
Elixar Posted April 16, 2018 Author Share Posted April 16, 2018 (edited) Omfg I forgot the Trydelet this. ima kill myselfSorry everyone.AND I DIDNT EVEN IMPORT import javax.imageio.ImageIO; import java.io.IOException; import java.awt.image.BufferedImage; Learn from my pain children of the future Edited April 16, 2018 by Elixar 3 Link to comment Share on other sites More sharing options...