Advertisement
Stranck

Spammer avena

Jun 24th, 2020
1,496
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package it.spam;
  2.  
  3. import java.awt.Robot;
  4. import java.awt.Toolkit;
  5. import java.awt.datatransfer.Clipboard;
  6. import java.awt.datatransfer.StringSelection;
  7. import java.awt.event.KeyEvent;
  8. import java.util.Random;
  9.  
  10. public class PhraseSpammer {
  11.     public static final int DELAY = 250;
  12.     public static final String[] TEXTS = {
  13.             "you're not the number one",
  14.             "https://e621.net/posts/2162901?q=scat+order%3Afavcount_asc",
  15.             "https://e621.net/posts/1603526?q=scat+order%3Afavcount_asc",
  16.             "https://e621.net/posts/1947270?q=scat+order%3Afavcount_asc",
  17.             "https://e621.net/posts/1685639?q=scat+order%3Afavcount_asc",
  18.             "https://e621.net/posts/1645686?q=scat+order%3Afavcount_asc",
  19.             "https://e621.net/posts/2283706?q=scat",
  20.             "https://e621.net/posts/2287591?q=scat",
  21.             "https://e621.net/posts/2300579?q=scat",
  22.             "https://e621.net/posts/2302448?q=scat"
  23.         };
  24.    
  25.    
  26.     public static void send(Robot robot, Clipboard clipboard, Random r) {
  27.             clipBoard(TEXTS[r.nextInt(TEXTS.length)], clipboard);
  28.             robot.keyPress(KeyEvent.VK_CONTROL);
  29.             robot.keyPress(KeyEvent.VK_V);
  30.             robot.keyRelease(KeyEvent.VK_CONTROL);
  31.             robot.keyRelease(KeyEvent.VK_V);
  32.             robot.keyPress(KeyEvent.VK_ENTER);
  33.             robot.keyRelease(KeyEvent.VK_ENTER);
  34.             robot.delay(DELAY);
  35.     }
  36.    
  37.     public static void clipBoard(String text, Clipboard clipboard){
  38.         StringSelection stringSelection = new StringSelection(text);
  39.         try{
  40.             clipboard.setContents(stringSelection, stringSelection);
  41.         } catch(Exception e) {};
  42.     }
  43.    
  44.     public static void spammer() {
  45.         try {
  46.             Random rand = new Random();
  47.             Robot r = new Robot();
  48.             Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
  49.             System.out.println("Spam is starting in 5000 ms. Press Ctrl+c to exit.");
  50.             r.delay(5000);
  51.             while(true)
  52.                 send(r, clipboard, rand);
  53.         } catch (Exception e) {
  54.             e.printStackTrace();
  55.         }
  56.        
  57.     }
  58.    
  59.     public static void main(String[] args) {
  60.         spammer();
  61.     }
  62. }
Advertisement
RAW Paste Data Copied
Advertisement