Advertisement
gril002

controler Alpha 2.1

Aug 9th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.65 KB | None | 0 0
  1. --NOTE this is a computercraft code for 2 computers to control the MFR auto-spawners--
  2. --THIS omputer needs to be an ADVANCED one the SECOND one DOSEN'T--
  3. --NOTE in order for this to work you also need to dowlodad controler Beta (second computer)--
  4. --http://pastebin.com/ept1tUZQ--
  5. local ID2 = <ID> --Put in the ID of the other computer>
  6. local function GUI()
  7.     term.clear()
  8.     term.setCursorPos(1, 1)
  9.     term.setTextColor(colors.lime)
  10.     print("       Auto-spawner controler 2.1 by gril002")
  11.     term.setTextColor(colors.green)
  12.     print("###################################################")
  13.     print("####                                           ####")
  14.     print("####      esence     enderman      custom      ####") --i know essence its spelled wrong but its for visual purposes--
  15.     print("####                                           ####")
  16.     print("####                                           ####")
  17.     print("###################################################")
  18.         term.setTextColor(colors.lime)
  19.     print(" Type in the name of the spawner to turn it ON/OFF")
  20.     term.setCursorPos(25, 5)
  21.     if enderman1 == "ON" then
  22.         term.setTextColor(colors.lime)
  23.         term.write(enderman1)
  24.         term.setTextColor(colors.white) else
  25.         term.setTextColor(colors.red)
  26.         term.write(enderman1)
  27.         term.setTextColor(colors.white)
  28.     end
  29.     term.setCursorPos(13, 5)
  30.     if essence2 == "ON" then
  31.         term.setTextColor(colors.lime)
  32.         term.write(essence2)
  33.         term.setTextColor(colors.white) else
  34.         term.setTextColor(colors.red)
  35.         term.write(essence2)
  36.         term.setTextColor(colors.white)
  37.     end
  38.     term.setCursorPos(37, 5)
  39.     if custom3 == "ON" then
  40.         term.setTextColor(colors.lime)
  41.         term.write(custom3)
  42.         term.setCursorPos(1, 9)
  43.         term.setTextColor(colors.white) else
  44.         term.setTextColor(colors.red)
  45.         term.write(custom3)
  46.         term.setTextColor(colors.white)
  47.         term.setCursorPos(1, 9)
  48.     end
  49.  end
  50.  
  51.  
  52. local function update()
  53.     rednet.open("back")
  54.     while true do
  55.         local input = read()
  56.         if input == "enderman" then
  57.             if enderman1 == "ON" then
  58.                 rednet.send(1418, "enderman")
  59.                 enderman1 = "OFF"
  60.                 GUI() else
  61.             rednet.send(ID2, "enderman")
  62.             enderman1 = "ON"
  63.             GUI()
  64.             end
  65.         elseif input == "esence" then
  66.             if essence2 == "ON" then
  67.                 rednet.send(ID2, "essence")
  68.                 essence2 = "OFF"
  69.                 GUI() else
  70.             rednet.send(ID2, "essence")
  71.             essence2 = "ON"
  72.             GUI()
  73.             end
  74.         elseif input == "custom" then
  75.             if custom3 == "ON" then
  76.                 rednet.send(ID2, "custom")
  77.                 custom3 = "OFF"
  78.                 GUI() else
  79.             rednet.send(ID2, "custom")
  80.             custom3 = "ON"
  81.             GUI()
  82.             end
  83.         else
  84.             print("invalid command")
  85.        
  86.         end
  87.     end
  88.  end
  89. enderman1 = "OFF"
  90. essence2 = "OFF"
  91. custom3 = "OFF"
  92. GUI()
  93. update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement