Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local meta = {}
- local modules = peripheral.wrap("back")
- function doHover()
- while true do
- -- We calculate the required motion we need to take
- local mY = meta.motionY
- mY = (mY - 0.138) / 0.8
- -- If it is sufficiently large then we fire ourselves in that direction.
- if mY > 0.5 or mY < 0 then
- local sign = 1
- if mY < 0 then sign = -1 end
- modules.launch(0, 90 * sign, math.min(4, math.abs(mY)))
- else
- sleep(0)
- end
- end
- end
- function getMeta()
- while true do
- meta = modules.getMetaOwner()
- end
- end
- meta = modules.getMetaOwner()
- parallel.waitForAny(doHover,getMeta)
Advertisement
Add Comment
Please, Sign In to add comment