Guest User

recharge

a guest
Mar 5th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. rednet.open("right")
  2. computerID = 1
  3.  
  4. function checkLevels(minimal)
  5.  local pedestal = peripheral.wrap("top")
  6.   if (pedestal.getAspectCount("aer") < minimal) then return false end
  7.   if (pedestal.getAspectCount("terra") < minimal) then return false end
  8.   if (pedestal.getAspectCount("ignis") < minimal) then return false end
  9.   if (pedestal.getAspectCount("aqua") < minimal) then return false end
  10.   if (pedestal.getAspectCount("ordo") < minimal) then return false end
  11.   if (pedestal.getAspectCount("perditio") < minimal) then return false end
  12.   return true
  13. end
  14.  
  15. function levels()
  16.  while not checkLevels(100) == true do
  17.    sleep(15)
  18.    checkLevels(100)
  19.  end
  20.  rednet.send(computerID, Done)
  21.  turtle.suckUp()
  22.  turtle.dropDown()
  23.  rs.setBundledOutput("back", colors.white)
  24.  sleep(2)
  25.  rs.setBundledOutput("back", 0)
  26. end
  27.  
  28. function place()
  29.  turtle.suckDown()
  30.  turtle.select(1)
  31.  turtle.dropUp()
  32.  levels()
  33. end
  34.  
  35. while true do
  36.    local id,msg,dist = rednet.receive()
  37.    func = loadstring(msg.."(...)")
  38.    setfenv(func, getfenv())
  39.    func(id)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment