• 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!

Tibia Tibiando - Audio API for tibia

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},

unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end

More explanations in files on https://sourceforge.net/projects/tibiando/files/

Video Guide:
http://www.youtube.com/watch?v=3b0VVkyARs8
 
Last edited by a moderator:
Approved.

This is very great :p Open Tibia servers are developing faster than Original Tibia ajajaj :D Thanks Mock!
 
Last edited:
:( release one of those spell that pirsuit the target
 
@Znote
thx by aprove it :D
if some on find a bug PLEASE MSG ME!
@Cybershot
??? ._.
 
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},

unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end

More explanations in files on https://sourceforge.net/projects/tibiando/files/



To add on YOUR SERVER download: tibiando-server-api.rar
to add on YOUR CLIENT download tibiando client or source
 
This looks great Mock! Few questions tho.

1. If I am to use sound on my SERVER and place creaturescripts and the audio api.lua in correct positions then where sould I place my sound files login.waw, logout.waw and bum.waw files for the server to know what to play?

2. Not really sure about the audio api.lua file. First is the "config" part.

Code:
 	--Config
	dj.ip = port or 7173
	-- Ip to listen
	dj.bind = "*"
	-- delay to check players location.
	dj.delay = 100
	-- print all received messages on console
	dj.print = false
	-- Dj mode 1- play by player posittion 2- play like radio
	dj.mode = 1 -- mode 2 dont work
	-- Dj] channel ID

What is to be replaced with my servers IP adress? is it
Code:
 	-- Ip to listen
?

Rest of the configuration is a bit vague to my eyes if you got a spare moment please do explain them to me. :)

Other than that this looks really sweet, good job!
 
@Appzyt
where you put sounds? ;D
in client/audio
server only say to client what file to play and client check on audio/

dj.bind = "*" -- DO NOT TOUCH ON THIS
 
Mock i ahve one question ;] U can record mowie for this script build in client. My english is so bad ^^ and sorry for my words. Plz record mowie when this scribt is runing. xD and pm xD
 
Great use of lua sockets.
You should write some tutorial on how to create such a things.
Very useful for custom clients.
 
How add new sound effect?
If I put file sound.mp3 to folder audio and in logout i change
b:send('EF=logout.wav\n') to
b:send('EF=sound.mp3\n') it's not working :(

How do it?

#Sorry for my bad english :/
 
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},

unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end

More explanations in files on https://sourceforge.net/projects/tibiando/files/


How to install:
YouTube - How to install Tibiando (audio) in your OTserv
 
Back
Top