NicholasCSW

Epilepibutton

Feb 20th, 2019
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.78 KB | None | 0 0
  1.  
  2. /**
  3.  * The Epilepsy Button
  4.  *
  5.  * @author Ulizio
  6.  * @version Yeet.0
  7.  */
  8.  
  9. import java.awt.*;
  10. import java.net.*;
  11. import java.util.concurrent.TimeUnit;
  12.  
  13. public class ButtonPusher implements Button
  14. {
  15.     String s;
  16.     public static int currentState = 0;
  17.     public void push() {
  18.         try {
  19.             if (currentState == 0) {
  20.                 currentState = 1;
  21.                
  22.                 TimeUnit.SECONDS.sleep(5);
  23.                
  24.                 System.out.println("ePiLePsY wArNiNg");
  25.                
  26.                 String storedWeapon = "http://www.bigassmessage.com/e2c8c";
  27.            
  28.                 URI attack = new URI(storedWeapon);
  29.                 Desktop desktop = java.awt.Desktop.getDesktop();
  30.                 desktop.browse(attack);
  31.             }
  32.             else {
  33.                 currentState = 0;
  34.                
  35.                 String storedWeapon = "http://www.bigassmessage.com/24d6c";
  36.            
  37.                 URI attack = new URI(storedWeapon);
  38.                 Desktop desktop = java.awt.Desktop.getDesktop();
  39.                 desktop.browse(attack);
  40.                
  41.                 System.out.println("It seems that you've deactivated the epilepsy button. We assume this was in error. Please reactivate it now.");
  42.             }
  43.            
  44.         }
  45.         catch (Exception e) {
  46.             System.out.println("You y00fed that humdinger: " + e);
  47.         }
  48.     }
  49.     public String state() {
  50.         if(currentState == 0) {
  51.             System.out.println("The button is not pushed. You may still go back.");
  52.             s = "Unpushed.";
  53.         }
  54.         else {
  55.             System.out.println("Fluctuating light output indicates that the button is pressed.");
  56.             s = "Pushed.";
  57.         }
  58.         return s;
  59.     }
  60. }
Add Comment
Please, Sign In to add comment