SHARE
TWEET

Neural.lua

fatboychummy Oct 21st, 2019 (edited) 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modules = peripheral.find("neuralInterface")
  2. if not modules then
  3.   error("Must have a neural interface", 0)
  4. end
  5.  
  6. if not modules.hasModule("plethora:sensor") then
  7.   error("Must have a sensor", 0)
  8. end
  9. if not modules.hasModule("plethora:introspection") then
  10.   error("Must have an introspection module", 0)
  11. end
  12. if not modules.hasModule("plethora:kinetic", 0) then
  13.   error("Must have a kinetic agument", 0)
  14. end
  15.  
  16. local meta = {}
  17.  
  18. parallel.waitForAny(
  19.   function()
  20.       while true do
  21.         local event, key = os.pullEvent()
  22.       if event == "key" then
  23.         if key == keys.c then
  24.           -- launch strong
  25.           modules.launch(meta.yaw, meta.pitch, 4)
  26.         elseif key == keys.v then
  27.           -- launch weak
  28.           modules.launch(meta.yaw, meta.pitch, 1)
  29.         end
  30.       end
  31.     end
  32.   end,
  33.   function()
  34.     while true do
  35.       meta = modules.getMetaOwner()
  36.     end
  37.   end
  38. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top