-1

I wanna create a script for a game which presses 5 buttons but the keys get pressed in order of Priority on which skill is on cooldown:

Excample:

  1. Hold MB5
  2. Skill 1 fires(is now on cooldown)
  3. Skill 2 fires(is now on cooldown)
  4. Skill 3 fires(is now on cooldown)
  5. (Skill 1 off cooldown)
  6. Skill 1 fires(is now on cooldown)
  7. Skill 4 Fires(is now on cooldown)
  8. (Skill 2 off cooldown)
  9. Skill 2 fires(is now on cooldown)
  10. Skill 5 fires(is now on cooldown)

... and so on

My Problem:

Chaining key presses behind each other with press and release obv. doesnt work because after Skill 1, it fires Skills in random order.

Same problem seems to exist with Press and release all keys simultaniously. In that case it only works with a ~1sec delay.

I cant seem to work it out if this just isnt possible in Lua or if there are limitations of the game.

I know this is not a high priority topic but i would appreciate some help here :)

Have a great day :)

Schomi
  • 9
  • 4
  • Is cooldown time known for each skill? What is the time interval between skill key presses? Is it ok to press all 5 skills simultaneously at the beginning (because they all are currently not in cooldown)? – ESkri Aug 22 '23 at 08:13
  • @ESkri Hey, appreciate ur answer :) cooldown sadly varies with buffs.... I tried many time intervals from 50ms to 1000ms. Prefearably it should be less than 200ms on key presses... so pretty spammy its ok to press all keys simultaniously, yes :).... – Schomi Aug 23 '23 at 01:27
  • GHub is unable to look into your game to see if the cooldown is on or off. `cooldown sadly varies with buffs` - then maximum values should be used. Are they known? – ESkri Aug 23 '23 at 08:15
  • @ESkri "GHub is unable to look into your game to see if the cooldown is on or off." Yeah, i know. I thought. If i would do sth like this: `PressAndReleaseKey("1", "2", "3", "4", 5", "6")` it should always use the first available skill, for excample, when "1" and "2" are on cooldown, he uses "3" next. Sadly it still would use "4","5" or "6" at random even if "3" is not on cooldown. The maximum cooldown is known, but the Goal would be to use it earlyer if its shortened. I dont know if thats possible. I Hope im making it clear what im trying to archieve :) – Schomi Aug 23 '23 at 11:45
  • I also tried `PressAndReleaseKey("1") Sleep(math.random(10))` Followed by the keys 2 to 6 with a 100ms sleep after the chain. Still same result. these 2 were the first possible solutions that came to my mind. – Schomi Aug 23 '23 at 11:51
  • What is wrong with your solution `Press 1, wait 100ms, press 2, wait 100ms, ... press 6, wait 100ms, repeat from the beginning`? What is a typical cooldown time? Is it greater than 1 second? – ESkri Aug 23 '23 at 16:43
  • in ur excample he fires for excample 5 before he fired 3. Typical cooldown varies from 3 sec to 30sec. With a higher pause time than ~300ms he fires skills way too slow. The skills work in the correct order when i do sth like 1000ms pause but thats obv too long – Schomi Aug 23 '23 at 17:22
  • `if key1 =="e" then PressAndReleaseKey("7", "f") Sleep(math.random(90, 100)) PressAndReleaseKey("f", "r", "8", "f") Sleep(math.random(90, 100)) if not IsMouseButtonPressed(5) then break end end if key2 =="r" then PressAndReleaseKey("7", "f", "r", "8", "w", "f") Sleep(math.random(80, 100)) if not IsMouseButtonPressed(5) then break end ` – Schomi Aug 23 '23 at 17:26
  • at the moment i use this, which is a workaround where in most cases he presses the keys in the correct order.... but its not relieable sadly – Schomi Aug 23 '23 at 17:27
  • If `Press 1, wait 100ms, press 2,...` selects random skill then the game weirdly reacts on keyboard input. It's not a Lua/GHub issue. Maybe the game stops listening skill keys for a short period of time after any skill key is pressed. – ESkri Aug 23 '23 at 17:40
  • I expected something like this... sad! Thanks for ur input @ESkri ! – Schomi Aug 23 '23 at 18:50

0 Answers0