function liveFc(args,player)
	if liveOn then
		liveOn=false
		chatbox.tell(player,"Affichage du live desactive")
	else
		liveOn=true
		chatbox.tell(player,"Affichage du live active")
	end
end
chatbox.add("live",liveFc,"Lance ou stop le mode live (marche uniquement chez adsl houba)")


function initChat()
	chatbox.say("Bonjour, je suis operationnel")
	while true do
		local event, player, msg = os.pullEvent("chat") 
		question(player,msg)
	end
end
function question(player,msg)
	particule.couleur(0,0,255);
	tmp=http.post("http://www.adslhouba.fr/_comment/albert.php","pseudo="..player.."&msg="..msg)
	if tmp==nil then
		chatbox.pp.say("Je n'ai pas acces a internet",9999,false,'Alfred')
	else
		donne=tmp.readAll()			
		chatbox.pp.say('§e'..tostring(donne),9999,false,'Alfred')
	end
	particule.couleur(255,0,0);
end
liveOn=false
function initLive()
	while true do
		if liveOn then
			tmp=http.get("http://localhost/houba/_comment/live2.php")
			if tmp==nil then
				chatbox.say("Je n'ai pas acces au live")
			else
				test=tmp.readAll()
				print(test)
				donne=textutils.unserialize(test)

				for i, dt in pairs(donne) do
					chatbox.pp.say(tostring(dt.msg),9999,false,tostring(dt.auteur))
					os.sleep(0.5)
					if dt.first=="1" then
						print("FIRST")
						
						chatbox.say('§eBonjour '..tostring(dt.auteur))
						os.sleep(0.5)
					end
					if dt.question==1 then
						question(dt.auteur..'(LIVE)',dt.msg)
					end
				end
			end
			os.sleep(3)			
		else
			os.sleep(20)
		end
	end
end