This repository was archived by the owner on Aug 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
50 lines (34 loc) · 1.3 KB
/
Copy pathinit.py
File metadata and controls
50 lines (34 loc) · 1.3 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
import discord, pyscreenshot, time, os
from pynput.keyboard import Controller, Key
client = discord.Client()
keyboard = Controller()
import src.nds as platform
keys = platform.keys(Key)
message = None
channel = 952371099801378839
@client.event
async def on_ready():
await client.wait_until_ready()
activity = discord.Game(name="games! | https://discord.gg/HyUeFkNseb")
await client.change_presence(activity=activity)
print(f"Logged in as {client.user.name}")
global message
message = await client.get_channel(channel).send("React with anything to begin...")
for key in keys.keys(): await message.add_reaction(key)
@client.event
async def on_reaction_add(reaction, user):
if reaction.message.author != client.user: return
if user == client.user: return
global message
channel_obj = message.channel
await message.delete()
keyboard.press(keys[reaction.emoji])
time.sleep(0.25)
keyboard.release(keys[reaction.emoji])
time.sleep(2.55)
now = int(time.time())
pyscreenshot.grab(bbox=platform.coords()).save(f"./img/{now}.png")
attachment = discord.File(f"./img/{now}.png", f"{now}.png")
message = await channel_obj.send(file=attachment)
for key in keys.keys(): await message.add_reaction(key)
client.run("token")