Exemplo n.º 1
0
if __name__ == "__main__":

    while (True):
        attemptCount += 1
        try:
            # TODO: Open/select Google Chrome as active window
            time.sleep(2)

            # Open incognito window
            chrome.hotkey("ctrl", "shift", "n")

            # Go to disposable e-mail site to retrieve e-mail address
            chrome.write(tempMailLink)
            chrome.hotkey("enter")
            time.sleep(6)
            chrome.clickAtImg(dir + "tempmail_copy.PNG")

            # Open new tab and go to OSRS site to sign up
            chrome.hotkey("ctrl", "t")
            chrome.write(
                "https://secure.runescape.com/m=account-creation/create_account?theme=oldschool"
            )
            chrome.hotkey("enter")
            time.sleep(5)

            # Sign up procedure
            email = r.clipboard_get()
            chrome.write(email)
            chrome.hotkey("tab")
            password = get_random_alphanumeric_string(8)
            chrome.write(password)
Exemplo n.º 2
0
# Automated sequence of actions for interaction with Discord bot
# Requires you to have the Discord client in the foreground
# TODO: Instead of time.sleep() it should await for some period of time

r = Tk()
Discord = Objective("Discord")
OCR = Objective("OCR")
countSpawned = 0
countClaimed = 0

# Execution loop
if __name__ == "__main__":
    while True:
        # Type something in Discord chat
        try:
            Discord.clickAtImg("dc_input.PNG")
            Discord.write(".")
            Discord.hotkey("enter")
            time.sleep(0.7)
        except:
            print("Couldn't find Discord input field!")
            continue

        # Check whether card spawned
        try:
            startCoord = Discord.locateImg("dc_spawn.PNG")
            countSpawned += 1
        except:
            print("No card spawn detected!")
            time.sleep(30)
            continue