wefwefwef222 0 Share Posted September 29, 2021 Hi, maybe there's a way to do this, but I haven't been able to figure it out. Constructing a Robot class to hold a key down doesn't work for me, and using the Keyboard.type() method just isn't the same as pressing and holding a key down (for fast menu selection). Would it be possible to get this method in the API? Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted September 29, 2021 23 minutes ago, wefwefwef222 said: Hi, maybe there's a way to do this, but I haven't been able to figure it out. Constructing a Robot class to hold a key down doesn't work for me, and using the Keyboard.type() method just isn't the same as pressing and holding a key down (for fast menu selection). Would it be possible to get this method in the API? https://dreambot.org/javadocs/org/dreambot/api/methods/input/Keyboard.html#holdKey(char,org.dreambot.api.utilities.impl.Condition,long) Link to comment Share on other sites More sharing options...
wefwefwef222 0 Author Share Posted September 29, 2021 36 minutes ago, Neffarion said: https://dreambot.org/javadocs/org/dreambot/api/methods/input/Keyboard.html#holdKey(char,org.dreambot.api.utilities.impl.Condition,long) Oops I forgot to mention that part... that method is broken (unless I'm doing something wrong). For example: Keyboard.holdKey('c', () -> false, 3000); Should hold c for 3 seconds, but it only enters c once, but doesn't hold it down. Not sure why... maybe I should make this a bug post instead. Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted September 30, 2021 17 hours ago, wefwefwef222 said: Oops I forgot to mention that part... that method is broken (unless I'm doing something wrong). For example: Keyboard.holdKey('c', () -> false, 3000); Should hold c for 3 seconds, but it only enters c once, but doesn't hold it down. Not sure why... maybe I should make this a bug post instead. I don't believe the method is supposed to "spam" the character, it just sets it as pressed until it timeouts or the condition is met What exactly are you talking about in "fast menu selection"? Link to comment Share on other sites More sharing options...
wefwefwef222 0 Author Share Posted October 1, 2021 On 9/30/2021 at 6:22 AM, Neffarion said: I don't believe the method is supposed to "spam" the character, it just sets it as pressed until it timeouts or the condition is met What exactly are you talking about in "fast menu selection"? It doesn't hold it down though. Imagine when you hold down a key on your keyboard... it starts repeating the character. Holding down "A" for 5 seconds would look something like "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA." Welp, it doesn't. Either way, the condition is not working correctly. Even if you do: Keyboard.holdSpace(() -> false, 5000); This has a condition which returns false, yet this method instantly returns after executing once. It *does* type the key (for example here, space) once, but no more than once. E.g.: log("1"); Keyboard.holdSpace(() -> false, 5000); log("2"); Output: 12:37:03 PM: [SCRIPT] 1 12:37:03 PM: [SCRIPT] 2 Notice how the script doesn't wait 5 seconds... it moves to the second logger within the same timestamp second. Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted October 1, 2021 2 hours ago, wefwefwef222 said: It doesn't hold it down though. Imagine when you hold down a key on your keyboard... it starts repeating the character. Holding down "A" for 5 seconds would look something like "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA." Welp, it doesn't. Either way, the condition is not working correctly. Even if you do: Keyboard.holdSpace(() -> false, 5000); This has a condition which returns false, yet this method instantly returns after executing once. It *does* type the key (for example here, space) once, but no more than once. E.g.: log("1"); Keyboard.holdSpace(() -> false, 5000); log("2"); Output: 12:37:03 PM: [SCRIPT] 1 12:37:03 PM: [SCRIPT] 2 Notice how the script doesn't wait 5 seconds... it moves to the second logger within the same timestamp second. Like I said, I don't think these methods are to be used for typing, you can use Keyboard.type() for that You can try for instance Keyboard.holdshift() to drop items for example and it works fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.