Advertisement
Guest User

Untitled

a guest
Dec 30th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. print('Робот-верстачник v1 by evgkul')
  2. print('Для крафта одного предмета нажмите Enter. Для крафта максимально возможного количества предметов Shift+Enter')
  3. print('Для того, чтобы поменять местами основной верстак с дополнительным нажмите цифру(Основной верстак-0)')
  4. print('В СЛОТ ДЛЯ ИНСТРУМЕНТА НЕ ЛЕЗТЬ!!!')
  5. local component=require('component')
  6. local os=require('os')
  7. local wbench_size=12
  8. local r=component.robot
  9. local inv=component.inventory_controller
  10. local io=require('io')
  11. local craft=component.crafting.craft
  12. local keyboard=require('keyboard')
  13. local function swap(wbench_id)
  14. r.select(1)
  15. local swapsize=wbench_id*wbench_size
  16. for i=1,11 do
  17. r.select(i)
  18. inv.equip()
  19. r.select(i+swapsize)
  20. inv.equip()
  21. r.select(i)
  22. inv.equip()
  23. os.sleep(0.01)
  24. end
  25. end
  26. while true do
  27. local command = io.read()
  28. if command=="" then
  29. r.select(12)
  30. if keyboard.isShiftDown()==true then
  31. craft()
  32. else
  33. craft(1)
  34. end
  35. else
  36. swap(tonumber(command))
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement