import keyboard, pyautogui, random, time
def simple_afk_script():
# ability variables for randomize the time.sleep function
# random function to make inputs more human
q_ability = random.uniform(0, 3)
w_ability = random.uniform(0, 3)
e_ability = random.uniform(0, 3)
r_ability = random.uniform(0, 3)
a_ability = random.uniform(0, 3)
s_ability = random.uniform(0, 3)
d_ability = random.uniform(0, 3)
f_ability = random.uniform(0, 3)
# awakening ability variables for randomize the time.sleep function
v_ability = random.uniform(0, 3)
# hotkey potion, variables with randomize function
one_battle_hotkey = random.uniform(0, 3)
five_item_hotkey = random.uniform(0, 3)
# input, time and print functions for a better overview
# comment out inputs if you dont need them
pyautogui.press('q')
time.sleep(q_ability)
print("key 'q' float time in seconds", q_ability)
pyautogui.press('w')
time.sleep(w_ability)
print("key 'w' float time in seconds", w_ability)
pyautogui.press('e')
time.sleep(e_ability)
print("key 'q' float time in seconds", e_ability)
pyautogui.press('r')
time.sleep(r_ability)
print("key 'r' float time in seconds", r_ability)
pyautogui.press('a')
time.sleep(a_ability)
print("key 'a' float time in seconds", a_ability)
pyautogui.press('s')
time.sleep(s_ability)
print("key 's' float time in seconds", s_ability)
pyautogui.press('d')
time.sleep(d_ability)
print("key 'd' float time in seconds", d_ability)
pyautogui.press('f')
time.sleep(f_ability)
print("key 'f' float time in seconds", f_ability)
pyautogui.press('v')
time.sleep(v_ability)
print("key 'v' float time in seconds", v_ability)
pyautogui.press('1')
time.sleep(one_battle_hotkey)
print("key '1' float in seconds", one_battle_hotkey)
pyautogui.press('5')
time.sleep(five_item_hotkey)
print("key '5' float in seconds", five_item_hotkey)
print("\n")
return
# example script to loop afk macro
print("press space... switch back into game\n")
if keyboard.read_key() == "space":
loop_counter = 0
while True:
loop_counter = loop_counter + 1
print("loop counter: ", loop_counter,"\n")
simple_afk_script()
# example if statement to kill the script at 100 loops
# remove quotation marks if u need it
"""if loop_counter == 100:
break"""
else:
print("wrong key...")