Advertisement
OmegaRogue

ShipControl

Nov 3rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. modem = peripheral.wrap
  2. while true do
  3.     Shield = peripheral.find("warpdriveForceFieldProjector")
  4.     Cloaking = peripheral.find("warpdriveCloakingCore")
  5.     term.clear()
  6.     term.setCursorPos(1,1)
  7.     write(">")
  8.     state = read("")
  9.     if state == "stealth1" then
  10.         for i=1,#Shield do
  11.             peripheral.call(Shield[i], "enable")
  12.         end
  13.         for i=1,#Cloaking do
  14.             peripheral.call(Cloaking[i], "cloak1")
  15.         end
  16.     elif state == "stealth2" then
  17.         for i=1,#Shield do
  18.             peripheral.call(Shield[i], "enable")
  19.         end
  20.         for i=1,#Cloaking do
  21.             peripheral.call(Cloaking[i], "cloak2")
  22.         end
  23.     elif state == "shieldOn" then
  24.         for i=1,#Shield do
  25.             peripheral.call(Shield[i], "enable")
  26.         end
  27.     elif state == "shieldOff" then
  28.         for i=1,#Shield do
  29.             peripheral.call(Shield[i], "disable")
  30.         end
  31.     elif state == "Cloak1" then
  32.         for i=1,#Cloaking do
  33.             peripheral.call(Cloaking[i], "cloak1")
  34.         end
  35.     elif state == "Cloak2" then
  36.         for i=1,#Cloaking do
  37.             peripheral.call(Cloaking[i], "cloak2")
  38.         end
  39.     elif state == "Uncloak" then
  40.         for i=1,#Cloaking do
  41.             peripheral.call(Cloaking[i], "uncloak")
  42.         end
  43.     elif state == "Red Alert" then
  44.         redstone.setOutput("front")
  45.         redstone.setOutput("back")
  46.         redstone.setOutput("left")
  47.         redstone.setOutput("right")
  48.         redstone.setOutput("top")
  49.         redstone.setOutput("bottom")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement