Advertisement
Guest User

agricraft.lua

a guest
Jul 23rd, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3.  
  4. local analyzer = component.agricraft_peripheral
  5.  
  6. local running = true
  7.  
  8. function analyzer.specimenChanged(current_specimen)
  9.   local specimen = analyzer.getSpecimen()
  10.   return specimen ~= current_specimen
  11. end
  12.  
  13. local current_speciment = nil
  14.  
  15. while running do
  16.   if analyzer.specimenChanged(current_specimen) then
  17.     current_specimen = analyzer.getSpecimen()
  18.     print("Specimen changed to:")
  19.     print(current_specimen)
  20.   end
  21.  
  22.   os.sleep(1)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement