• 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 Stream Website

helflin

New Member
Joined
Sep 8, 2011
Messages
9
Reaction score
0
Location
Rio de Janeiro
Hi guys,
---------------------------------------------------------------------------------------
Here, in this link have any example:
https://otland.net/threads/stream-live-from-your-website.175351/
But doesnt works in TFS 0.4, because have many errors.
---------------------------------------------------------------------------------------
In this website, this works in TFS 0.4:
http://www.megatibia.com.br/?subtopic=streamtemple
I think that's adaptable.
---------------------------------------------------------------------------------------
What I need?
1- A page similar to page of megatibia link.
2- Lua script [GlobalEvents] working for TFS 0.4.
---------------------------------------------------------------------------------------
What are my settings?
1- Gesior / XAMPP / Windows.
2- TFS 0.4, Global Server [TIBIA, not poketibia]
---------------------------------------------------------------------------------------
I think some of you with knowledge in LUA and DESIGNER could give me a hand in this, thank you. Sorry for mistakes.

Note: If any member does this, may lay as tutorial forum, it would be interesting!
 
Hi guys,
---------------------------------------------------------------------------------------
Here, in this link have any example:
https://otland.net/threads/stream-live-from-your-website.175351/
But doesnt works in TFS 0.4, because have many errors.
---------------------------------------------------------------------------------------
In this website, this works in TFS 0.4:
http://www.megatibia.com.br/?subtopic=streamtemple
I think that's adaptable.
---------------------------------------------------------------------------------------
What I need?
1- A page similar to page of megatibia link.
2- Lua script [GlobalEvents] working for TFS 0.4.
---------------------------------------------------------------------------------------
What are my settings?
1- Gesior / XAMPP / Windows.
2- TFS 0.4, Global Server [TIBIA, not poketibia]
---------------------------------------------------------------------------------------
I think some of you with knowledge in LUA and DESIGNER could give me a hand in this, thank you. Sorry for mistakes.

Note: If any member does this, may lay as tutorial forum, it would be interesting!
post the log of errors ya?
 
In my file globalevents.xml:
Code:
<globalevent name="stream" interval="1000" event="script" value="stream.lua"/>

My stream.lua in globalevents/scripts:
function onThink(cid, interval)
local centerPos = {x=1067,y=1062,z=7}
local cyko = {
streampos = getSpectators(centerPos, 12, 10, false), --Middle pos of the temple and radius.
ghost = false, --You want allow players which using ghost? true of false.
}
local stream = "{"
if cyko.streampos then
for i = 1, #cyko.streampos do
local cid = cyko.streampos
if isPlayer(cid) and isPlayerGhost(cid) == cyko.ghost then
stream = stream .. '"'..getCreatureName(cid)..'":['.. getCreaturePosition(cid).x - (centerPos.x-10) ..','.. getCreaturePosition(cid).y - (centerPos.y-9) ..','.. getCreaturePosition(cid).z ..','.. getCreatureOutfit(cid).lookType ..','.. getCreatureOutfit(cid).lookAddons ..','.. getCreatureOutfit(cid).lookHead ..','.. getCreatureOutfit(cid).lookBody ..','.. getCreatureOutfit(cid).lookLegs ..','.. getCreatureOutfit(cid).lookFeet ..',0,'.. (getCreatureLookDirection(cid)) ..',' .. getCreatureOutfit(cid).lookTypeEx .. ','.. getCreatureSkullType(cid) ..'],';
end
end
end
stream = stream .. '}'
local text = stream
local file = io.open("C:/xampp/htdocs/cache/stream.json", "w")
file:write("".. text .. "")
file:close()
return true
end


My file stream.json in htdocs/cache:
Code:
{"Teste  Nome":[10,9,7,128,0,78,68,58,0,0,1,0,0],}

Print of Location in server:
150713073444919953.png


Print of Website:
150713073436686625.png

Actually, i think that the webcode is wrong.

Can you makes a page similar to this: (http://www.megatibia.com.br/?subtopic=streamtemple)
If you do that, i think that my page have any bug because doesnt show de players and they are in file .json..

Sorry for mistakes.
 
Back
Top