Reid Posted January 7, 2014 Share Posted January 7, 2014 Enjoy /** * @author Reid (PurpleKush) * @param currVersion * @param txtLoc * @throws IOException */ public static void versionCheck(final String currVersion, final String txtLoc) throws IOException { final URL url = new URL(txtLoc); final BufferedReader file = new BufferedReader(new InputStreamReader(url.openStream())); final String onlineVersion = file.readLine(); file.close(); if (!onlineVersion.equals(currVersion)) { System.out.println("Version is Out of date"); JOptionPane.showMessageDialog(null,"Script is Out of date, get latest jar from thread!!!"); } else { System.out.println("Version is Up to date"); } } Link to comment Share on other sites More sharing options...
Jack Posted January 7, 2014 Share Posted January 7, 2014 so u host the text file on a website? where can i host? Link to comment Share on other sites More sharing options...
before Posted January 7, 2014 Share Posted January 7, 2014 uh how do I run dat doe Link to comment Share on other sites More sharing options...
BotRS123 Posted January 7, 2014 Share Posted January 7, 2014 Where was this a month ago? I did enjoy trying to figure it out. Link to comment Share on other sites More sharing options...
Fear Posted January 7, 2014 Share Posted January 7, 2014 uh how do I run dat doe Lol. Link to comment Share on other sites More sharing options...
Toph Posted January 7, 2014 Share Posted January 7, 2014 (edited) uh how do I run dat doe call versionCheck(final String currVersion, final String txtLoc) where currVersion is the local script's current version, and txtLoc is the location of an online .txt file containing only the version number (or a blank HTML site containing the same thing). Poor implementation, imo. Should be a boolean returning if it's current, not a void. Edited January 7, 2014 by Toph Link to comment Share on other sites More sharing options...
Reid Posted January 7, 2014 Author Share Posted January 7, 2014 call versionCheck(final String currVersion, final String txtLoc) where currVersion is the local script's current version, and txtLoc is the location of an online .txt file containing only the version number (or a blank HTML site containing the same thing). Poor implementation, imo. Should be a boolean returning if it's current, not a void. Agreed, this was one of my first java project lol i haven't updated it 1 Link to comment Share on other sites More sharing options...
lolmanden Posted January 11, 2014 Share Posted January 11, 2014 This is awesome and simple! Thanks Link to comment Share on other sites More sharing options...
mirojantti Posted January 15, 2014 Share Posted January 15, 2014 soo how do I use this? I have own website where I can host a html file containing the current version, but how do I get it to this script? Do I have to replace te textLoc and currVersion with something? please someone help me Link to comment Share on other sites More sharing options...
While Posted January 16, 2014 Share Posted January 16, 2014 soo how do I use this? I have own website where I can host a html file containing the current version, but how do I get it to this script? Do I have to replace te textLoc and currVersion with something? please someone help me txtLoc is the location of the file with the version and current version is....the current version Link to comment Share on other sites More sharing options...