SHARE
TWEET

Untitled

a guest Mar 25th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Dimension;
  2. import java.awt.Robot;
  3. import java.awt.Toolkit;
  4. import java.awt.datatransfer.Clipboard;
  5. import java.awt.datatransfer.StringSelection;
  6. import java.awt.datatransfer.Transferable;
  7. import java.awt.event.InputEvent;
  8.    
  9. public class MouseMover
  10. {
  11.     static Robot bot = null;
  12.     static Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  13.     static double width = screenSize.getWidth();
  14.     static double height = screenSize.getHeight();
  15.    
  16.     public static void main(String... args) throws Exception
  17.     {          
  18.         bot = new Robot();
  19.         System.out.println("");
  20.    
  21.         Thread.sleep(3000);
  22.        
  23.         while(true)
  24.         {
  25.             Buy();
  26.             Thread.sleep(1000);
  27.             Sell();
  28.         }
  29.  
  30.     }
  31.        
  32.     public static void writeTextToClipboard(String s)
  33.     {
  34.         Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
  35.         Transferable transferable = new StringSelection(s);
  36.         clipboard.setContents(transferable, null);
  37.     }
  38.    
  39.     public static void PressButton(char i, int delay) throws InterruptedException
  40.     {
  41.         bot.keyPress(i - 32);
  42.         Thread.sleep(delay);
  43.         bot.keyRelease(i - 32);
  44.     }
  45.    
  46.     public static void PressButton(int i, int delay) throws InterruptedException
  47.     {
  48.         bot.keyPress(i);
  49.         Thread.sleep(delay);
  50.         bot.keyRelease(i);
  51.     }
  52.    
  53.     public static void RightClick(int delay) throws InterruptedException
  54.     {
  55.         bot.mousePress(InputEvent.BUTTON3_DOWN_MASK);
  56.         Thread.sleep(delay);
  57.         bot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK);
  58.     }
  59.    
  60.     public static void CtrlV() throws InterruptedException
  61.     {
  62.         bot.keyPress(17 );
  63.         bot.keyPress('v' - 32);
  64.        
  65.         Thread.sleep(250);
  66.        
  67.         bot.keyRelease('v' - 32);
  68.         bot.keyRelease(17);
  69.     }
  70.    
  71.  
  72.    
  73.     public static void Buy() throws InterruptedException
  74.     {
  75.         writeTextToClipboard("/wwarp rooky");
  76.         PressButton('t', 250);
  77.         CtrlV();
  78.         PressButton(10, 250);
  79.        
  80.        
  81.         Thread.sleep(4000);
  82.        
  83.         bot.mouseMove((int)(width * 0.38), (int)(height * 0.34259259259));
  84.        
  85.         RightClick(15*1000);
  86.        
  87.     }
  88.    
  89.     public static void Sell() throws InterruptedException
  90.     {
  91.         writeTextToClipboard("/home shop");
  92.         PressButton('t', 250);
  93.         CtrlV();
  94.         PressButton(10, 250);
  95.        
  96.         Thread.sleep(4000);
  97.        
  98.         RightClick(5*60*1000);
  99.     }
  100.    
  101. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top