• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua modules in otserv (socket, luasql, ...)

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
New version:
http://otland.net/f163/lua-modules-socket-luasql-etc-libs-v1-2-a-96609/









-

Hello, with this script you can install lua socket, lua ex, luasql, lua wathever on your server!
Its verry easy, it works on all otserv, the real problem its the bad instalation.

With this you can config with an XML all modules:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<modules>
	<module name="example"/>
	<module name="socket"/>
	<module name="rings"/>
	<module name="luasql.mysql"/>
	<module name="ex"/>
</modules>
Its just add one line and files on folder.
To instal:
Code:
1º - download the attached file.
2º - Put folder modules on data.
32º - 
	If you use TFS 0.3.6 just put modules.lua on data/lib
	-----------
	If you use TFS 0.3.5 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 global.lua:
	dofile('data/modules.lua')
	-----------
4º - Reload and done!

You can download more libs here: LuaForge: Top Downloads
Recomended libs:
  • GD lib
  • Lua file system


You can create you own modules using this example:
Lua:
--[[
Example how to create a module.
]]
--declare all used libs to save memory
local string = require("string")
local base = _G
-- Module name
module('example')
-- Module version
_VERSION = "Example lib 1.0"

--- and here functions

function myprint(...) --example.myprint
	local arg = {...}
	for i,b in base.pairs(arg) do
		io.write(tostring(b))
		if i ~= #arg then
			io.write(',    ')
		end
	end
end

function array(...) -- example.array
	return {...}
end

function replace(s,m,d) --example.replace
	return s:gsub(m,d)
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"/>
 

Attachments

Last edited:
You're always releasing things that are helpfull. Good work.
 
Thanks!
wink.gif
 
@Jaedy
like all sockets, you can create a chat betwneen 2 servers.
Rings its to create new luastates :p
 
Always its better use linux.
but luasocket work better on linux 64x
 
Mock, can you tell me something?
Where the fuck did you come from?
And how do you know so much about stuff lol ?
Can you tell me your server ip? I'd like to check it out.
 
Installing it atm , my DSL connection is fcked up , all the time the DSL Light goes down! and players DIES hahahahha !
 
Mock, Think you can re-upload the modules attachment from this page for the tibia API sound
 
Fixed the attachments :).
 
Back
Top