-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathak47.py
More file actions
103 lines (89 loc) · 1.86 KB
/
Copy pathak47.py
File metadata and controls
103 lines (89 loc) · 1.86 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import time
from pyclick import HumanClicker
from PIL import Image
import PressKey
import win32api
import os
import random
import mss
from math import atan, sqrt, pi, sin, cos
hc = HumanClicker()
keys = PressKey.Keys()
shooting = False
monitor = {}
def Cancelrecoil():
global shooting
dx = 12
dy = 65
dx = int(atan(4 * dx / (sqrt(3) * 1920)) * 57.3 * 25.17)
dy = int(30 * 54 * dy / 1080)
d = hc.Gdxdy((dx, dy))
print(d)
for i in range(len(d)):
if win32api.GetKeyState(0x01) < 0:
print(d[i])
keys.directMouse(d[i][0], d[i][1])
time.sleep(1 / len(d))
else:
break
shooting = False
def getStime():
startt = None
while win32api.GetKeyState(0x01) < 0:
if startt == None:
startt = time.time()
else:
time.sleep(0.001)
if startt != None:
print(time.time() - startt)
def shot():
i = 0
sct = mss.mss()
while win32api.GetKeyState(0x01) < 0:
i += 1
st = sct.grab(monitor)
img = Image.frombytes("RGB", st.size, st.bgra, "raw", "BGRX")
img.save(os.path.join('recoil/ak{}.jpg'.format(i)))
time.sleep(0.05)
if __name__ == "__main__":
actions = [[0, 0]]
for i in range(0, 12):
si = 5 * cos(i * pi / 6)
cs = 5 * sin(i * pi / 6)
actions.append([int(si), int(cs)])
print(actions)
# print(int(si), int(cs))
# zx = 960
# zy = 540
# monitor['left'] = zx - 200
# monitor['top'] = zy - 200
# monitor['width'] = 400
# monitor['height'] = 400
# while True:
# if win32api.GetKeyState(0x01) < 0 and shooting == False:
# shooting = True
# Cancelrecoil()
# time.sleep(0.01)
# -4 7
# 4 19
# -3 29
# -1 31
# 13 31
# 8 28
# 13 21
# -17 12
# -42 - 3
# -21 2
# 12 11
# -15 7
# -26 - 8
# -3 4
# 40 1
# 19 7
# 14 10
# 27 0
# 33 - 10
# -21 - 2
# 7 3
# -7 9
# -8 4