Advertisement
koki2000

lépcsőző felfelé

Oct 11th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. build = 0
  2. slot = 1
  3. back = 0
  4.  
  5. rednet.open("right")
  6.  
  7. function fogad()
  8. kuldo, uzenet = rednet.receive(180)
  9.   print(uzenet)
  10.   if uzenet == "back" then
  11.     for i = 1, 3 do
  12.     turtle.back()
  13.     end
  14.     sleep(2)
  15.   end
  16.   build = read()
  17. end
  18.  
  19. function clear()
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. end
  23.  
  24. function slotc()
  25.   if turtle.getItemCount(slot) < 1 then
  26.   slot = slot + 1
  27.   turtle.select(slot)
  28.   print("Slot: ", slot)
  29.     if turtle.getItemCount(9) < 1 then
  30.     slot = 1
  31.     build = 0
  32.     turtle.select(slot)
  33.     print("Slot ures")
  34.     sleep(1)
  35.     end
  36.   end
  37. end
  38.  
  39. function builder()
  40. fogad()
  41. build = build + 0
  42.   if build > 0 then
  43.     for i = 1, build do
  44.     slotc() sleep(1)
  45.     print("slot: ", slot)
  46.     turtle.place()
  47.     turtle.up()
  48.     turtle.forward()
  49.     sleep(1)
  50.     back = back + 1
  51.     print("back: ", back)
  52.     end
  53.     build = 0
  54.       if build < 1 then
  55.         for i = 1, back do
  56.         print("Back: ", back)
  57.         turtle.back()
  58.         turtle.down()
  59.         sleep(1)
  60.         end
  61.       end
  62.   end
  63. end
  64.  
  65. while true do
  66. builder()
  67. sleep(.1)
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement