Guest User

startup

a guest
May 30th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. local x = 1
  2.  wsstat = true
  3.  blstat = true
  4.  zpstat = true
  5.  
  6. term.clear()
  7.  
  8. while true do
  9.         term.setCursorPos(1,1)
  10.        
  11.         term.setBackgroundColor((x==1) and colors.blue or colors.black)
  12.         term.setTextColor(wsstat and colors.red or colors.green)
  13.         print("Wither Skeletons: "..(wsstat and "Off" or "On "))
  14.  
  15.         term.setBackgroundColor((x==2) and colors.blue or colors.black)
  16.         term.setTextColor(zpstat and colors.red or colors.green)
  17.         print("Zombie Pigmen: "..(zpstat and "Off" or "On "))
  18.  
  19.         term.setBackgroundColor((x==3) and colors.blue or colors.black)
  20.         term.setTextColor(blstat and colors.red or colors.green)
  21.         term.write("Blazes: "..(blstat and "Off" or "On "))
  22.                
  23.          event, key = os.pullEvent("key")
  24.  
  25.         if key == 208 then   -- Down key pressed
  26.                 x = x + 1
  27.                 if x > 3 then x = 1 end
  28.         end
  29.        
  30.         if key == 200 then   -- Up key pressed
  31.                 x = x - 1
  32.                 if x < 1 then x = 3 end
  33.         end
  34.  
  35.         if key == 28 or key == 57 then   -- Enter or space keys pressed
  36.                 if x == 1 then
  37.                      wsstat = not wsstat
  38.                       redstone.setOutput("back", wsstat)
  39.                 elseif x == 2 then
  40.                         zpstat = not zpstat
  41.                         rs.setOutput("right", zpstat)
  42.                 elseif x == 3 then
  43.                         blstat = not blstat
  44.                         rs.setOutput("left", blstat)
  45.                 end
  46.         end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment