예제 #1
0
def main():
    logo()
    print("Checking for updates...")

    # check for update
    check_for_update()

    # P will stop message loop
    GlobalHotKeys.register(GlobalHotKeys.VK_P, "VK_P", 0, False)

    global versionCheck
    quitpls = 0
    start = 0
    while quitpls == 0:
        while start == 0:
            system('cls')
            logo()
            print(versionCheck)
            button_assignmend()
            print(
                "\nWrite 1-11 to assign a chatcode to F1-F11, 'c' for other keys, 's' to save, 'l' to load"
            )
            print(
                "'g' to start, 'q' to quit, when the chatbox only sort of 'blinks' press 'b'\n"
            )

            inputUser = input()
            if inputUser == "s":
                save_to_file()
            elif inputUser == "l":
                load_from_file()
            elif inputUser == "g":
                start = 1
            elif inputUser == "q":
                start = 1
                quitpls = 1
            elif inputUser == "b":
                configure_time()
            elif inputUser == "c":
                customHotkey()
            elif is_int(inputUser) and int(inputUser) > 0 and int(
                    inputUser) < 12:  # F12 not working
                liorkp("VK_F{}".format(inputUser))

            # start main loop
            if quitpls == 0 and start == 1:
                start = 0
                clipboard_tmp = pyper_paste(
                )  # save temporarly current clipboard
                GlobalHotKeys.listen()
                pyper_copy(clipboard_tmp)  # restore clipboard after spamming
        start = 1
예제 #2
0
def main():
    set_console_size(500, 1000, 80, 25)
    start_adb_server()
    show_devices()
    select_device()

    read_config_file()
    set_console_title()
    adb_start_tcpip_mode()
    show_help()
    # 设置全局截图热键,默认ALT + S
    GlobalHotKeys.register(get_hot_key()['key'],
                           get_hot_key()['mod_key'], adb_screenshot)
    start_global_key_thread()
    start_option()
예제 #3
0
def set_global_hot_key(hot_key):
    global screenshot_hot_key
    screenshot_hot_key = hot_key
    try:
        t = GlobalHotKeys.register(get_hot_key()['key'],
                                   get_hot_key()['mod_key'], adb_screenshot)
        write_config()
        refresh()
    except:
        print_color('warning', '热键设置失败!')
        help_set_hot_key()
예제 #4
0
def main():
    
    print ("Voice2Keyboard BETA. Written by Sinan Cetinkaya")
    print ("Check the config.ini for settings")
    print ("Translated to %s by %s" % (LANG, config.get(LANG, 'translator')))
    print (config.get(LANG, 'Registering_hotkeys'))
    GlobalHotKeys.register(HOTKEY_LISTEN, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, listen)
    GlobalHotKeys.register(HOTKEY_QUIT, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, quit)
    print (config.get(LANG, 'Ready'))
    GlobalHotKeys.listen()
        elif inputUser == 6:
            inputUser = 10
            while 0 > inputUser or 1 < inputUser:
                try:
                    inputUser = int(input("100 CM (1), Return (0)\n"))
                except:
                    print("Invalid Input")
                if inputUser == 0:
                    inputUser = 10
                    break
                elif inputUser == 1:
                    assign_button(button, "100 CM KP", "024f3f0100")


# P will stop message loop
GlobalHotKeys.register(GlobalHotKeys.VK_P, 0, False)

quitpls = 0
start = 0
while quitpls == 0:
    while start == 0:
        _ = os.system('cls')
        logo()
        print(version)
        button_assignmend()
        print(
            "Write 1-11 to assign a chatcode to F1-F11, Write 's' to start, 'q' to quit\n"
        )

        inputUser = input()
        if inputUser == "s":
예제 #6
0
def liorkp(button):
    inputUser = -1
    while inputUser < 0 or inputUser > 5:  # count of options
        try:
            inputUser = int(
                input(
                    "What do you want to add?\nLI/LD(1), Wings(2), Fractals(3), Custom(4), Remove(5), Return(0)\n"
                ))
        except:
            print("Invalid Input")
            input("Press Enter to continue")

        # Return
        if inputUser == 0:
            return

        # LI or LD
        if inputUser == 1:
            inputUser = -1
            while inputUser < 0 or inputUser > 2:
                try:
                    inputUser = int(
                        input(
                            "Legendary Insight (1), Legendary Divination (2), Return (0)\n"
                        ))
                except:
                    print("Invalid Input")
                    input("Press Enter to continue")
                if inputUser == 0:
                    inputUser = -1
                    break
                elif inputUser == 1:
                    assign_button(button, "Legendary Insight", "[&AgH2LQEA]")
                elif inputUser == 2:
                    assign_button(button, "Legendary Divination",
                                  "[&AgGlWQEA]")

        # Wing KPs
        elif inputUser == 2:
            inputUser = -1
            while inputUser < 0 or inputUser > 7:  # count of wings
                try:
                    inputUser = int(
                        input(
                            "W1 KP(1), W2 KP(2), W3 KP(3), W4 KP(4), W5 KP(5), W6 KP(6), W7 KP(7), Return (0)\n"
                        ))
                except:
                    print("Invalid Input")
                    input("Press Enter to continue")
                if inputUser == 0:
                    inputUser = -1
                    break

                # W1 KPs
                elif inputUser == 1:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 3:
                        try:
                            inputUser = int(
                                input(
                                    "Vale Guardian (1), Gorseval (2), Sabetha (3), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Vale Guardian KP",
                                          "[&AgGJLwEA]")
                        elif inputUser == 2:
                            assign_button(button, "Gorseval KP", "[&AgG3LwEA]")
                        elif inputUser == 3:
                            assign_button(button, "Sabetha KP", "[&AgGgLwEA]")

                # W2 KPs
                elif inputUser == 2:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 2:
                        try:
                            inputUser = int(
                                input(
                                    "Slothasor (1), Matthias (2), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Slothasor KP",
                                          "[&AgGKLwEA]")
                        elif inputUser == 2:
                            assign_button(button, "Matthias KP", "[&AgFvLwEA]")

                # W3 KPs
                elif inputUser == 3:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 3:
                        try:
                            inputUser = int(
                                input(
                                    "Escort (1), Keep Construct (2), Xera (3), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Escort KP", "[&AgFtNAEA]")
                        elif inputUser == 2:
                            assign_button(button, "Keep Construct KP",
                                          "[&AgE2NAEA]")
                        elif inputUser == 3:
                            assign_button(button, "Xera KP", "[&AgFeNAEA]")

                # W4 KPs
                elif inputUser == 4:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 4:
                        try:
                            inputUser = int(
                                input(
                                    "Cairn (1), Mursaat Overseer (2), Samarog (3), Deimos (4), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Cairn KP", "[&AgHvOgEA]")
                        elif inputUser == 2:
                            assign_button(button, "Mursaat Overseer KP",
                                          "[&AgGNOQEA]")
                        elif inputUser == 3:
                            assign_button(button, "Samarog KP", "[&AgHXOAEA]")
                        elif inputUser == 4:
                            assign_button(button, "Deimos KP", "[&AgGeOgEA]")

                # W5 KPs
                elif inputUser == 5:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 4:
                        try:
                            inputUser = int(
                                input(
                                    "Soulless Horror (1), River of Souls (2), Statues of Grenth (3), Voice in the Void (4), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Soulless Horror KP",
                                          "[&AgHpTwEA]")
                        elif inputUser == 2:
                            assign_button(button, "River of Souls KP",
                                          "[&AgEZTwEA]")
                        elif inputUser == 3:
                            assign_button(button, "Statues of Grenth KP",
                                          "[&AgEoTwEA]")
                        elif inputUser == 4:
                            assign_button(button, "Voice in the Void KP",
                                          "[&AgGBTgEA]")

                # W6 KPs
                elif inputUser == 6:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 3:
                        try:
                            inputUser = int(
                                input(
                                    "Conjured Amalgamate (1), Twin Largos (2), Qadim (3), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Conjured Amalgamate KP",
                                          "[&AgHfWQEA]")
                        elif inputUser == 2:
                            inputUser = -1
                            while inputUser < 0 or inputUser > 4:
                                try:
                                    inputUser = int(
                                        input(
                                            "Token (1), Bronze Trophy (2), Silver Trophy (3), Gold Trophy (4), Return (0)\n"
                                        ))
                                except:
                                    print("Invalid Input")
                                    input("Press Enter to continue")
                                if inputUser == 0:
                                    inputUser = -1
                                    break
                                elif inputUser == 1:
                                    assign_button(button, "Twin Largos Token",
                                                  "[&AgEcWwEA]")
                                elif inputUser == 2:
                                    assign_button(button,
                                                  "Bronze Twin Largos Trophy",
                                                  "[&AgE8WgEA]")
                                elif inputUser == 3:
                                    assign_button(button,
                                                  "Silver Twin Largos Trophy",
                                                  "[&AgEQWgEA]")
                                elif inputUser == 4:
                                    assign_button(button,
                                                  "Gold Twin Largos Trophy",
                                                  "[&AgHuWQEA]")
                        elif inputUser == 3:
                            assign_button(button, "Qadim KP", "[&AgFFWgEA]")

                # W7 KPs
                elif inputUser == 7:
                    inputUser = -1
                    while inputUser < 0 or inputUser > 3:
                        try:
                            inputUser = int(
                                input(
                                    "Cardinal Sabir (1), Cardinal Adina (2), Qadim the Peerless (3), Return (0)\n"
                                ))
                        except:
                            print("Invalid Input")
                            input("Press Enter to continue")
                        if inputUser == 0:
                            inputUser = -1
                            break
                        elif inputUser == 1:
                            assign_button(button, "Cardinal Sabir's KP",
                                          "[&AgGGZAEA]")
                        elif inputUser == 2:
                            assign_button(button, "Cardinal Adina's KP",
                                          "[&AgFuZAEA]")
                        elif inputUser == 3:
                            assign_button(button, "Ether Djinn's Token",
                                          "[&AgEnZAEA]")

        # Fractals KPs
        elif inputUser == 3:
            inputUser = -1
            while inputUser < 0 or inputUser > 1:
                try:
                    inputUser = int(input("100 CM (1), Return (0)\n"))
                except:
                    print("Invalid Input")
                    input("Press Enter to continue")
                if inputUser == 0:
                    inputUser = -1
                    break
                elif inputUser == 1:
                    assign_button(button, "100 CM KP", "[&AgFPPwEA]")

        # Custom
        elif inputUser == 4:
            try:
                inputChatcode = input("Paste a Chatcode or Return (0)\n")
            except:
                print("Invalid Input")
                input("Press Enter to continue")
            if inputChatcode != "0":
                inputChatcodeName = input("Give it a name or Return (0)\n")
                if inputChatcodeName != "0":
                    assign_button(button, inputChatcodeName, inputChatcode)
                else:
                    inputUser = -1
            else:
                inputUser = -1

        # Remove Button
        elif inputUser == 5:
            global listButtons, listCodes, listStrings
            if listButtons.count(button) == 1:
                index = listButtons.index(button)
                del listButtons[index]
                del listCodes[index]
                del listStrings[index]

                GlobalHotKeys.unregister(GlobalHotKeys.__dict__.get(button))
            else:
                print("{} hasn't been assigned yet!".format(button[3:]))
                input("Press Enter to continue")
            return
예제 #7
0
from globalhotkeys import GlobalHotKeys


@GlobalHotKeys.register(GlobalHotKeys.VK_F1, GlobalHotKeys.MOD_SHIFT)
def hello_world():
    print "Hello World!"


@GlobalHotKeys.register(GlobalHotKeys.VK_F2)
def hello_world_2():
    print "Hello World again?"


# Q and ctrl will stop message loop
GlobalHotKeys.register(GlobalHotKeys.VK_Q, 0, False)
GlobalHotKeys.register(GlobalHotKeys.VK_C, GlobalHotKeys.MOD_CTRL, False)

# start main loop
GlobalHotKeys.listen()
예제 #8
0
#/usr/bin/env python3
import base64
from globalhotkeys import GlobalHotKeys, key_to_str
import signal
import time
import subprocess

from pynput import keyboard
import pyperclip

from typing import List

ghk = GlobalHotKeys()
running = True
item_buf = []


class Item:
    name: str
    link: str

    def __init__(self, name, link):
        self.name = name
        self.link = link

    def get_amount(self):
        clean_link = self.link[2:-1]
        decoded_data = base64.b64decode(clean_link)
        return decoded_data[1]

    def set_amount(self, amount: int):
예제 #9
0
파일: main.py 프로젝트: fcu-d0591821/MS_BOT
                continue
            if abs(info.dist) < 150:
                KeyPress(info.direction, abs(info.dist) / speed)
                KeyPress(CTRL, randomTime(200, 1500, 3))
        except KeyboardInterrupt:
            exit()
        except Exception as e:
            pass
            #print(e)

thread = threading.Thread(target=bot, daemon=True)
thread.start()

@GlobalHotKeys.register(GlobalHotKeys.VK_F2)
def toggle():
    global running
    global lx
    global ly
    global rx
    global ry

    if running:
        cv2.destroyAllWindows()
    else:
        lx, ly, rx, ry = getGamePos()

    running = not running
    print("Running:", running)

GlobalHotKeys.register(GlobalHotKeys.VK_C, GlobalHotKeys.MOD_CTRL, False)
GlobalHotKeys.listen()
예제 #10
0
def main():
    print('请按Shift + F1 开始截图')
    thread = threading.Thread(target=app.run, args=('0.0.0.0', '5000'))
    thread.start()
    GlobalHotKeys.listen()
예제 #11
0
def quit():
    
    print (config.get(LANG, 'Unregistering_hotkeys'))
    GlobalHotKeys.register(HOTKEY_LISTEN, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, None)
    GlobalHotKeys.register(HOTKEY_QUIT, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, None)
    sys.exit(config.get(LANG, 'Bye'))