foreverstudentoflife Posted March 9, 2022 Share Posted March 9, 2022 Hi, I'm trying to write a script to type random numbers from 1-5 with random delays in between. The script will end with my hotkey F1. It's not working too well. Where did I go wrong? Thanks in advance WinActivate("Notepad") HotKeySet("{F1}", "StopTYPE") Global $StopTYPE = False $random = Random(1, 5, 1) $time = Random(1000, 3000, 1) While 1 Sleep($time) Send("5") Sleep($time) If $StopTYPE Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2022 Developers Share Posted March 9, 2022 (edited) What exactly isn't working? Your code is sending a 5 at random times. ...and open the helpfile on how hotkeyset works. So why exact do you need something like this anyways? Edited March 9, 2022 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
foreverstudentoflife Posted March 9, 2022 Author Share Posted March 9, 2022 It's supposed to be sending random numbers 1-5 ;P Pressing F1 also doesnt seem to work at times Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2022 Developers Share Posted March 9, 2022 Understood... But you forgot to answer my second question. ..... So let's start with that. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
foreverstudentoflife Posted March 9, 2022 Author Share Posted March 9, 2022 It's for a game I play. I have to keep pressing these skill keys to unlock a skill. And these skills are on cooldown so I needed a random interval lol, skill 1-5 on my character screen. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2022 Developers Share Posted March 9, 2022 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts