Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local keyboard = require("keyboard")
- local computer = require("computer")
- local MOtrans = component.mo_transporter
- local on_exit = 1
- require("term").clear()
- function menu()
- print ("K - Ввод координат / Q - Выход из программы")
- end
- function transkoord(x,y,z)
- MOtrans.setX(0,x)--надо указать номер точки и значение координаты, а нумерация начинается с нуля
- MOtrans.setY(0,y)
- MOtrans.setZ(0,z)
- menu()
- end
- function setkoord()
- print ("Введите координаты X, Y, Z в столбик через Enter")
- local x = io.stdin:read()
- local y = io.stdin:read()
- local z = io.stdin:read()
- local x=tonumber(x)
- local y=tonumber(y)%256
- local z=tonumber(z)
- transkoord(x,y,z)
- end
- menu()
- while on_exit == 1 do
- local e = { computer.pullSignal() }
- if e[1] == "key_down" and e[4] == 16 then
- on_exit = 0
- elseif e[4] == 37 then
- setkoord()
- end
- end
RAW Paste Data