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
- if not modules.hasModule("plethora:sensor") then
- error("Must have a sensor", 0)
- end
- if not modules.hasModule("plethora:introspection") then
- error("Must have an introspection module", 0)
- end
- if not modules.hasModule("plethora:kinetic", 0) then
- error("Must have a kinetic agument", 0)
- end
- parallel.waitForAny(
- function()
- while true do
- local event, key = os.pullEvent()
- if event == "key" then
- if key == keys.c then
- -- launch strong
- modules.launch(meta.yaw, meta.pitch, 4)
- elseif key == keys.v then
- -- launch weak
- modules.launch(meta.yaw, meta.pitch, 1)
- end
- end
- end
- end,
- function()
- while true do
- meta = modules.getMetaOwner()
- os.sleep() -- 20 updates per second is more than enough. I think modules.getmetaowner takes a tick as well though, so it may only be 10 per second. Still much more than enough.
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement