Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.sortes23_1.banAppealer;
- import java.awt.Color;
- import java.awt.EventQueue;
- import java.awt.Font;
- import java.awt.LayoutManager;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.File;
- import java.util.ArrayList;
- import java.util.concurrent.ThreadLocalRandom;
- import javax.swing.JButton;
- import javax.swing.JFileChooser;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JTextArea;
- import javax.swing.border.EmptyBorder;
- import javax.swing.filechooser.FileNameExtensionFilter;
- public class BanAppealer extends JFrame {
- private static final long serialVersionUID = 1L;
- private JPanel contentPane;
- static JLabel lblNewLabel_2;
- static JTextArea textArea;
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- BanAppealer frame = new BanAppealer();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- while (true) {
- sleep(100);
- if (!paused && accountsList.size() > 0 && proxiesList.size() > 0) {
- for (int c = 1; c <= accountsList.size(); c++) {
- sleep(4000, 8000);
- lblNewLabel_2.setText("Appealed accounts:" + c);
- if (paused) {
- textArea.setText("Paused");
- for (; paused && !clear; sleep(100));
- }
- if (clear) {
- textArea.setText("Stopped and cleared");
- break;
- }
- }
- paused = true;
- } else {
- paused = true;
- }
- if (clear) {
- clear = false;
- paused = true;
- lblNewLabel_2.setText("Appealed accounts:");
- }
- }
- }
- public BanAppealer() {
- setTitle("Sortes23_1 Ban Appealer v0.01");
- setDefaultCloseOperation(3);
- setBounds(100, 100, 338, 196);
- this.contentPane = new JPanel();
- this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(this.contentPane);
- this.contentPane.setLayout((LayoutManager)null);
- final JLabel lblNewLabel = new JLabel("Accounts loaded:");
- lblNewLabel.setFont(new Font("Dialog", 1, 14));
- lblNewLabel.setBounds(22, 39, 180, 15);
- this.contentPane.add(lblNewLabel);
- final JLabel lblNewLabel_1 = new JLabel("Proxies loaded:");
- lblNewLabel_1.setFont(new Font("Dialog", 1, 14));
- lblNewLabel_1.setBounds(22, 12, 180, 15);
- this.contentPane.add(lblNewLabel_1);
- lblNewLabel_2 = new JLabel("Appealed accounts:");
- lblNewLabel_2.setFont(new Font("Dialog", 1, 14));
- lblNewLabel_2.setBounds(22, 66, 180, 15);
- this.contentPane.add(lblNewLabel_2);
- textArea = new JTextArea();
- textArea.setBackground(new Color(238, 238, 238));
- textArea.setWrapStyleWord(true);
- textArea.setLineWrap(true);
- textArea.setEditable(false);
- textArea.setBounds(175, 12, 140, 15);
- this.contentPane.add(textArea);
- JButton button = new JButton("Load proxies");
- button.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- BanAppealer.proxiesList.clear();
- boolean loadedProxies = false;
- synchronized (BanAppealer.lock1) {
- JFileChooser chooser = new JFileChooser();
- FileNameExtensionFilter filter = new FileNameExtensionFilter("txt files only", new String[] { "txt" });
- chooser.setFileFilter(filter);
- int returnVal = chooser.showOpenDialog(null);
- if (returnVal == 0) {
- String chosenFileAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
- try {
- File file = new File(chosenFileAbsolutePath);
- if (file.exists()) {
- Exception exception1 = null, exception2 = null;
- } else {
- BanAppealer.textArea.setText("File does not exist");
- }
- } catch (Exception e1) {
- e1.printStackTrace();
- BanAppealer.textArea.setText("Proxies load error");
- }
- }
- }
- if (loadedProxies) {
- BanAppealer.textArea.setText("Proxies loaded");
- lblNewLabel_1.setText("Proxies loaded:" + BanAppealer.proxiesList.size());
- }
- }
- });
- button.setBounds(175, 130, 140, 25);
- this.contentPane.add(button);
- JButton button_1 = new JButton("Load accounts");
- button_1.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- BanAppealer.accountsList.clear();
- boolean loadedAccounts = false;
- synchronized (BanAppealer.lock1) {
- JFileChooser chooser = new JFileChooser();
- FileNameExtensionFilter filter = new FileNameExtensionFilter("txt files only", new String[] { "txt" });
- chooser.setFileFilter(filter);
- int returnVal = chooser.showOpenDialog(null);
- if (returnVal == 0) {
- String chosenFileAbsolutePath = chooser.getSelectedFile().getAbsolutePath();
- try {
- File file = new File(chosenFileAbsolutePath);
- if (file.exists()) {
- Exception exception1 = null, exception2 = null;
- } else {
- BanAppealer.textArea.setText("File does not exist");
- }
- } catch (Exception e1) {
- e1.printStackTrace();
- BanAppealer.textArea.setText("Accounts load error");
- }
- }
- }
- if (loadedAccounts) {
- BanAppealer.textArea.setText("Accounts loaded");
- lblNewLabel.setText("Accounts loaded:" + BanAppealer.accountsList.size());
- }
- }
- });
- button_1.setBounds(22, 130, 140, 25);
- this.contentPane.add(button_1);
- JButton button_2 = new JButton("Start/Pause");
- button_2.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (BanAppealer.paused && BanAppealer.accountsList.size() > 0 && BanAppealer.proxiesList.size() > 0) {
- BanAppealer.textArea.setText("Started");
- BanAppealer.paused = false;
- } else if (!BanAppealer.paused) {
- BanAppealer.paused = true;
- }
- }
- });
- button_2.setBounds(22, 93, 140, 25);
- this.contentPane.add(button_2);
- JButton button_3 = new JButton("Stop/Clear");
- button_3.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- BanAppealer.clear = true;
- }
- });
- button_3.setBounds(175, 93, 140, 25);
- this.contentPane.add(button_3);
- }
- private static void sleep(int time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- private static void sleep(int minTime, int maxTime) {
- try {
- Thread.sleep(ThreadLocalRandom.current().nextInt(minTime, maxTime));
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- static ArrayList<Proxy> proxiesList = new ArrayList<>();
- static ArrayList<Account> accountsList = new ArrayList<>();
- static Object lock1 = new Object();
- static boolean paused = true;
- static boolean clear = false;
- static int appealedAccounts = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement