MetinPythonBot

THIS PROJECT WAS BUILT FOR EDUCATIONAL AND LEARNING PURPOSES ONLY!
This is a long term project built with C++/Python in order to explore my skills as a programmer and reverse engineer.
A Bot/Mod that adds complex functionality to the metin2 client. It needs be used with my c++ python library (Metin2Wx.dll), it will not work without it.

Functions

  • PathFinding (Even across maps)
  • WaitDmg (Including bow)
  • Pickup (with range)
  • SearchBot
  • LevelBot (with change location)
  • FishBot
  • Auto-pot and auto-restart
  • Shop-creator
  • Inventory Manager
  • Teleport
  • Auto buy/sell

Preview

image info

Usefull documented helper modules

This are modules built to be integrated with scripts, they provide an interface to complex functionality like walking with pathfinding or creating UI ingame. All this modules are documented.

  • BotBase: Allows to create diferent bot modes while maintaining special features (For now it's only available auto shop).
  • FileManager: Allows to store/retrive information from files.
  • Movement: Provide movement and teleport functions.
  • OpenLib: Main lib containing a lot of helper functions.
  • OpenLog: Very simple module for loging informations.
  • NPCInteraction: Allows for interaction with NPC's.
  • UIComponents: Contains high level functions to draw on top UI components.

Try to avoid usage of other modules not referenced here for creating aditional functionality, as other modules are more complex and more prone to error.

Aditional Remarks

In order to create a new BotMode, you shall extend the BotBase class (see example of LevelBot). FishingBot do not expand this class because it was made before the creation of BotMode class. Every module that needs to keep an Object running in the background like Movement or LevelBot is stored and executed at the end of the file, this allows to easily reload the module at runtime. The hackbar.py is responsible for importing every Module and showing the initial UI bar.

FileSystem

Main configurations files, if the files are not mentioned here, it either means they are strictly used by the core bot or they are editable from the UI.

  • Resources/Maps:: Contains the maps to be used in pathfinding. If the current map is not available in this directory it will be automatically created. You can edit the map (I recommend using Notepad++, as you can zoom out) the file contains only 0's and 1's, where the 0 represents a blocked location and the 1 represents a walkable position.

  • Saves: Unlike the Maps files, the next specific files are not automatically created and need to be updated, in case a map is not set currently.

    • map_linker.txt: Contains the links between maps, only yhe links contained in this file will be used too look for path across maps.
    • NpcMaps/map_name.npcs: Contains all npc's in that map with the following identation("race x y")

How to load it

Load MetinWx.dll into process while in character select mode or while choosing the channel.

Notes

  • init.py needs to be changed in case the server changes critical modules or functions
  • portals might be available at atlasinfo.txt inside locale
  • maybe OX questions in locale_quiz.txt inside locale?

Notes

  • init.py needs to be changed in case the server changes critical modules or functions

Problems

  • Path finding might be slow on complex maps like red forest
  • Auto sell not working