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)
小心那个频率。您可能会被聊天垃圾邮件/机器人禁止。