-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathafkbot.py
More file actions
59 lines (47 loc) · 1.42 KB
/
afkbot.py
File metadata and controls
59 lines (47 loc) · 1.42 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
import pyautogui as pag
import random
import time
import pynput.keyboard as kb # import Key, Controller
import pynput.mouse as ms # import Button, Controller
import numpy as np
keyboard = kb.Controller()
mouse = ms.Controller()
movement = 'random'
while True:
x = random.randint(600, 700)
y = random.randint(200, 300)
# pag.moveTo(x,y, 0.5)
time.sleep(2)
if movement == 'random':
keys = ["w", "a", "s", "d", "r", "w", "a", "s", "d"]
key = np.random.choice(keys)
# for key in keys:
keyboard.press(key)
time.sleep(0.5)
keyboard.release(key)
if key=="r":
time.sleep(0.5)
keyboard.press(key)
time.sleep(0.5)
keyboard.release(key)
time.sleep(0.5)
mouse.click(ms.Button.left, 1)
if movement == 'circular':
keys = ["w", "a", "s", "d", "r"]
for key in keys:
# for key in keys:
keyboard.press(key)
time.sleep(0.5)
keyboard.release(key)
#time.sleep(0.5)
keyboard.press(key)
time.sleep(0.5)
keyboard.release(key)
time.sleep(0.5)
mouse.move(5, -5)
mouse.click(ms.Button.left, 1)
#contents = ["]", "2"]
#for content in contents:
# keyboard.press(content)
# time.sleep(0.5)
# keyboard.release(content)