I'm trying to create code in AppleScript that will click my mouse randomly every 1-2 seconds... I want a video game I'm playing to not know or be able to tell that a robot is clicking for me so I need it to be RANDOM... not every second or every 2 seconds but every x seconds where x is a constantly changing variable in-between 1 and 2 seconds... Here is the code so far but it clicks every 1 second:
on idle
tell application "System Events"
key code 87
end tell
return 1
end idle
I thought changing the return 1
to return random number 1 to 2
would work
Something like this:
on idle
tell application "System Events"
key code 87
end tell
set randomDelay to random number from 1 to 2
return randomDelay
end idle
but it didn't work /: