Guest User

startup.lua

a guest
Nov 9th, 2022
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. shell.run("clear")
  2. print("overflow protection")
  3.  
  4. rednet.open("left")
  5. local storage = peripheral.wrap("bottom")
  6. local protocol = "andesite_overflow"
  7.  
  8. while true do
  9.     if (#storage.list() / storage.size()) > 0.90 then
  10.         rednet.broadcast("block", protocol)
  11.        
  12.         shell.run("clear")
  13.         print("blocking...")
  14.     else
  15.         rednet.broadcast("allow", protocol)
  16.        
  17.         shell.run("clear")
  18.         print("allowing...")
  19.     end
  20.        
  21.     sleep(5)    
  22. end
Add Comment
Please, Sign In to add comment