-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem.py
More file actions
54 lines (38 loc) · 1.06 KB
/
Copy pathsystem.py
File metadata and controls
54 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pyautogui
import time
import pyperclip
from groq import Groq
# Replace "YOUR_GROQ_API_KEY" with your own API key.
# You can get your API key from: https://console.groq.com/keys
client = Groq(api_key="YOUR_GROQ_API_KEY")
time.sleep(2)
last_text = ""
while True:
# WAIT BEFORE STARTING CYCLE
time.sleep(7)
# SELECT LAST MESSAGE
pyautogui.moveTo(1828, 880)
pyautogui.dragTo(1825, 730, duration=0.4, button="left")
pyautogui.hotkey("ctrl", "c")
time.sleep(0.5)
text = pyperclip.paste().strip()
if not text or text == last_text:
time.sleep(20)
continue
last_text = text
# AI PROCESS
time.sleep(5)
response = client.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[
{"role": "user", "content": text}
]
)
reply = response.choices[0].message.content
pyperclip.copy(reply)
# INSTANT SEND
pyautogui.click(1715, 950)
pyautogui.hotkey("ctrl", "v")
pyautogui.press("enter")
# COOLDOWN BEFORE NEXT CYCLE
time.sleep(20)