diff --git a/l4j/launch4jconfig.xml b/l4j/launch4jconfig.xml index b0bc81d..b3f21c8 100644 --- a/l4j/launch4jconfig.xml +++ b/l4j/launch4jconfig.xml @@ -24,12 +24,12 @@ 64/32 - 1.0.1.0 - 1.0.1 + 1.0.3.0 + 1.0.3 Anti-afk for FFXIV CP Systems - 1.0.1.0 - 1.0.1 + 1.0.3.0 + 1.0.3 Anti-afk for FFXIV cp-anti-afk diff --git a/src/main/java/com/cp/tools/antiafk/config/Configurer.java b/src/main/java/com/cp/tools/antiafk/config/Configurer.java index c8e5227..9f47bb8 100644 --- a/src/main/java/com/cp/tools/antiafk/config/Configurer.java +++ b/src/main/java/com/cp/tools/antiafk/config/Configurer.java @@ -4,6 +4,7 @@ import com.cp.tools.antiafk.config.model.KeyboardButton; import com.cp.tools.antiafk.config.model.MouseButton; import com.cp.tools.antiafk.util.SystemInputProcessor; +import com.sun.glass.ui.Robot; import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Marshaller; @@ -33,11 +34,11 @@ private static Configuration setupConfig() throws JAXBException { int minTime = processor.nextPositiveInt("Enter the MINIMUM amount of time to wait between executions (in seconds): "); int maxTime = processor.nextPositiveIntLargerThanOrEqualTo("Enter the MAXIMUM amount of time to wait between executions (in seconds): ", minTime); - boolean useMouse = processor.nextYesNoDecision("Use mouse instead of keyboard (yes/no): "); + boolean useMouse = processor.nextYesNoDecision("Use mouse instead of keyboard (yes/no)? "); Configuration config; if (useMouse) { - MouseButton key = processor.nextMouseButton("Type out the mouse button to press (valid options are RMB, LMB, MMB): "); + MouseButton key = processor.nextMouseButton("Type out the mouse button to press (valid options are LMB): "); config = new Configuration(minTime, maxTime, key); } else { KeyboardButton key = processor.nextKeyboardButton("Type out the key to press (valid options are SPACE, BACKSPACE, ENTER, I, U): "); diff --git a/src/main/java/com/cp/tools/antiafk/config/model/MouseButton.java b/src/main/java/com/cp/tools/antiafk/config/model/MouseButton.java index 4199a74..a78b334 100644 --- a/src/main/java/com/cp/tools/antiafk/config/model/MouseButton.java +++ b/src/main/java/com/cp/tools/antiafk/config/model/MouseButton.java @@ -3,9 +3,7 @@ import java.awt.event.MouseEvent; public enum MouseButton { - LMB(MouseEvent.BUTTON1), - RMB(MouseEvent.BUTTON2), - MMB(MouseEvent.BUTTON3); + LMB(MouseEvent.BUTTON1); private final int keyCode; diff --git a/src/main/java/com/cp/tools/antiafk/logic/AntiAfkProcess.java b/src/main/java/com/cp/tools/antiafk/logic/AntiAfkProcess.java index 670d6e2..d9c672c 100644 --- a/src/main/java/com/cp/tools/antiafk/logic/AntiAfkProcess.java +++ b/src/main/java/com/cp/tools/antiafk/logic/AntiAfkProcess.java @@ -11,6 +11,7 @@ import java.awt.*; import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; public class AntiAfkProcess { private static final Logger log = LoggerFactory.getLogger(AntiAfkProcess.class); @@ -20,6 +21,7 @@ public class AntiAfkProcess { private Configuration config; public AntiAfkProcess() throws JAXBException, AWTException { + log.info("{}", MouseInfo.getNumberOfButtons()); log.info("Starting program"); configure(); this.robot = new Robot(); @@ -55,7 +57,6 @@ private void press() { if (config.getMouseButtonToPress() != null) { MouseButton mb = config.getMouseButtonToPress(); log.info("Pressing [{}] mouse button now", mb); - robot.mousePress(InputEvent.getMaskForButton(mb.getKeyCode())); robot.delay(faker.number().numberBetween(10, 101)); robot.mouseRelease(InputEvent.getMaskForButton(mb.getKeyCode()));