saliacoel commited on
Commit
e456ece
·
verified ·
1 Parent(s): 417419b

Upload AHK_PromptAuto.ahk

Browse files
Files changed (1) hide show
  1. AHK_PromptAuto.ahk +168 -0
AHK_PromptAuto.ahk ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #Requires AutoHotkey v2.0
2
+ #SingleInstance Force
3
+
4
+ ; =========================
5
+ ; INPUT VARIABLES
6
+ ; =========================
7
+
8
+ ; Pixel position of "remix button"
9
+ remixButtonX := 0
10
+ remixButtonY := 0
11
+
12
+ ; Pixel position of "picture button"
13
+ pictureButtonX := 0
14
+ pictureButtonY := 0
15
+
16
+ ; START at CURRENT ID
17
+ START_CURRENT_ID := 1
18
+
19
+ ; =========================
20
+ ; PROMPTS
21
+ ; =========================
22
+
23
+ prompts := [
24
+ "a male rogue with a hood and a knife and he looks sneaky",
25
+ "a male warrior with a sword looking mean",
26
+ "a female healer who has a white robe looking healy"
27
+ ]
28
+
29
+ ; =========================
30
+ ; SAFETY CHECK
31
+ ; =========================
32
+
33
+ if (remixButtonX = 0 || remixButtonY = 0 || pictureButtonX = 0 || pictureButtonY = 0) {
34
+ MsgBox "Edit the button pixel positions at the top of the script before running."
35
+ ExitApp
36
+ }
37
+
38
+ if (START_CURRENT_ID < 1 || START_CURRENT_ID > prompts.Length) {
39
+ MsgBox "START_CURRENT_ID is outside the prompt list."
40
+ ExitApp
41
+ }
42
+
43
+ ; Use screen pixel coordinates for clicks
44
+ CoordMode "Mouse", "Screen"
45
+ SendMode "Input"
46
+ SetKeyDelay 50, 50
47
+ SetMouseDelay 50
48
+
49
+ ; Save current clipboard so it can be restored later
50
+ oldClipboard := A_Clipboard
51
+
52
+ currentID := START_CURRENT_ID
53
+
54
+ ; =========================
55
+ ; MAIN LOOP
56
+ ; Runs until CURRENT ID runs out of prompts
57
+ ; =========================
58
+
59
+ while (currentID <= prompts.Length) {
60
+
61
+ currentPrompt := prompts[currentID]
62
+
63
+ ; wait 1 sec
64
+ Sleep 1000
65
+
66
+ ; CONTROL+L
67
+ Send "^l"
68
+
69
+ ; type URL
70
+ Sleep 200
71
+ SendText "https://sora.chatgpt.com/g/gen_01kph9ac6sf54a370pd1v039kr"
72
+
73
+ ; press ENTER
74
+ Send "{Enter}"
75
+
76
+ ; wait 3 sec
77
+ Sleep 3000
78
+
79
+ ; press E
80
+ Send "e"
81
+
82
+ ; wait 1 sec
83
+ Sleep 1000
84
+
85
+ ; control+a
86
+ Send "^a"
87
+
88
+ ; wait 1 sec
89
+ Sleep 1000
90
+
91
+ ; delete
92
+ Send "{Delete}"
93
+
94
+ ; wait 1 sec
95
+ Sleep 1000
96
+
97
+ ; COPY the current prompt into clipboard
98
+ A_Clipboard := ""
99
+ A_Clipboard := currentPrompt
100
+ ClipWait 2
101
+
102
+ ; wait 1 sec
103
+ Sleep 1000
104
+
105
+ ; control+V
106
+ Send "^v"
107
+
108
+ ; wait 1 sec
109
+ Sleep 1000
110
+
111
+ ; click remix button
112
+ Click remixButtonX, remixButtonY
113
+
114
+ ; wait 60 sec
115
+ Sleep 60000
116
+
117
+ ; press ESC
118
+ Send "{Esc}"
119
+
120
+ ; wait 2 sec
121
+ Sleep 2000
122
+
123
+ ; press top of page button, called Pos1/Home
124
+ Send "{Home}"
125
+
126
+ ; wait 1 sec
127
+ Sleep 1000
128
+
129
+ ; click picture button
130
+ Click pictureButtonX, pictureButtonY
131
+
132
+ ; wait 1 sec
133
+ Sleep 1000
134
+
135
+ ; Download/select sequence
136
+ Send "d"
137
+ Sleep 2000
138
+
139
+ Send "{Right}"
140
+ Sleep 2000
141
+
142
+ Send "d"
143
+ Sleep 1000
144
+
145
+ Send "{Right}"
146
+ Sleep 2000
147
+
148
+ Send "d"
149
+ Sleep 1000
150
+
151
+ Send "{Right}"
152
+ Sleep 2000
153
+
154
+ Send "d"
155
+ Sleep 1000
156
+
157
+ Send "{Esc}"
158
+ Sleep 1000
159
+
160
+ ; CURRENT ID + 1
161
+ currentID += 1
162
+ }
163
+
164
+ ; Restore previous clipboard
165
+ A_Clipboard := oldClipboard
166
+
167
+ MsgBox "Finished. Ran all prompts from CURRENT ID " START_CURRENT_ID " to " prompts.Length "."
168
+ ExitApp