

oldflip=screen.flip

if avisobat then
	pspb=image.load("OTHER/bateria/fondo.png")
	lowb=image.load("OTHER/bateria/low.png")
	newaviso=true

	bat_t=timer.new()
	bat_t:start()
	
	function newflip()
		--Error de Lua (A veces muestra -214...)
		if batt.percent()>0 then
			if batt.percent()<15 then
				if newaviso then
					draw.fillrect(0,0,480,272,color.new(0,0,0,160))
					pspb:blit(140,90)
					lowb:blit(213,112)
					screen.print(240,50,"Baterķa Baja",0.8,azul,blanco,"center")
					oldflip()
					controls.waitforkey()
					bat_t:reset()
					newaviso=false
				else
					if bat_t:time()>300000 then
						newaviso=true
					end
					oldflip()
				end
			else
				oldflip()
			end
		else
			oldflip()
		end
	end

	screen.flip=newflip
end


