Advertisement
TNT_Block

AutoClicker

May 1st, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package de.tnt_block_unkown.tntmod.modules.list;
  2.  
  3. import java.awt.Robot;
  4. import java.awt.event.InputEvent;
  5.  
  6. import org.lwjgl.input.Keyboard;
  7.  
  8. import de.tnt_block_unkown.tntmod.modules.Module;
  9. import de.tnt_block_unkown.tntmod.modules.ModuleType;
  10.  
  11. public class AutoClicker extends Module {
  12. private Robot r;
  13.  
  14. // Der delay zwischen den Clicks in Milisenkunden :D
  15. public static int delay;
  16. public static int button = InputEvent.BUTTON1_MASK;
  17.  
  18. public AutoClicker() {
  19. super("autoclicker", "AutoClicker", Keyboard.CHAR_NONE, ModuleType.AUTO);
  20. setup();
  21. }
  22.  
  23. @Override
  24. public void onUpdate() {
  25. clickMouse(button);
  26. }
  27.  
  28. public void setup() {
  29. try {
  30. r = new Robot();
  31. } catch (Exception e) {
  32. }
  33. delay = 300;
  34. }
  35.  
  36. public void clickMouse(int button) {
  37. try {
  38. r.mousePress(button);
  39. r.delay(250);
  40. r.mouseRelease(button);
  41. r.delay(delay);
  42. } catch (Exception e) {
  43.  
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement