ModsAPI method
In normal cases, modsapi will not be available. To enable him, you must create an empty file in the modules folder of the client "PnFModsLoader.py" and "PnFMods" folder.
Stored in the PNFMODS folder the plug-in you need. In the simplest case, the plug-in can only "Main.py" one file.
Result, the simple plug-in may have the following parts "<游戏目录> / res_mods / <版本号> /PnFMods/MyMod/Main.py"。
ModsAPI two-part Flash and Python. Python Main.py and partly responsible for the loaded parts of Flash main.swf.
In the game client separately from Python and Flash, are responsible for sending and receiving data provided by the game port.
We will use a simple plugin to understand.
ModsAPI-Python HelloWorld
"Res_mods/ <版本号>"Folder, create a new file" PnFModsLoader.py "and an empty folder" PnFMods ". In the "PnFMods" folder under the "HelloWorld" to create the folder.

Now in this folder, create an empty file "Main.py", and open it using any editor, and writes the following:
API_VERSION = ' API_v1.0' print ' Hello World!' |
Run the game client, wait for it to load, and then close it, open the file "Python.log", you will see something like the following:
[S] [2016_09_09 22:35:51] [NUT] PlayersAccountsSystem.inContext [S] [2016_09_09 22:35:51] [ModsAPI] 1 mods found, loading... [S] [2016_09_09 22:35:51] Hello World! [S] [2016_09_09 22:35:51] [ModsAPI] Loading mods completed |
ModsAPI-Flash HelloWorld
Flash part ways, we need Flash IDE, for example, "Adobe Creative Cloud Animate CC"
Create a new ActionScript 3.0 projects

DownloadThe latest version of the ModsSDKIn an external SWC library and add it to the IDE


Next in our project to create a”Class”, And various changes, as shown in the following figure

This is a code that creates the white space
package { import lesta.api.ModBase; public class Main extends ModBase { public function Main() { super(); } override public function init():void { super.init(); } override public function fini():void { super.fini(); } override public function updateStage(width:Number, height:Number):void { super.updateStage(width, height); } } } |
We'll write a simple Flash Mods
package { import lesta.api.ModBase; import flash.text.TextField; import flash.text.TextFormat; public class Main extends ModBase { private var tf:TextField = new TextField(); public function Main() { super(); } override public function init():void { super.init(); var format:TextFormat = new TextFormat(); format.size = 40; gameAPI.stage.addChild(tf); tf.defaultTextFormat = format; tf.text = "Hello World!"; tf.textColor = 0xFF0000; tf.width = 250; } override public function fini():void { super.fini(); } override public function updateStage(width:Number, height:Number):void { super.updateStage(width, height); } } } |
“Publishing SWF”Named main.swf, into the”PnFMods”Folder, run the game client and check that it works

This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.