Advertisement
Guest User

startup.lua

a guest
Mar 30th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. local ec = peripheral.find "ender_chest"
  2. local ecinv = peripheral.find "minecraft:ender chest"
  3.  
  4. local z = ...
  5. if z then
  6.     ec.setFrequency(tonumber(z, 16))
  7.     return
  8. end
  9.  
  10. for i = 0, 0xFFF do
  11.     ec.setFrequency(i)
  12.     local count = 0
  13.     for _, s in pairs(ecinv.list()) do
  14.         count = count + s.count
  15.     end
  16.     if count > 0 then
  17.         print(os.date "!%X", table.concat(ec.getFrequencyColors(), "/"), ("0x%03x"):format(i), count)
  18.     end
  19.     sleep(0.1)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement