- Joined
- Dec 26, 2013
- Messages
- 1,558
- Solutions
- 11
- Reaction score
- 774
Hello, with this script you can install lua socket, lua ex, luasql, lua wathever on your server!
With this you can config with an XML all modules:
Its just add one line and files on folder.Code:<?xml version="1.0" encoding="UTF-8"?> <modules> <module name="socket"/> <module name="socket.http"/> <module name="luasql.sqlite3"/> <module name="luasql.mysql"/> <module name="ex"/> <module name="rings"/> <module name="coxpcall"/> <module name="copas"/> <module name="ltn12"/> <module name="gd"/> <!--Example--> <module name="example"/> <module dofile="dofile example.lua"/> </modules>
To instal:
Code:1º - download the attached file. 2º - Put folder modules on data. 3º - If you use TFS 0.3.6 just put modules.lua on data/lib ----------- If you use TFS 0.3.4 or less put modules on data/lib and on last line of data.lua add it: dofile('data/lib/modules.lua') ----------- If you use Open tibia put modules.lua on data and add it on [B]global.lua[/B]: dofile('data/modules.lua') ----------- 4º - Reload and done!
You can download more libs here: LuaForge: Top Downloads
Recomended libs:
- GD lib
- Lua file system
- Lua SSL
- Lua conio
- CURL
You can create you own modules using this example:
Lua:--[[ Example how to create a module. ]] --Module example module('example') _VERSION = "V 1.0" -- In scripts you use: example.foo(v) function foo(v) return type(v)..' '..tostring(#(v or '')) end
How to install one module.
First download one module.
Lets use GD lib how as example. http://luaforge.net/frs/download.php/1594/lua-gd-2.0.33r2-win32.zip (1.6mb)
When you finish open .zip and open folder.
Inside it will have aprox 8dlls (in some libs only one dll)
Copy all DLLS an paste on data/modules/scripts and add it on modules.xml
Code:<module name="gd"/>
This version is 1.2.
Features:
- You can require a lib
- You can dofile in a script <module dofile="dofile example.lua"/>
- At same time you can require and dofile: <module name="conio" dofile="conio.luac"/>
With this v 1.2 it came with
- socket
- luasql
- ex
- rings
- coxpcall
- copas
- gd
Here is the attach :View attachment 7624
When I use it I get a problem with loading global, says I don't have enough memory, and the only thing I have in the xml file is the example script, and its exactly the same except I added 1 line, print("modules loaded"), and I have 4.32 gigs of ram free....