1

How can one configure AutoKey in such a way that it can send a specific sentence in an interval of, say, 5 seconds?

So, if I wanted to type "Hello!" in a game chat while I am AFK every 5 seconds, how would I go on about doing that?

1 Answers1

0

Careful on that frequency. You might get chat-spam/bot-banned.

import time

# Retrieve current or set initial value.
try:
    # Toggle the value if it already exists. True <-> False
    store.set_global_value("helloRepeat",not store.get_global_value("helloRepeat"))
except:
    # Value did not exist, set it True now.
    store.set_global_value("helloRepeat",True)

# Loop de loop.
# This will not execute on toggle-off key-press.
# Existing loop from previous key-press will terminate.
while store.get_global_value("helloRepeat"):
    # Set chat and channel trigger/characters appropriately.
    keyboard.send_keys('<enter>Hello!<enter>')
    # Sleep for seconds..
    time.sleep(5)

SHawarden
  • 865