Advertisement
Andersfc

analyze

Nov 23rd, 2012
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. --Pastebin: "9TBbzyfi"
  2. --A=Alpha, B=Beta, F=Finished
  3. --This version is: A1
  4. --This program requires the peripheral : turtle item analyzer (Someone 9999's) peripheral
  5. --It is just basic code, that you can add onto feks. make it drop Cobble into 1 chest
  6. --and dirt in the other (sorting purposes)
  7. --This program has alot of oppourtunities  
  8.  
  9. function CheckItem()
  10.  
  11. local spruce = 0
  12. shell.run("clear")
  13. local analyzer = peripheral.wrap("right")
  14. turtle.select(1)
  15. A = print("I just identified: <" .. analyzer.getBlockName()..">")
  16. B = print("id #" .. analyzer.getBlockId()..":"..analyzer.getBlockMetadata())
  17.  
  18. if analyzer.getBlockName() == "Cobblestone" then
  19. print("Cobblestone was found")
  20. end
  21. if analyzer.getBlockId() == 1 then
  22. print("Stone was found")
  23. end
  24. if analyzer.getBlockId() == 5 then
  25. spruce = spruce+1
  26. end
  27. if analyzer.getBlockMetadata() == 1 then
  28. spruce = spruce+1
  29. end
  30. if spruce == 2 then
  31. print("Spruce wood plank was found")
  32. sleep(1)
  33. spruce = spruce-spruce
  34. end
  35. end
  36.  
  37. CheckItem()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement