def sendkeys_easy(string): s = list(string) print(s) i = 0 hex_list = [ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x6A, 0x0D, 0x20, 0x09, 0xA3, 0x5B, 0xA4, 0x14 ] key_list1 = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "*", "{ENTER}", "{SPACE}", "{TAB}", "{STRG}", "{WIN}", "{ALT}", "{CAPSLOCK}" ] key_list2 = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "*", "{enter}", " ", "{tab}", "{strg}", "{win}", "{alt}", "{capslock}" ] while i < len(s): x = 0 while x < len(key_list1): if (s[i] == key_list1[x] or s[i] == key_list2[x]): sendkeys.PressKey(hex_list[x]) sendkeys.ReleaseKey(hex_list[x]) else: pass x += 1 i += 1
def main(): pyautogui.FAILSAFE = True pyautogui.click(839, 596) while True: sendkeys.PressKey(sendkeys.VK_Z) time.sleep(.1) sendkeys.ReleaseKey(sendkeys.VK_Z) time.sleep(1.2) bonus = get_bonus() print(bonus) if bonus >= 30: print('FOUND!!!') break else: sendkeys.PressKey(sendkeys.VK_ESC) time.sleep(.1) sendkeys.ReleaseKey(sendkeys.VK_ESC) time.sleep(.4)
def set_volume(self, volume): i = 0 while i < volume / 2: sendkeys.PressKey(0xAF) sendkeys.ReleaseKey(0xAF) i += 1