Advertisement
Plazter

test1233

Oct 8th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. rednet.open("right")
  2.  
  3. function wait()
  4. rednet.send(ID, "SmartShop V.3 - Program: 1 - Cost: 16 credits")
  5. end
  6.  
  7. function action()
  8. turtle.suck()
  9. if turtle.compareTo(16) == true then
  10.  
  11. if turtle.getItemCount(1) == 16 then
  12. turtle.dropDown()
  13. rs.setBundledOutput("back", colors.white)
  14. sleep(1)
  15. rs.setBundledOutput("back", 0)
  16. rednet.send(ID, "You paid the right amount!")
  17.  
  18.  
  19. elseif turtle.getItemCount(1) > 16 then
  20. turtle.transferTo(2,16)
  21. turtle.select(2)
  22. turtle.dropDown()
  23. turtle.select(1)
  24. turtle.dropUp()
  25. rs.setBundledOutput("back", colors.white)
  26. sleep(1)
  27. rs.setBundledOutput("back", 0)
  28.  
  29. elseif turtle.getItemCount(1) < 16 then
  30. rednet.send(ID, "You did not Pay enough.. I've send your stuff back up!")
  31. end
  32. end
  33.  
  34. function put()
  35. wait()
  36. if rs.getBundledInput("left", colors.white) == true then
  37. action()
  38. end
  39. sleep(1)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement