我正在尝试在 AppleScript 中创建代码,该代码将每 1-2 秒随机单击一次鼠标......我想要一个我正在玩的视频游戏不知道或能够告诉机器人正在为我点击,所以我需要它是随机的……不是每秒或每 2 秒,而是每 x 秒,其中 x 是一个在 1 到 2 秒之间不断变化的变量……这是到目前为止的代码,但它每 1 秒点击一次:
on idle
tell application "System Events"
key code 87
end tell
return 1
end idle
我认为改变return 1
toreturn random number 1 to 2
会起作用
像这样的东西:
on idle
tell application "System Events"
key code 87
end tell
set randomDelay to random number from 1 to 2
return randomDelay
end idle
但它没有工作/: