Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modules = peripheral.find("neuralInterface")
- if not modules then
- error("Must have a neural interface", 0)
- end
- local meta = {}
- local hover = false
- parallel.waitForAny(
- function()
- while true do
- local event, key = os.pullEvent()
- if event == "key" and key == keys.o then
- -- The O key launches you high into the air.
- modules.launch(0, -90, 3)
- elseif event == "key" and key == keys.p then
- -- The P key launches you a little into the air.
- modules.launch(0, -90, 1)
- elseif event == "key" and key == keys.l then
- -- The l key launches you in whatever direction you are looking.
- modules.launch(meta.yaw, meta.pitch, 3)
- elseif event == "key" and key == keys.k then
- -- Holding the K key enables "hover" mode. We disable it when it is released.
- if not hover then
- hover = true
- os.queueEvent("hover")
- end
- elseif event == "key_up" and key == keys.k then
- hover = false
- end
- end
- end,
- function()
- while true do
- meta = modules.getMetaOwner()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement