markdmp Posted January 1, 2018 Share Posted January 1, 2018 I cannot seem to get past this error first get Error:(38, 5) java: cannot find symbol symbol: class Timer location: class Main.GEMaster public class GEMaster extends Script { long Timer; Area shopArea = new Area(2953, 3205, 2960, 3202); Area grandexchangeArea = GRAND_EXCHANGE; Area tradingArea = VARROCK_WEST; static String Status = "Normal"; boolean GotTradeOffer; Timer logTimer; Timer updateTimer; int numberofWSB; int numberofWLB; int numberofMSB; int numberofMLB; int numberofSA; int coinsinbank; if i use import java.util.Timer; i get Error:(51, 20) java: no suitable constructor found for Timer(int) constructor java.util.Timer.Timer(boolean) is not applicable (argument mismatch; int cannot be converted to boolean) constructor java.util.Timer.Timer(java.lang.String) is not applicable (argument mismatch; int cannot be converted to java.lang.String) so I add import java.util.Timer start; I end up getting Error:(21, 23) java: ';' expected noob coder buy the way just need a point in the way Quote Link to comment Share on other sites More sharing options...
Explv Posted January 1, 2018 Share Posted January 1, 2018 (edited) Yes you need: import java.util.Timer; Wherever you are instantiating the Timer, you're doing it wrong. Check the Java docs for the Timer class. And follow some basic Java tutorials. Also use a proper Java IDE, it will highlight where and what your errors are in your code. Edited January 1, 2018 by Explv Quote Link to comment Share on other sites More sharing options...
markdmp Posted January 1, 2018 Author Share Posted January 1, 2018 7 minutes ago, Explv said: Yes you need: import java.util.Timer; Wherever you are instantiating the Timer, you're doing it wrong. Check the Java docs for the Timer class. And follow some basic Java tutorials. Also use a proper Java IDE, it will highlight where and what your errors are in your code. thank you and all the error is in this part @Override public void onStart() throws InterruptedException { logTimer = new Timer(0); updateTimer = new Timer(0); Timer = System.currentTimeMillis(); try { File file = new File(getDirectoryData()+"info.txt"); if(!file.exists()) { file.createNewFile(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public int onLoop() throws InterruptedException { if(logTimer.Passed(1)){ log("Current money stock " + (int) inventory.getAmount("Coins")); log("Current money stock in bank " + coinsinbank); logTimer.reset(); } if(updateTimer.Passed(30)){ Update(); updateTimer.reset(); sleep(random(2000,3000)); } if(Status == "Normal") { if (!GotTradeOffer) { if (tabs.open(Tab.INVENTORY) && !trade.isFirstInterfaceOpen()) { if (inventory.contains("Willow longbow") && inventory.contains("Willow shortbow") && inventory.contains("Maple shortbow") && inventory.contains("Maple longbow")) { GoToShop(); } if (!inventory.contains("Willow longbow") || !inventory.contains("Willow shortbow") || !inventory.contains("Maple shortbow") || !inventory.contains("Maple longbow")) { GoToGe(); } } } else if (GotTradeOffer) { Trade(); } }else if (Status == "Muling"){ WalktoTrade(); } return 100; } Quote Link to comment Share on other sites More sharing options...
Explv Posted January 1, 2018 Share Posted January 1, 2018 1 minute ago, markdmp said: thank you and all the error is in this part @Override public void onStart() throws InterruptedException { logTimer = new Timer(0); updateTimer = new Timer(0); Timer = System.currentTimeMillis(); try { File file = new File(getDirectoryData()+"info.txt"); if(!file.exists()) { file.createNewFile(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public int onLoop() throws InterruptedException { if(logTimer.Passed(1)){ log("Current money stock " + (int) inventory.getAmount("Coins")); log("Current money stock in bank " + coinsinbank); logTimer.reset(); } if(updateTimer.Passed(30)){ Update(); updateTimer.reset(); sleep(random(2000,3000)); } if(Status == "Normal") { if (!GotTradeOffer) { if (tabs.open(Tab.INVENTORY) && !trade.isFirstInterfaceOpen()) { if (inventory.contains("Willow longbow") && inventory.contains("Willow shortbow") && inventory.contains("Maple shortbow") && inventory.contains("Maple longbow")) { GoToShop(); } if (!inventory.contains("Willow longbow") || !inventory.contains("Willow shortbow") || !inventory.contains("Maple shortbow") || !inventory.contains("Maple longbow")) { GoToGe(); } } } else if (GotTradeOffer) { Trade(); } }else if (Status == "Muling"){ WalktoTrade(); } return 100; } Ok well apparently I *still* have to do this for you... If you look at the docs for Timer: https://docs.oracle.com/javase/8/docs/api/java/util/Timer.html You will see there is no constructor that takes a number as the parameter. There is an empty constructor though. So just change new Timer(0) to new Timer() .............. 1 Quote Link to comment Share on other sites More sharing options...
markdmp Posted January 1, 2018 Author Share Posted January 1, 2018 33 minutes ago, Explv said: Ok well apparently I *still* have to do this for you... If you look at the docs for Timer: https://docs.oracle.com/javase/8/docs/api/java/util/Timer.html You will see there is no constructor that takes a number as the parameter. There is an empty constructor though. So just change new Timer(0) to new Timer() .............. thank you Quote Link to comment Share on other sites More sharing options...