Advertisement
Swimy

Untitled

Mar 30th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. --[[ Crafting Display ]]--
  2.  
  3. local modemSide="left"
  4.  
  5. rednet.open(modemSide)
  6.  
  7. local mon=peripheral.wrap("right")
  8.  
  9. --[[ Make strings that correspond with your turtles ]]--
  10. displayStrings = {
  11. "Wireless Turtle ",
  12. " Turtle ",
  13. " Iron ",
  14. " Computer ",
  15. " Glass Pane ",
  16. " Red Stone ",
  17. " Stone ",
  18. " Chest ",
  19. " Wood ",
  20. " Modem ",
  21. " Redstone Torch ",
  22. " Stone "
  23. }
  24.  
  25. --[[ Find the ids of the above turtles and put them
  26. here in the same order as your list of
  27. displayStrings ]]--
  28. displayIds = {
  29. 97,
  30. 96,
  31. 95,
  32. 93,
  33. 90,
  34. 89,
  35. 91,
  36. 94,
  37. 92,
  38. 88,
  39. 86,
  40. 87
  41. }
  42.  
  43. while true do
  44. for i,v in ipairs(displayIds) do
  45. rednet.send(v,"Inventory Request")
  46. senderId,message,distance=rednet.receive(2)
  47. mon.setCursorPos(1,i)
  48. mon.write("->")
  49. mon.setCursorPos(1,i)
  50. os.sleep(1)
  51. mon.clearLine()
  52. if senderId == v then
  53. mon.write(displayStrings[i]..message)
  54. else
  55. mon.write(displayStrings[i].."?")
  56. end
  57. end
  58. os.sleep(5)
  59. end
  60.  
  61. > WLcountInventory
  62. --[[ Take inventory ]]--
  63.  
  64. print "In WL Count Inventory"
  65. rednet.open("right")
  66.  
  67. local a
  68. local inv
  69.  
  70. while true do
  71. senderId,message,distance=rednet.receive()
  72. if message == "Inventory Request" then
  73. a = 1
  74. inv=0
  75. while a <= 9 do
  76. inv = inv + turtle.getItemCount(a)
  77. a = a + 1
  78. end
  79. print("inv is "..inv)
  80. rednet.send(senderId,tostring(inv))
  81. end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement