Advertisement
Guest User

sctrans

a guest
Jul 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. local event = require "event"
  2.      
  3. local char_space = string.byte(" ")
  4. local running = true
  5.      
  6. function unknownEvent()
  7. end
  8.    
  9. local myEventHandlers = setmetatable({}, { __index = function() return unknownEvent end })
  10.      
  11. function myEventHandlers.key_up(adress, char, code, playerName)
  12.   if (char == char_space) then
  13.     running = false
  14.   end
  15. end
  16.      
  17. function handleEvent(eventID, ...)
  18.   if (eventID) then
  19.     myEventHandlers[eventID](...)
  20.   end
  21. end
  22.      
  23. while running do
  24.   handleEvent(event.pull())
  25.  
  26.   local component = require("component")
  27.   local sides = require("sides")
  28.   local colors = require("colors")
  29.   local rs = component.redstone
  30.   local m = component.modem
  31.   m.open(20)  
  32.  
  33. repeat
  34.   while true do
  35.   if (rs.getBundledInput(sides.back, colors.blue)) > 1 then
  36.   print(rs.getBundledInput(sides.back, colors.blue))
  37.   m.broadcast(20, "Iron Buffer Full")
  38.   m.broadcast(20, "Iron Buffer Full")
  39.   break
  40.   end
  41.   end
  42.  
  43.   while true do
  44.   if (rs.getBundledInput(sides.back, colors.blue)) == 0 then
  45.   print(rs.getBundledInput(sides.back, colors.blue))
  46.   m.broadcast(20, "Iron Buffer Loading")
  47.   m.broadcast(20, "Iron Buffer Loading")
  48.   break
  49.   end
  50.   end
  51.  
  52. until(char==char_space)
  53.  
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement