marko_rus

Miner software

Dec 24th, 2017
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. local robot = require("robot")
  2. local computer = require("computer")
  3. local term = require("term")
  4. print (" ________________________________________________")
  5. print ("| Miner software                         v 1.0.5 |")
  6. print ("|    By marko_rus (marko_ru)                     |")
  7. print ("|   (C) MCInc      All rights reserved!          |")
  8. print ("|________________________________________________|")
  9. local h
  10. local hc
  11. local dm =1  -------0 Выввод в консоль растояние  1нет
  12. local mode
  13. print ("Введите расстояние в блоках")
  14. h =io.read()
  15. hc =h
  16. print ("Выберите режим")
  17. print ("1  тоннель")
  18. print ("2  лестница")
  19. mode =io.read()
  20. mode =mode-1
  21. computer.beep(300)
  22. computer.beep(600)
  23. computer.beep(1000)
  24. if mode == 0 then print ("После завершения работ ваш робот прийдет к старт. поз.")
  25. end
  26. print ("Запуск...")
  27. if mode == 0 then
  28. while true do
  29.  robot.swing()
  30.  robot.forward()
  31.  robot.swingUp()
  32. h =h-1
  33. if dm == 0 then
  34. print ("Осталось ")
  35. print (h)
  36. print ("m")
  37. print ("----------")
  38. end
  39.  
  40. if h == 0 then
  41. robot.turnAround()
  42. while true do
  43. robot.forward()
  44. hc =hc-1
  45. if hc == h then
  46. computer.beep(1000)
  47. computer.beep(600)
  48. computer.beep(300)
  49. print ("готово!")
  50. term.clear()
  51. computer.shutdown()
  52. end
  53. end
  54. end
  55. end
  56. end
  57. while true do
  58. robot.swing()
  59. robot.forward()
  60. robot.swingUp()
  61. robot.swingDown()
  62. robot.down()
  63. h =h-1
  64. if h == 0 then
  65. computer.beep(1000)
  66. computer.beep(600)
  67. computer.beep(300)
  68. print ("готово!")
  69. term.clear()
  70. computer.shutdown()
  71. end
  72. end
Add Comment
Please, Sign In to add comment