Advertisement
Metalhead33

Touhou.FM in Minecraft

Nov 12th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local component = require("component")
  2. local fm = component.openfm_radio
  3. local event = require("event")
  4. local keyboard =  require("keyboard")
  5.  
  6. fm.setURL("http://localhost:8080/touhou.ogg") -- Before this, you must start your own substream in VLC, because using http://www.touhou.fm:8001/touhou.ogg will result in the stream being closed after the intro
  7. fm.start()
  8. while true do
  9.     local ev, address, char, code, userName = event.pull("key_down")
  10.     if code == keyboard.keys.back then
  11.         fm.stop()
  12.         break
  13.     elseif code == keyboard.keys.up then
  14.         fm.volUp()
  15.     elseif code == keyboard.keys.down then
  16.         fm.volDown()
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement