-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
81 lines (67 loc) · 2.81 KB
/
main.py
File metadata and controls
81 lines (67 loc) · 2.81 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from twitchio.ext import commands
import pyautogui
from time import sleep
choiceTimer = 0.05
class Bot(commands.Bot):
def __init__(self):
super().__init__(token='xtitxffsd1xsobjjdpo2budtvbozbu', prefix='!', initial_channels=['budget_bwipo'])
async def event_ready(self):
print(f'Logged in as | {self.nick}')
print(f'User id is | {self.user_id}')
@commands.command()
async def up(self, ctx: commands.Context, argument: int = 1):
print("Key 'up' has been pressed with value {val}".format(val=argument))
if isinstance(argument, int):
for i in range(0, argument + 1):
pyautogui.keyDown(key="up")
sleep(choiceTimer)
pyautogui.keyUp(key="up")
@commands.command()
async def down(self, ctx: commands.Context, argument:int = 1):
print("Key 'down' has been pressed with value {val}".format(val=argument))
if isinstance(argument, int):
for i in range(0, argument + 1):
pyautogui.keyDown(key="down")
sleep(choiceTimer)
pyautogui.keyUp(key="down")
@commands.command()
async def left(self, ctx: commands.Context, argument: int = 1):
print("Key 'left' has been pressed with value {val}".format(val=argument))
if isinstance(argument, int):
for i in range(0, argument + 1):
pyautogui.keyDown(key="left")
sleep(choiceTimer)
pyautogui.keyUp(key="left")
@commands.command()
async def right(self, ctx: commands.Context, argument : int = 1):
print("Key 'right' has been pressed with value {val}".format(val=argument))
if isinstance(argument, int):
for i in range(0, argument + 1):
pyautogui.keyDown(key="right")
sleep(choiceTimer)
pyautogui.keyUp(key="right")
@commands.command()
async def x(self, ctx: commands.Context):
print("Key 'x' has been pressed")
pyautogui.keyDown(key="x")
sleep(choiceTimer)
pyautogui.keyUp(key="x")
@commands.command()
async def c(self, ctx: commands.Context):
print("Key 'c' has been pressed")
pyautogui.keyDown(key="c")
sleep(choiceTimer)
pyautogui.keyUp(key="c")
@commands.command()
async def com(self, ctx: commands.Context):
await ctx.send("The list of commands are : !x !c !up !down !left !right")
@commands.command()
async def skip(self, ctx: commands.Context):
print("Skipping scenes")
for i in range(5):
pyautogui.keyDown(key="x")
sleep(1)
pyautogui.keyUp(key="x")
if __name__ == "__main__":
bot = Bot()
bot.run()