• 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
Best answers
0
Reaction score
101
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:

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
110
You're always releasing things that are helpfull. Good work.
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
Thanks!
 

Jaed Le Raep

★Gaeming★
Joined
Sep 3, 2007
Messages
1,110
Best answers
0
Reaction score
240
What kind of sockets are these? Or rings? I'm a bit confused sadly to say.
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
@Jaedy
like all sockets, you can create a chat betwneen 2 servers.
Rings its to create new luastates :p
 

Jaed Le Raep

★Gaeming★
Joined
Sep 3, 2007
Messages
1,110
Best answers
0
Reaction score
240
Wow.. now that's simply awesome, I get what you mean. Great job Mock :)
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
Always its better use linux.
but luasocket work better on linux 64x
 

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
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.
 

MrLipzZz

HTML 'haha
Joined
Nov 27, 2008
Messages
171
Best answers
0
Reaction score
0
Location
Brazil
Installing it atm , my DSL connection is fcked up , all the time the DSL Light goes down! and players DIES hahahahha !
 

Frogq

New Member
Joined
Jun 1, 2010
Messages
45
Best answers
0
Reaction score
1
Mock, Think you can re-upload the modules attachment from this page for the tibia API sound
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
omg it lost the attach?
 

Mark

Administrator
Staff member
Administrator
Joined
May 27, 2007
Messages
6,389
Best answers
21
Reaction score
1,394
Location
Sweden
Fixed the attachments :).
 
Top