karelvysinka

lua test inspect

Jul 17th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local success, data = turtle.inspect()
  2.  
  3. if success then
  4.   print("Block name: ", data.name)
  5.   print("Block metadata: ", data.metadata)
  6. end
  7.  
  8. turtle.suck()
  9.  
  10. local data = turtle.getItemDetail()
  11.  
  12. if data then
  13.   print("Item name: ", data.name)
  14.   print("Item damage value: ", data.damage)
  15.   print("Item count: ", data.count)
  16. end
  17.  
  18. line = "1 1 coal"
  19.  
  20. for token in string.gmatch(line, "[^%s]+") do
  21.    print(token)
  22. end
Add Comment
Please, Sign In to add comment