Advertisement
dasOlli

BeesBeesBees

Apr 4th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. -- config
  2. local playerName = "Cow"
  3. local redstoneSide = "left"
  4.  
  5. -- peripherals stuff
  6. local chatbox = peripheral.find("chatBox")
  7.  
  8. if not chatbox then
  9.   error("No ChatBox found :(")
  10. end
  11.  
  12. -- db stuff
  13. --[[
  14. local statelist = {
  15.   ["top"] = rs.getInput("top"),
  16.   ["front"] = rs.getInput("front"),
  17.   ["left"] = rs.getInput("left"),
  18.   ["right"] = rs.getInput("right"),
  19.   ["back"] = rs.getInput("back"),
  20.   ["bottom"] = rs.getInput("bottom"),
  21. }
  22. ]]--
  23.  
  24. term.clear()
  25. term.setCursorPos(1,1)
  26.  
  27. while true do
  28.   os.pullEvent("redstone")
  29.  
  30.   if rs.getInput(redstoneSide) then
  31.     sleep(0.1)
  32.     if rs.getInput(redstoneSide) then -- is redstone still one after 2 ticks?
  33.       chatbox.tell(playerName, "Apiary has an error!", 64, true)
  34.     end
  35.   end
  36.   -- check each side for redstone changes
  37. --[[
  38.   for side, state in pairs(statelist) do
  39.     if rs.getInput(side) ~= state then
  40.       print(side.." is now "..tostring(rs.getInput(side)))
  41.       statelist[side] = rs.getInput(side)
  42.       if side == redstoneSide then
  43.         chatbox.tell(playerName, "Apiary has an error!", 64, true)
  44.       end
  45.     end
  46.   end
  47.   ]]--
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement