[FREE] Lost Ark AFK Macro [Python 3.9]

03/11/2022 04:22 x-actly#1
This is a simple Lost Ark Afk Macro to farm collectibles from named bosses in the open world.
Before you start, stay close to a named boss (higher drop chance when you kill the boss) location, change game to windowed mode, start script and follow the instruction in the command promt window.

The script is written in Python 3.9 with modules time, random, pyautogui and keyboard.
Install python via windows store or from the official website.
Then install pyautogui and keyboard in Windows command prompt with pip:

pip install pyautogui
pip install keyboard


When you have installed python and the two modules above, take any text editor you have and save the script into a .py file on your desktop. For example... macro.py, or blabla.py.

Start "cmd" (Windows Command Prompt) and navigate into your desktop folder where u have the "macro.py" with....

cd \users\yourusername\desktop

start script with...

python3 macro.py


Btw.... i have implemented the random.uniform function to make the inputs more human... but this is no garantee to be safe.
Do not stay 24/7 on any Farm Location, there is a high chance to get reported.


Code:
import keyboard, pyautogui, random, time



def simple_afk_script():

    # ability variables to 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 to 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...")
03/12/2022 01:05 PlebCodeWritter#2
Hello, I can't seem to find the module when running in python. The pip list shows that I have the current version of keyboard and pyautogui. I am using python 3.10. I check both python and python3 pip and tried installing to both, del both of them and tried reinstalling but for some reason python is not finding module keyboard or pyautogui.

Edit: As it always happens right when you reach out for help you solve it yourself. I figured it out and have fixed the problem!
03/12/2022 04:33 x-actly#3
i had the same problem when i installed python on my new laptop via microsoft store. i had to add the path environment manually to the python library... now it works as always!
03/12/2022 22:36 iiScoovy#4
can someone explain better how it works? :/
03/13/2022 04:48 bimbusa#5
Quote:
Originally Posted by iiScoovy View Post
can someone explain better how it works? :/
1. install python
2. install python modules keyboard and pyautogui as described above
3. copy paste script into .py file with notepad or notepad++
4. start script in cmd with "python3 PATH/yourfilename.py"
03/13/2022 19:43 skill3r199#6
is it possible to run the script without python?
03/15/2022 00:12 x-actly#7
Quote:
Originally Posted by skill3r199 View Post
is it possible to run the script without python?
sure... you can do this with "auto-py-to-exe", but u need to install python first! ;)
04/25/2022 10:21 Afpire9333#8
Hey, is this still working or lost ark patched it. I manage to run it and it will type out all the keys such as i tried opening a notepad the keys will be typed. But inside the game it cannot be input. Thank you.
04/25/2022 18:55 Cage#9
i hope you improve this project :)
06/02/2022 19:41 KarltheGreat#10
does the script still work?