Skip to content

Instantly share code, notes, and snippets.

@siukalov
Created December 20, 2020 01:19
Show Gist options
  • Save siukalov/8343d851c3c9fa2d5c10f3a8ef92a91a to your computer and use it in GitHub Desktop.
Save siukalov/8343d851c3c9fa2d5c10f3a8ef92a91a to your computer and use it in GitHub Desktop.
Automate cyberpunk 2077 crafting with Applescript and PlayStation remote play app
global ENTER_KEY_CODE, REPEAT_TIMES
set ENTER_KEY_CODE to 36
(* ↓ CHANGE THE AMOUNT FOR YOUR NEEDS *)
set TOTAL_CRAFTING_AMOUNT to 10
on focusRemotePlay()
tell application "RemotePlay" to activate
end focusRemotePlay
on pressEnter()
tell application "System Events" to key down ENTER_KEY_CODE
delay 1
tell application "System Events" to key up ENTER_KEY_CODE
end pressEnter
log "starting..."
focusRemotePlay()
repeat with counter from 1 to TOTAL_CRAFTING_AMOUNT
if frontmost of application "RemotePlay" is true then
pressEnter()
delay 0.1
log "Items crafted: " & counter
else
log "Remote Play has lost focus. Exiting."
exit repeat
end if
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment