|
You last visited: Today at 00:07
Advertisement
[Release][GF] eXLib - The Python Advanced Module
Discussion on [Release][GF] eXLib - The Python Advanced Module within the Metin2 Hacks, Bots, Cheats, Exploits & Macros forum part of the Metin2 category.
06/05/2021, 04:10
|
#1
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
[Release][GF] eXLib - The Python Advanced Module
Hello everyone, today I came to release an advanced python module with lot of rich features for all python developers.
I have been adding functions for this module for the past few months, and finally i think is stable enought for release.
With this python module developers will be able to create the folowing only using python!: - Inject python scripts
- WaitHack
- Access the entity list
- Create a route using path-finding
- Create fast fishing-bot
- Wallhack
- Pickup range filter
- Use older functions like GetPixelPosition
- And much more!
How to use the module?- Edit script.py to execute your code
- Grab any injector
- Make sure you are in server or in character select (Important!)
- Inject eXLib.dll
DO NOT USE MANUAL MAP
API and documentation:
- Get(<string> filePath) returns <bytearray>
Similar to old app.Get, allows to extract any file encrypted.
- IsPositionBlocked(<int>x,<int>y) returns <boolean>
Allows to check if a map position is walkable(mobs don't count), true if is walkable or false if is not walkable.
Note: For better pathfinding, unblocked points that are close(1 unit) to a blocked point, are considered blocked too.
There is a bug with objects, since i can't figure out how to load the objects.
- FindPath(<int>x_start,<int>y_start,<int>x_end,<int >y_end) returns <tuple>(x,y)
Finds a path between 2 points.
The path will not contain the current point.
It's possible to edit the maps, by changing the files in Resources/Maps, 0 represents a blocked location and the 1 represents a walkable position. The module will generate a new map if the same does not exist.
- SendPacket(<int>size,<bytearray>buffer) return None
Sends a packet to the server bypassing any encryption set.
- SendAttackPacket(<int>vid,<byte>type)
Sends an attack packet to the server, the type is usually 0.
- SendStatePacket(<float>x,<float>y,<float>rotation_ angle,<byte>eFunc, <byte>uArgs)
Sends a packet containing the current state of the main player, can be used to change position,rotation and attack state on server side only.
The value eFunc can take the fallowing values: CHAR_STATE_ATTACK,CHAR_STATE_STOP,CHAR_STATE_WALK
If eFunc == CHAR_STATE_ATTACK then the uArgs value can take one of the following values:
- CHAR_STATE_ARG_HORSE_ATTACK1
- CHAR_STATE_ARG_HORSE_ATTACK2
- CHAR_STATE_ARG_HORSE_ATTACK3
- CHAR_STATE_ARG_COMBO_ATTACK1
- CHAR_STATE_ARG_COMBO_ATTACK2
- CHAR_STATE_ARG_COMBO_ATTACK3
- CHAR_STATE_ARG_COMBO_ATTACK4
otherwise the value can be NULL or CHAR_STATE_ARG_NONE
All this constants are defined in the module.
- <dict>InstancesList
Is a dictionary containing all vids currently in sight as keys and values
- IsDead(<int>vid) returns 1 or 0
Returns 1 if the instance with the vid provided is dead or doesn't exist and returns 0 otherwise
- SendStartFishing(<word>direction)
Sends a packet to the server to start fishing, the direction parameter is a word only understandable by the server(will be converted in the future).
- SendStopFishing(<byte>type,<float>timeLeft)
Sends a packet to the server to stop fishing, the type can be any of the following parameters:
- SUCCESS_FISHING -> The mini game was solve successfully.
- UNSUCCESS_FISHING -> The mini game was not solve.
The timeLeft represents the time left to fish.
- SendAddFlyTarget(<int>vid,<float>x,<float>y)
Sends a packet to send an arrow at an enemy.
- SendShoot(<byte>uSkill)
Sends an attack packet to the current selected enemy (should be used after SendAddFlyTarget).
uSkill can be:
- COMBO_SKILL_ARCH -> Normal attack.
- BlockFishingPackets()
Blocks client from sending fishing packets (this module will still be able to send)
- UnblockFishingPackets()
Unblocks client from sending fishing packets.
- DisableCollisions()
Disable client colisions with objects and the terrain (Wallhack).
- EnableCollisions()
Enable client colisions.
- RegisterNewShopCallback(<callable_function>callbac k)
Sets a callback function, that will be called whenever a new private shop is created arround.
That callback will be called with the shop vid as the first argument.
- <string>PATH
Path of the location where the library was injected
- GetCloseItemGround(<int>x,<int>y) returns a tupple (<int>vid,<int>x,<int>y)
Returns the closest pickable item in the ground relative to the position given.
The items will be fitler acording to the pickup filter (see below).
Also, it will ignore items owned by other player.
- SendPickupItem(<int>itemVID)
Sends a packet to pickup an item from the ground
- SetMoveSpeedMultiplier(\<float\> speed)<br>
Set the character movement boosting movement speed.
- SendUseSkillPacket(\<int\> skillIndex, \<int\> vid)<br>
Uses a skill with a target vid.
### Pickup Filter
A filter o be applied when calling GetCloseItemGround, by default the filter is set to pick items not present in filter.
- ItemGrndDelFilter(<int> index)
Delets an item id from the filter.
- ItemGrndAddFilter(<int> index)
Adds an item id to the filter.
- ItemGrndOnFilter()
Changes the filter mode, to only return items in the filter.
- ItemGrndNotOnFilter()
Changes the filter mode, to ignore all items present in the filter.
- ItemGrndFilterClear()
Deletes every item in the filter.
### Simulation of old functions
These simulates the functions that were removed from the modules by Gameforge.
This functions can also be accessed from their older modules.
- GetPixelPosition(<int>vid) returns a tupple (x,y,z)
Returns the position of the player by vid
- MoveToDestPosition(<float> x,<float> y)
Moves to a destination.
All functions are available in the eXLib module, to use them just import eXLib.
To execute your script just edit script.py and import yours.
This script will be executed after injection.
Inside the folder there is an example script.
Feel free to contact me on discord(eXploit#8057) for further information about the functions. I will block people that ignore sentence below!
THIS IS ONLY FOR DEVELOPERS, IF YOU DONT KNOW WHAT IS THIS, THEN IT IS NOT FOR YOU, DON'T SPAM THE TOPIC WTH USELESS QUESTIONS
Join our for download links and announcements.
Fell free to donate and support the project
Bitcoin: 1PFmojvLVYsAdYFiQVZqwz5WNs9mTw4nAD
Etherum: 0x1168B532aaEf156b93ff7afb335D7bcaE75F19BD
Cardano: DdzFFzCqrhshKV92CHqGg5eefSGRvvsGnSYgQjyaWqNQYMSfj3 odrsnSyJmy28tmm6zEn1GWNX6rcv14ZpzNsoC8jUjt9osCUtsj 6WJf
PayPal:
|
|
|
06/05/2021, 11:07
|
#2
|
elite*gold: 0
Join Date: Feb 2015
Posts: 26
Received Thanks: 8
|
So that's what you were working on :P . Good job, nice release. I hope that people find this as a good anchor to start doing their thing.
|
|
|
06/05/2021, 13:50
|
#3
|
elite*gold: 0
Join Date: Nov 2016
Posts: 245
Received Thanks: 147
|
Amazing job! Specially path-finding algorithm. Thanks for the release..
|
|
|
06/05/2021, 16:40
|
#4
|
elite*gold: 0
Join Date: Dec 2011
Posts: 50
Received Thanks: 5
|
Thanx for sharing.
İs there a way to execute script.py file to execute every x seconds or execute when enter a new map ?
|
|
|
06/05/2021, 19:26
|
#5
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
Quote:
Originally Posted by KALLLLLLLL
Thanx for sharing.
İs there a way to execute script.py file to execute every x seconds or execute when enter a new map ?
|
It is not needed, you can replicate that feature using only python by using a timer window with the OnUpdate function.
But if this becomes a very requested feature i can add for example a callback function on every frame.
|
|
|
06/06/2021, 01:40
|
#6
|
elite*gold: 0
Join Date: Nov 2015
Posts: 5
Received Thanks: 3
|
Amazing work martinx1,
I managed to revive the old Metin Finder by Eigenartig which uses the GetPixelPosition() and MoveToDestPosition() methods which were removed from the official GF servers some time ago.
|
|
|
06/08/2021, 00:36
|
#7
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
Quote:
Originally Posted by madagascar007
Amazing work martinx1,
I managed to revive the old Metin Finder by Eigenartig which uses the GetPixelPosition() and MoveToDestPosition() methods which were removed from the official GF servers some time ago.
|
BTW, you can speed up that reload process, instead of guessing which instances are close, you can just loop trough InstancesList and check which VID's are metin stones.
|
|
|
06/08/2021, 21:48
|
#8
|
elite*gold: 0
Join Date: Aug 2013
Posts: 6
Received Thanks: 0
|
How to sleep? i am trying to make Autopickup
|
|
|
06/08/2021, 23:29
|
#9
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
Quote:
Originally Posted by vojtani
Can someone give me example how to move to position and how to find item id for loot filter?
|
eXLib.MoveToDestPosition(x,y), where x and y are the coordinates you see on the minimap multiplied by 100.
For pickup use:
HTML Code:
vid, posX, posY = eXLib.GetCloseItemGround(myX,myY)
eXLib.SendPickupItem(vid)
This will get the vid and position of the closest item to you, according to the filter you specified. And then will pick it up.
Quote:
Originally Posted by vojtani
How to sleep? i am trying to make Autopickup
|
Create a window and use the OnUpdate function for that. I will provide a script that does this when i have time.
|
|
|
06/09/2021, 00:02
|
#10
|
elite*gold: 2205
Join Date: Jun 2021
Posts: 108
Received Thanks: 54
|
Great job Thanks for Release
|
|
|
06/09/2021, 00:18
|
#11
|
elite*gold: 0
Join Date: Aug 2013
Posts: 6
Received Thanks: 0
|
@ It will be fantastic because i am beginer at python and i dont understant the code much. Btv where are you from I am from czech
|
|
|
06/09/2021, 01:14
|
#12
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
Quote:
Originally Posted by vojtani
@ It will be fantastic because i am beginer at python and i dont understant the code much. Btv where are you from I am from czech
|
I am from Portugal.
Code:
import net,player,chat
import ui
import time
#Delay in seconds
TIME_WAIT = 3
#Get current time in seconds
def GetTime():
return time.clock()
#Return a tupple, the first value is true or false according if the timer has been reached, and the second value is the current timer
#if first value is true or the old timer if false
def timeSleep(last_time,sleepTime):
timer = time.clock()
if(last_time<timer-sleepTime):
return(True,timer)
return(False,last_time)
class window(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.Show()
self.lastTime = 0
def OnUpdate(self):
val, self.lastTime = timeSleep(self.lastTime,TIME_WAIT)
if val and player.GetStatus(player.HP) <= 0:
#Do Your Stuff
chat.AppendChat(3,"Delayed command")
win = window()
win.Show()
Change the "chat.AppendChat(3,"Delayed command")" for whatever you want to do, and it should execute every 3 seconds.
|
|
|
06/09/2021, 03:27
|
#13
|
elite*gold: 0
Join Date: Apr 2009
Posts: 728
Received Thanks: 179
|
Nice work! I remember when Padmak & co. did a similar library back in the days.
|
|
|
06/09/2021, 13:35
|
#14
|
elite*gold: 0
Join Date: Aug 2013
Posts: 6
Received Thanks: 0
|
@ I was trying to experimnts my own but i find lot of problems. And i dindt find way how to run your code. For example this is my code that describes the problem.
Code:
import chat,eXLib,player,net,chr
import ui
class window(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.Show()
self.my_vid = 0
def OnUpdate(self):
#this is working--------------------------------------------------------------
vids = eXLib.InstancesList
chat.AppendChat(3,"There are "+str(len(vids))+" players/monster arround.")
#-----------------------------------------------------------------------------
# and this is not working-------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-------------------------------------------------
#this is working--------------------------------------------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-----------------------------------------------------------------------------
win = window()
win.Show()
OnUpdate()
|
|
|
06/09/2021, 14:01
|
#15
|
elite*gold: 0
Join Date: Jun 2009
Posts: 67
Received Thanks: 144
|
Quote:
Originally Posted by vojtani
@ I was trying to experimnts my own but i find lot of problems. And i dindt find way how to run your code. For example this is my code that describes the problem.
Code:
import chat,eXLib,player,net,chr
import ui
class window(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.Show()
self.my_vid = 0
def OnUpdate(self):
#this is working--------------------------------------------------------------
vids = eXLib.InstancesList
chat.AppendChat(3,"There are "+str(len(vids))+" players/monster arround.")
#-----------------------------------------------------------------------------
# and this is not working-------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-------------------------------------------------
#this is working--------------------------------------------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-----------------------------------------------------------------------------
win = window()
win.Show()
OnUpdate()
|
I bet you are injecting the script with the PythonInjector.py script. That will yeld you an error because of the inner workings of the exec function that is used on that module, you can read more about someone witha similar error here: .
To work arround that, you have 2 options: - Define every global variable as "global" on every function, in the example you gave, it would become:
Code:
import chat,eXLib,player,net,chr
import ui
class window(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.Show()
self.my_vid = 0
def OnUpdate(self):
global eXLib,chat,net
#this is working--------------------------------------------------------------
vids = eXLib.InstancesList
chat.AppendChat(3,"There are "+str(len(vids))+" players/monster arround.")
#-----------------------------------------------------------------------------
# and this is not working-------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-------------------------------------------------
#this is working--------------------------------------------------------------
my_vid = net.GetMainActorVID()
chat.AppendChat(3,"my_vid:"+str(my_vid))
x,y,z = eXLib.GetPixelPosition(my_vid)
chat.AppendChat(3,"x:"+str(x))
#-----------------------------------------------------------------------------
win = window()
win.Show()
- Import your script from script.py as this does not use exec()
|
|
|
|
|
Similar Threads
|
[RELEASE] Python-Module + Funktionen
09/25/2017 - Metin2 PServer Guides & Strategies - 15 Replies
Moin,
ich dachte mir mal, ich trete in die Fußstapfen von hier mehr oder weniger bekannten Mitgliedern (hier ihre Namen verschlüsselt: CxxP & LaSor) und release was, das ich innerhalb von 5 Minuten bekommen kann.
Und zwar:
Eine vollständige Liste ALLER Module und zugehörigen Funktionen in der Metin2-Binary
Die Binary ist von 2010, da ich aber nicht länger als 5 Minuten brauchen darf, konnte ich die neueren Sachen alle noch nicht extracten. Werde ich nachliefern, sobald die gewünschte...
|
[Release]Python Module Loader fix (musicinstructor's version)
08/23/2014 - Metin2 PServer Guides & Strategies - 26 Replies
Tag Leute,
war eben verwundert, dass es dafür noch keinen fix auf epvp gibt.
Daher hier ein kurzer Guide:
- python22.dll oder python27.dll mit HxD o.Ä. öffnen
- nach diesen beiden Text-Strings suchen (Strg + F):
PyRun_SimpleFile
PyRun_SimpleString
- Jeweils die Strings durch etwas anderes ersetzen
|
All times are GMT +1. The time now is 00:07.
|
|