Advertisement
nakedscripts

Untitled

Jun 13th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.62 KB | None | 0 0
  1. package org.sortes23_1.banAppealer;
  2.  
  3. import java.awt.Color;
  4. import java.awt.EventQueue;
  5. import java.awt.Font;
  6. import java.awt.LayoutManager;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. import java.io.File;
  10. import java.util.ArrayList;
  11. import java.util.concurrent.ThreadLocalRandom;
  12. import javax.swing.JButton;
  13. import javax.swing.JFileChooser;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16. import javax.swing.JPanel;
  17. import javax.swing.JTextArea;
  18. import javax.swing.border.EmptyBorder;
  19. import javax.swing.filechooser.FileNameExtensionFilter;
  20.  
  21. public class BanAppealer extends JFrame {
  22.   private static final long serialVersionUID = 1L;
  23.  
  24.   private JPanel contentPane;
  25.  
  26.   static JLabel lblNewLabel_2;
  27.  
  28.   static JTextArea textArea;
  29.  
  30.   public static void main(String[] args) {
  31.     EventQueue.invokeLater(new Runnable() {
  32.           public void run() {
  33.             try {
  34.               BanAppealer frame = new BanAppealer();
  35.               frame.setVisible(true);
  36.             } catch (Exception e) {
  37.               e.printStackTrace();
  38.             }
  39.           }
  40.         });
  41.     while (true) {
  42.       sleep(100);
  43.       if (!paused && accountsList.size() > 0 && proxiesList.size() > 0) {
  44.         for (int c = 1; c <= accountsList.size(); c++) {
  45.           sleep(4000, 8000);
  46.           lblNewLabel_2.setText("Appealed accounts:" + c);
  47.           if (paused) {
  48.             textArea.setText("Paused");
  49.             for (; paused && !clear; sleep(100));
  50.           }
  51.           if (clear) {
  52.             textArea.setText("Stopped and cleared");
  53.             break;
  54.           }
  55.         }
  56.         paused = true;
  57.       } else {
  58.         paused = true;
  59.       }
  60.       if (clear) {
  61.         clear = false;
  62.         paused = true;
  63.         lblNewLabel_2.setText("Appealed accounts:");
  64.       }
  65.     }
  66.   }
  67.  
  68.   public BanAppealer() {
  69.     setTitle("Sortes23_1 Ban Appealer v0.01");
  70.     setDefaultCloseOperation(3);
  71.     setBounds(100, 100, 338, 196);
  72.     this.contentPane = new JPanel();
  73.     this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  74.     setContentPane(this.contentPane);
  75.     this.contentPane.setLayout((LayoutManager)null);
  76.     final JLabel lblNewLabel = new JLabel("Accounts loaded:");
  77.     lblNewLabel.setFont(new Font("Dialog", 1, 14));
  78.     lblNewLabel.setBounds(22, 39, 180, 15);
  79.     this.contentPane.add(lblNewLabel);
  80.     final JLabel lblNewLabel_1 = new JLabel("Proxies loaded:");
  81.     lblNewLabel_1.setFont(new Font("Dialog", 1, 14));
  82.     lblNewLabel_1.setBounds(22, 12, 180, 15);
  83.     this.contentPane.add(lblNewLabel_1);
  84.     lblNewLabel_2 = new JLabel("Appealed accounts:");
  85.     lblNewLabel_2.setFont(new Font("Dialog", 1, 14));
  86.     lblNewLabel_2.setBounds(22, 66, 180, 15);
  87.     this.contentPane.add(lblNewLabel_2);
  88.     textArea = new JTextArea();
  89.     textArea.setBackground(new Color(238, 238, 238));
  90.     textArea.setWrapStyleWord(true);
  91.     textArea.setLineWrap(true);
  92.     textArea.setEditable(false);
  93.     textArea.setBounds(175, 12, 140, 15);
  94.     this.contentPane.add(textArea);
  95.     JButton button = new JButton("Load proxies");
  96.     button.addActionListener(new ActionListener() {
  97.           public void actionPerformed(ActionEvent e) {
  98.             BanAppealer.proxiesList.clear();
  99.             boolean loadedProxies = false;
  100.             synchronized (BanAppealer.lock1) {
  101.               JFileChooser chooser = new JFileChooser();
  102.               FileNameExtensionFilter filter = new FileNameExtensionFilter("txt files only", new String[] { "txt" });
  103.               chooser.setFileFilter(filter);
  104.               int returnVal = chooser.showOpenDialog(null);
  105.               if (returnVal == 0) {
  106.                 String chosenFileAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
  107.                 try {
  108.                   File file = new File(chosenFileAbsolutePath);
  109.                   if (file.exists()) {
  110.                     Exception exception1 = null, exception2 = null;
  111.                   } else {
  112.                     BanAppealer.textArea.setText("File does not exist");
  113.                   }
  114.                 } catch (Exception e1) {
  115.                   e1.printStackTrace();
  116.                   BanAppealer.textArea.setText("Proxies load error");
  117.                 }
  118.               }
  119.             }
  120.             if (loadedProxies) {
  121.               BanAppealer.textArea.setText("Proxies loaded");
  122.               lblNewLabel_1.setText("Proxies loaded:" + BanAppealer.proxiesList.size());
  123.             }
  124.           }
  125.         });
  126.     button.setBounds(175, 130, 140, 25);
  127.     this.contentPane.add(button);
  128.     JButton button_1 = new JButton("Load accounts");
  129.     button_1.addActionListener(new ActionListener() {
  130.           public void actionPerformed(ActionEvent e) {
  131.             BanAppealer.accountsList.clear();
  132.             boolean loadedAccounts = false;
  133.             synchronized (BanAppealer.lock1) {
  134.               JFileChooser chooser = new JFileChooser();
  135.               FileNameExtensionFilter filter = new FileNameExtensionFilter("txt files only", new String[] { "txt" });
  136.               chooser.setFileFilter(filter);
  137.               int returnVal = chooser.showOpenDialog(null);
  138.               if (returnVal == 0) {
  139.                 String chosenFileAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
  140.                 try {
  141.                   File file = new File(chosenFileAbsolutePath);
  142.                   if (file.exists()) {
  143.                     Exception exception1 = null, exception2 = null;
  144.                   } else {
  145.                     BanAppealer.textArea.setText("File does not exist");
  146.                   }
  147.                 } catch (Exception e1) {
  148.                   e1.printStackTrace();
  149.                   BanAppealer.textArea.setText("Accounts load error");
  150.                 }
  151.               }
  152.             }
  153.             if (loadedAccounts) {
  154.               BanAppealer.textArea.setText("Accounts loaded");
  155.               lblNewLabel.setText("Accounts loaded:" + BanAppealer.accountsList.size());
  156.             }
  157.           }
  158.         });
  159.     button_1.setBounds(22, 130, 140, 25);
  160.     this.contentPane.add(button_1);
  161.     JButton button_2 = new JButton("Start/Pause");
  162.     button_2.addActionListener(new ActionListener() {
  163.           public void actionPerformed(ActionEvent e) {
  164.             if (BanAppealer.paused && BanAppealer.accountsList.size() > 0 && BanAppealer.proxiesList.size() > 0) {
  165.               BanAppealer.textArea.setText("Started");
  166.               BanAppealer.paused = false;
  167.             } else if (!BanAppealer.paused) {
  168.               BanAppealer.paused = true;
  169.             }
  170.           }
  171.         });
  172.     button_2.setBounds(22, 93, 140, 25);
  173.     this.contentPane.add(button_2);
  174.     JButton button_3 = new JButton("Stop/Clear");
  175.     button_3.addActionListener(new ActionListener() {
  176.           public void actionPerformed(ActionEvent e) {
  177.             BanAppealer.clear = true;
  178.           }
  179.         });
  180.     button_3.setBounds(175, 93, 140, 25);
  181.     this.contentPane.add(button_3);
  182.   }
  183.  
  184.   private static void sleep(int time) {
  185.     try {
  186.       Thread.sleep(time);
  187.     } catch (InterruptedException e) {
  188.       e.printStackTrace();
  189.     }
  190.   }
  191.  
  192.   private static void sleep(int minTime, int maxTime) {
  193.     try {
  194.       Thread.sleep(ThreadLocalRandom.current().nextInt(minTime, maxTime));
  195.     } catch (InterruptedException e) {
  196.       e.printStackTrace();
  197.     }
  198.   }
  199.  
  200.   static ArrayList<Proxy> proxiesList = new ArrayList<>();
  201.  
  202.   static ArrayList<Account> accountsList = new ArrayList<>();
  203.  
  204.   static Object lock1 = new Object();
  205.  
  206.   static boolean paused = true;
  207.  
  208.   static boolean clear = false;
  209.  
  210.   static int appealedAccounts = 0;
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement