LostArk Fishing Macro with Python (Fishing Macro1)

Fishing in Lost Ark seems to be one of the most annoying content. 

But it is easy compared to other life, many people seem to choose fishing. 

The difficulty is easy but still time-consuming… In fact, how much homework do you do in a day in the Loa. 

Cardon, Reid, Plifle, Cube, Treasure Map, Efona, etc. 

People who are busy with workers will have time to live.

 

So I tried to create an automatic fishing program in the sense that i want to reduce any homework.

(Of course, it’s too cheap for the meat value and the battle items that can be made by fishing, but we will post at an educational level. I would like to thank you so much that you can create something more interesting and informative using the library used here, rather than going to make it 24 hours. In addition, we urge you not to abuse any macro abuse, as it may cause you to stop the game and lead to an account suspension. )

 

The mechanism of fishing is repetitive. 

  1. Change the tree with life skills. 
  2. Move the mouse to the water.  
  3. Poke with the keyboard (‘w’). 
  4. Wait for the exclamation mark to appear. 
  5. When an exclamation point comes up, the keyboard (‘ W ‘) is collected. 
  6. Repeat 2 to 5 times. 

 

To make this repetitive behavior easier to solve with Python, we thought the following methods: 

  1.  Life Skill Change (manual)
  2. Take the strand coordinates on the monitor in advance and move the mouse to that coordinate
  3. Command to press ‘w’
  4. Make sure you’re getting an exclamation point in the center of the screen repeatedly 
  5. Command to press ‘w’ the moment you detect an exclamation point 
  6.  Repeat 2-5 times 

Let’s implement the above algorithm with Python.

Please refer to the link below for development preferences, please refer to the notes below!

  • The Python version will proceed to 3.6 64bit. (I think there won’t be much difference with the 32-bit version.)
  • Virtualenv is optional. If you’re setting up, please refer to the “Library root is on another soon” topic.

Python Development Environment Series

1. Getting fishing points 

First of all, you need to know the coordinates of the water that can be poked? And these coordinates must be specified on a fishing spot so that you can fish in many places. 

Create a folder called lostark and create a fishing_place.py file below it. It also generates an init.txt file to capture the settings. 

/lostark

Fishing_place.py

/ – init.txt

And use pip or Pycharm to install the library below. 

pip install configparser
pip install keyboard
pip install mouse

 

Configparser is a library to easily store coordinate data in a init.txt, and the Keyboard and mouse libraries play a role in Hooking or generating Keyboard, mouse-related events on a window. 

So let’s press ‘F12’ to set the fishing point and create a function that returns the coordinates of the current Mouse position. 

(Be sure to run it as an administrator when testing the feature in Pycharm or CMD in addition, !!!)

import os
import configparser
import mouse as mo
import keyboard as key
from ast import literal_eval
def getMousePointWithKey(cnt):
    state = False
    returnList = []
    tcnt = 0
    while True:
        val = key.is_pressed('F12')
        if state != val:
            if val == True:
                tcnt += 1
                returnList.append(mo.get_position())
                print ('Point ', tcnt, ' Catched')
            state = val
        if tcnt >= cnt:
            return returnList
if __name__ == "__main__":
    print(getMousePointWithKey(1))

 

When you press ‘F12’ while you run the above code, the coordinates of the current mouse points are printed in the form of a list, as shown below. Try changing the CNT!

2. Get fishing points to save and read

 Now you can save the fishing point on the init.txt with the fish information using the configparser. 

import os
import configparser
import mouse as mo
import keyboard as key
from ast import literal_eval
# --------------------- press F12 then return mouse coordinate -------
def getMousePointWithKey(cnt):
    state = False
    returnList = []
    tcnt = 0
    while True:
        val = key.is_pressed('F12')
        if state != val:
            if val == True:
                tcnt += 1
                returnList.append(mo.get_position())
                print ('Point ', tcnt, ' Catched')
            state = val
        if tcnt >= cnt:
            return returnList
# --------------------- save fishing place and point -------------------------------
def writeOptionOnConfig(section, option, val):
    flag = False
    configFile = os.path.dirname(os.path.realpath(__file__)) + '\\' + 'init.txt'
    config = configparser.ConfigParser()
    config.read(configFile)
    for idx, sec in enumerate(config.sections()):
        if sec == section:
            config[section][option] = val
            flag = True
    if flag == False:
        config.add_section(section)
        config[section][option] = val
    with open(configFile, 'w') as config_file:
        config.write(config_file)
    pass
def writeFishingPos(fishingPlace):
    poss = getMousePointWithKey(3)
    prefixFishingPlace = 'fishingpoint_' + fishingPlace
    for i, pos in enumerate(poss):
        opt = 'point' + str(i+1)
        print(opt, ' ', pos)
        writeOptionOnConfig(prefixFishingPlace, opt, str(pos))
def saveFishingPlaceAndPoint():
    name = input('fishing place name :')
    print("move mouse to water and press F12 ")
    writeFishingPos(name)
# --------------------- Retrive fishing place and point -------------------------------
def getFishingPlaceList():
    configFile = os.path.dirname(os.path.realpath(__file__)) + '\\' + 'init.txt'
    returnList = []
    config = None
    try:
        config = configparser.ConfigParser()
        config.read(configFile)
        for section in config.sections():
            if section.find('fishingpoint') >= 0:
                returnList.append(section)
    except Exception as e:
        print(str(e))
    return returnList, config
def getFishingPointList():
    returnList, config = getFishingPlaceList()
    pointList = []
    placeList = []
    if len(returnList) > 0:
        strs = ''
        for idx, place in enumerate(returnList):
            strs += str(idx) + '. ' + place + '\n'
            placeList.append(place)
        strs += '**selectPlace : '
        index = int(input(strs))
        if index < 0 and index > len(returnList):
            print('invalid Index')
            return False
        if config != None:
            for i in config[returnList[index]]:
                pointList.append(literal_eval(config[returnList[index]][i]))
    return pointList
if __name__ == "__main__":
    opt = 0
    if opt == 0:
        saveFishingPlaceAndPoint()
    else:
        result = getFishingPointList()
        print(result)

 

 

In this code, if you set it to opt = 0 and run in Pycharm, you’ll see prompts to enter the fishing spot. You’ll then enter the current location in English, then move the mouse to the water as described, and then press ‘F12’ to specify three points. In other words, you have specified three points to throw a poke. (Please choose a character not too far)

 

The following results will be output. 

Place Krona Port

Once you’ve checked the output screen above, let’s open the init.txt file. 

As shown in the picture below, you can see that the name you type is ‘ Fishingpoint_ ‘, where the haejyeoseo is stored as Prefix and the three mouse coordinates are entered. 

Note[fishingpoint_crona] that the section is called Section point1, Point2, Point3 is called option. Finally, the value assigned to option is called value.

Init.txt after code execution

Next, let’s get an interactively stored fishing point through the configparser. 

Try running the code after opting from the code above to 1 

Tan’s out as follows 0. Fishingpoint_crona is the name of the fishing ter we specified. 

And if you enter the number 0, you can get the saved points in the form of a list. 0, 1, 2, 3 places will come out this way if there are many designated places 

In this post, I tried to create a module to store and load the fishing spots and points. 

In the next post, we’ll look at the exclamation point. ~

You may also like...