Simple python loader for metin2 client(or any game) that uses Python 2.7 so that you can load your scripts and import modules offered by the game that means you can use functions the game exposed to it's scripting system(bindings).
I couldn't find working loader for 2.7 so here it is.
USAGE: Place PyLoader.mix in metin2 client directory, if you want to use it as .dll then just rename it.
There is no support for compiled python(*.pyc) files and no autoload function but I'm giving you the source code so you can add this yourself!
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
it works with small scripts but when I try to execute longer scripts the client crashes. Any idea for a solution? the other public pyloader (v2.7) have the same problem.
How many lines has your script that crashes the client?
I haven't experienced this issue yet. This could be either problem with python library or metin2 client.
700-1000 lines load just fine to me.
Quote:
Originally Posted by KaMeR1337
try pyrun_simplefile
PyRun_SimpleFile is missing in most of clients like it's not exported
How many lines has your script that crashes the client?
I haven't experienced this issue yet. This could be either problem with python library or metin2 client.
700-1000 lines load just fine to me.
PyRun_SimpleFile is missing in most of clients like it's not exported
dumpbin output:
I want to load , I have a file which just imports the main script (hackbar). But this one imports about 20 other scripts. All in all there are thousands lines of code which have to be imported.
The Pythonloader from musicinstructor for python version 2.2 works fine:
->
I haven't checked your mod yet but I've checked pythonloader you mentioned and it uses PyRun_SimpleFile and PyRunSimpleString. Those functions are high level functions to low level python PyRun_File(more specifically PyRun_FileExFlags, PyParser_ASTFromFile) and PyRun_String(deeper PyRun_StringFlags and very low-level PyParser_ASTFromString) you can find them
Metin2 client bundles custom version of python27.dll which replaces PyModule_GetDict with PyForModule_GetActualDictionary and some Py_ForProgramAddActualName, this is just for confusion but it's exactly the same.
I've tried replacing PyRun_SimpleStringFlags with PyRun_File but the game closes, maybe memory is protected? I will let you know if I find more clues but I rarely find time for playing with games.
The logic behind loading python scripts from file:
Quote:
m = PyImport_AddModule("__main__");
if (m == NULL)
return -1;
d = PyModule_GetDict(m);
.....
v = PyRun_FileExFlags(fp, filename, Py_file_input, d, d,
closeit, flags);
Attached my messy code lol with few different options.
Metin2 client bundles custom version of python27.dll which replaces PyModule_GetDict with PyForModule_GetActualDictionary and some Py_ForProgramAddActualName, this is just for confusion but it's exactly the same.
thats why my multihack crashes on some pserver i suppose
Fixes crashes on 123klo's mod and probably in other scripts too. I will include the source code as soon as I refactor the code.
EDIT: I've got report, there was some problem where you couldn't insert commands for example on Metin2.SG. That's fixed already. See first post for an update.
Quote:
Originally Posted by MasterGamer1
how do I type in the filename?
You can type in the filename now. Download updated dll.
Edit: Maybe Klo123 could help on this as well. Would be AMAZING to see his great hack working again
try to open the file "syser.txt" of your metin2 client and post the content here. Anyway the latest m2kmod version wont work for 2.7 clients at the moment because they are only compiled for 2.2 client. But on 01.06 I will release an update for 2.7 and some other features.
the latest version of maximus780 works with m2kmod now (wait for the update next week)
[Python Frage] Python aus Clienten importieren 04/23/2016 - Metin2 Private Server - 16 Replies Guten Tag.
Ich habe eine kleine Frage. Da ich es selber nicht verstehe und mit Python einfach nichts kann, frage ich mal wieder euch lieben, da ihr mir bis jetzt immer geholfen habt. Ich möchte meinen Skript im Spiel testen ohne die .epk und .eix dauernd zu verpacken/entpacken. Deshalb möchte in in die Game.py in der root.epk eine Art Pfad importieren. Das heißt, ich will es ungefähr so machen:
https://i.gyazo.com/9875d4bbe00655e4af5efbe19789c e14.png
Natürlich ist dies nur ein...
[Python-Modul]EXP-Donator (kompatibel mit Python Loader) 11/23/2013 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 27 Replies Moin,
da man mich danach gefragt hat und ich sowieso mal ein Beispiel für die Benutzung meines Python Loaders veröffentlichen wollte, habe ich die Gelegenheit genutzt und euch eben einen EXP-Spendebot geschrieben.
Man kann ihn einfach mit dem oben verlinkten Python Module Loader laden und ihn mit F5 aktivieren/deaktivieren.
Sobald ihr mehr als 99 Erfahrungspunkte habt (man kann nur in 100er Schritten spenden), werden alle Erfahrungspunkte an eure Gilde gespendet.
Wer Lust hat und...