Advertisement
kaibochan

overflow_transmit.lua

Nov 9th, 2022 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shell.run("clear")
  2. print("overflow protection")
  3.  
  4. rednet.open("left")
  5. local storage = peripheral.wrap("bottom")
  6. local protocol = "_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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement