22
22
SOFTWARE.
23
23
"""
24
24
25
+ from winsound import Beep
26
+ from colorama import Fore , Style , init
27
+ from mss import mss
28
+ from PIL import ImageGrab , Image
29
+ from ctypes import windll
30
+ from time import perf_counter , sleep
31
+ from os import system
32
+ from keyboard import is_pressed
33
+ from hashlib import sha256
34
+ from random import random
35
+
36
+
25
37
__author__ : str = 'R3nzTheCodeGOD'
26
- __version__ : str = 'v2.0.0 '
38
+ __version__ : str = 'v2.0.1 '
27
39
28
- from keyboard import is_pressed
29
- from os import system
30
- from time import perf_counter , sleep
31
- from ctypes import windll
32
- from PIL import ImageGrab , Image
33
- from winsound import Beep
34
- from mss import mss
35
- from colorama import Fore , Style , init
36
40
37
- S_HEIGHT , S_WIDTH = ( ImageGrab .grab ().size )
41
+ S_HEIGHT , S_WIDTH = ImageGrab .grab ().size
38
42
GRABZONE : int = 5
39
43
TRIGGER_KEY : str = 'shift'
40
44
SWITCH_KEY : str = 'ctrl + tab'
41
45
GRABZONE_KEY_UP : str = 'ctrl + up'
42
46
GRABZONE_KEY_DOWN : str = 'ctrl + down'
43
47
mods : tuple = ('0.3s Delay' , '0.2s Delay' , '0.1s Delay' , 'No Delay Full-Auto' )
44
-
48
+
49
+
45
50
class FoundEnemy (Exception ):
46
51
pass
47
-
52
+
53
+
48
54
class TriggerBot :
49
55
def __init__ (self ) -> None :
50
56
self ._mode : int = 2
51
57
self ._last_reac : int = 0
52
-
58
+
53
59
def switch (self ):
54
60
if self ._mode != 3 : self ._mode += 1
55
61
else : self ._mode = 0
56
-
57
62
if self ._mode == 0 : Beep (200 , 100 )
58
63
elif self ._mode == 1 : Beep (200 , 100 ), Beep (200 , 100 )
59
64
elif self ._mode == 2 : Beep (200 , 100 ), Beep (200 , 100 ), Beep (200 , 100 )
60
65
elif self ._mode == 3 : Beep (200 , 100 ), Beep (200 , 100 ), Beep (200 , 100 ), Beep (200 , 100 )
61
-
62
- def color_check (self , red : int , green : int , blue : int ) -> bool :
63
- if green >= 190 :
64
- return False
65
-
66
- if green >= 140 :
67
- return abs (red - blue ) <= 8 and red - green >= 50 and blue - green >= 50 and red >= 105 and blue >= 105
68
66
67
+ def color_check (self , red : int , green : int , blue : int ) -> bool :
68
+ if green >= 190 : return False
69
+ if green >= 140 : return abs (red - blue ) <= 8 and red - green >= 50 and blue - green >= 50 and red >= 105 and blue >= 105
69
70
return abs (red - blue ) <= 13 and red - green >= 60 and blue - green >= 60 and red >= 110 and blue >= 100
70
71
71
72
def grab (self ) -> Image :
72
73
with mss () as sct :
73
74
bbox : tuple = (int (S_HEIGHT / 2 - GRABZONE ), int (S_WIDTH / 2 - GRABZONE ), int (S_HEIGHT / 2 + GRABZONE ), int (S_WIDTH / 2 + GRABZONE ))
74
75
sct_img = sct .grab (bbox )
75
76
return Image .frombytes ('RGB' , sct_img .size , sct_img .bgra , 'raw' , 'BGRX' )
76
-
77
+
77
78
def scan (self ) -> None :
78
79
start_time : float = perf_counter ()
79
80
pmap : Image = self .grab ()
80
-
81
+
81
82
try :
82
- for x in range (0 , GRABZONE * 2 ):
83
- for y in range (0 , GRABZONE * 2 ):
84
- r , g , b = pmap .getpixel ((x ,y ))
83
+ for x in range (0 , GRABZONE * 2 ):
84
+ for y in range (0 , GRABZONE * 2 ):
85
+ r , g , b = pmap .getpixel ((x , y ))
85
86
if self .color_check (r , g , b ): raise FoundEnemy
86
-
87
+
87
88
except FoundEnemy :
88
- self ._last_reac = int ((perf_counter () - start_time )* 1000 )
89
-
90
- windll .user32 .mouse_event (2 , 0 , 0 , 0 , 0 )
91
- windll .user32 .mouse_event (4 , 0 , 0 , 0 , 0 )
89
+ self ._last_reac = int ((perf_counter () - start_time ) * 1000 )
90
+ windll .user32 .mouse_event (2 , 0 , 0 , 0 , 0 ), windll .user32 .mouse_event (4 , 0 , 0 , 0 , 0 )
92
91
93
92
if self ._mode == 0 : sleep (0.3 )
94
93
elif self ._mode == 1 : sleep (0.2 )
95
94
elif self ._mode == 2 : sleep (0.1 )
96
95
elif self ._mode == 3 : pass
97
96
97
+
98
98
def print_banner (bot : TriggerBot ) -> None :
99
99
system ('cls' )
100
100
print (Style .BRIGHT + Fore .CYAN + f'{ __author__ } Valorant External Cheat { __version__ } ' + Style .RESET_ALL )
101
101
print ('====== Controls ======' )
102
102
print ('Trigger Key :' , Fore .YELLOW + TRIGGER_KEY + Style .RESET_ALL )
103
- print ('Mode Chage Key :' , Fore .YELLOW + SWITCH_KEY + Style .RESET_ALL )
103
+ print ('Mode Change Key :' , Fore .YELLOW + SWITCH_KEY + Style .RESET_ALL )
104
104
print ('Grab Zone Change Key :' , Fore .YELLOW + GRABZONE_KEY_UP + '/' + GRABZONE_KEY_DOWN + Style .RESET_ALL )
105
105
print ('===== Information ====' )
106
106
print ('Mode :' , Fore .CYAN + mods [bot ._mode ] + Style .RESET_ALL )
107
107
print ('Grab Zone :' , Fore .CYAN + str (GRABZONE ) + 'x' + str (GRABZONE ) + Style .RESET_ALL )
108
108
print ('Trigger Status :' , Fore .GREEN + f'Hold down the "{ TRIGGER_KEY } " key' + Style .RESET_ALL )
109
- print ('Last React Time :' , Fore .CYAN + str (bot ._last_reac ) + Style .RESET_ALL + ' ms (' + str ((bot ._last_reac )/ (GRABZONE * GRABZONE )) + 'ms/pix)' )
109
+ print ('Last React Time :' , Fore .CYAN + str (bot ._last_reac ) + Style .RESET_ALL + ' ms (' + str ((bot ._last_reac )/ (GRABZONE * GRABZONE )) + 'ms/pix)' )
110
+
110
111
111
112
if __name__ == "__main__" :
112
- print ('e340d4e42d032023127fcd4a42ea34349fc0b00b982047ad614d405fc2cd1168' )
113
- init ()
114
- system ('@echo off' )
115
- system ('cls' )
113
+ _hash : str = sha256 (f'{ random ()} ' .encode ('utf-8' )).hexdigest ()
114
+ print (_hash ), system (f'title { _hash } ' ), sleep (0.5 ), init (), system ('@echo off' ), system ('cls' )
116
115
bot = TriggerBot ()
117
116
print_banner (bot )
118
117
119
118
while True :
120
- if is_pressed (SWITCH_KEY ):
121
- bot .switch ()
122
- print_banner (bot )
119
+ if is_pressed (SWITCH_KEY ): bot .switch (), print_banner (bot )
123
120
124
121
if is_pressed (GRABZONE_KEY_UP ):
125
122
GRABZONE += 1
126
- print_banner (bot )
127
- Beep (400 , 100 )
123
+ print_banner (bot ), Beep (400 , 100 )
128
124
129
125
if is_pressed (GRABZONE_KEY_DOWN ):
130
126
if GRABZONE != 1 : GRABZONE -= 1
131
- print_banner (bot )
132
- Beep (300 , 100 )
127
+ print_banner (bot ), Beep (300 , 100 )
133
128
134
129
if is_pressed (TRIGGER_KEY ):
135
- bot .scan ()
136
- print_banner (bot )
137
- sleep (0.001 ) # loop with keyboard.is_pressed causing input lag
138
- """Keyboard kütüphanesi çok fazla threding işlemi ve for döngüsü yapıyor.
139
- Hızlı bilgisayarlarda fazla girilen while döngüsü problem oluşturuyor."""
130
+ bot .scan (), print_banner (bot )
131
+
132
+ sleep (0.001 ) # [Fix input lag] Contributing: https://github.com/atakanhr
0 commit comments