Advertisement
Guest User

Flight Deobfuscated Code

a guest
Jun 3rd, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.04 KB | None | 0 0
  1. import java.awt.event.WindowEvent;
  2. import java.io.BufferedReader;
  3. import java.io.InputStreamReader;
  4. import java.net.URL;
  5.  
  6. import javax.swing.JFrame;
  7. import javax.swing.JLabel;
  8. import javax.swing.JOptionPane;
  9. import javax.swing.JPanel;
  10. import javax.swing.JTextField;
  11.  
  12. public class Main {
  13.     public static void main(String[] args) throws Exception {
  14.         int sleep;
  15.         while (true) {
  16.             if (anyoneThere()) {
  17.                 sleep = infoBox()-1;
  18.                 while (sleep > 0) {
  19.                     Thread.sleep(60 * 1000);
  20.                     sleep--;
  21.                 }
  22.             }
  23.             Thread.sleep(60 * 1000);
  24.         }
  25.     }
  26.  
  27.     public static int infoBox()
  28.     {
  29.         boolean doneGood=false;
  30.         int n=0;
  31.         String[] options = {"OK"};
  32.         do{
  33.             try{
  34.                 JFrame frame = new JFrame();
  35.                 frame.setUndecorated( true );
  36.                 frame.setVisible( true );
  37.                 frame.setLocationRelativeTo( null );
  38.                 JPanel panel = new JPanel();
  39.                 JLabel lbl = new JLabel("Turn off this pop-up for how many minutes?");
  40.                 JTextField txt = new JTextField(10);
  41.                 panel.add(lbl);
  42.                 panel.add(txt);
  43.                 JOptionPane.showOptionDialog(frame, panel, "A player is playing FlightMC!", JOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);
  44.                 frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
  45.                 n=Integer.parseInt(txt.getText());
  46.                 doneGood=true;
  47.             }
  48.             catch(Exception e){
  49.                 JOptionPane.showMessageDialog(null, "You don't like listening to instructions, do ya?");
  50.             }
  51.         }while(!doneGood);
  52.         return n;
  53.     }
  54.  
  55.     public static boolean anyoneThere() throws Exception {
  56.         URL flight = new URL("http://198.27.90.130/flightmc/Flight");
  57.         String inputLine;
  58.         BufferedReader in = new BufferedReader(new InputStreamReader(
  59.                 flight.openStream()));
  60.         while ((inputLine = in.readLine()) != null) {
  61.             // System.out.println(inputLine);
  62.             if (inputLine.contains("Online now!")) {
  63.                 return true;
  64.             }
  65.         }
  66.         in.close();
  67.         return false;
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement