Advertisement
Zantag

Thaum Scanner Turtle

Jun 12th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. state = {
  2. lastMessage = nil
  3. }
  4. b = peripheral.wrap("left")
  5. rednet.open("right")
  6.  
  7. function sendAspects(table)
  8. if table ~= nil then
  9. aspectTable = textutils.serialize(table)
  10. if state.lastMessage ~= aspectTable then
  11. rednet.broadcast(aspectTable)
  12. lastMessage = aspectTable
  13. end
  14.  
  15. end
  16. end
  17.  
  18. while true do
  19.  
  20. aspects = b.getAspectsDown()
  21.  
  22. if next(aspects) == nil then
  23. rednet.broadcast("none")
  24. state.lastMessage = nil
  25. else
  26. sendAspects(aspects)
  27. end
  28.  
  29. for i = 1, 16 do
  30. if turtle.getItemCount(i) > 0 then
  31. turtle.select(i)
  32. turtle.dropDown()
  33. sleep(0.2)
  34. end
  35. end
  36.  
  37. sleep(0.4)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement