Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("right")
- redf = peripheral.wrap("redstoneIntegrator_27")
- redb = peripheral.wrap("redstoneIntegrator_28")
- redconst = peripheral.wrap("redstoneIntegrator_29")
- m.clear()
- m.setTextScale(1)
- os.loadAPI("button")
- button.clearTable()
- term.clear()
- term.setCursorPos(1,1)
- local a = 0
- local b = 0
- local fin = 0
- function fillTable()
- button.setTable("get container",getcontainer,2,49,2,6)
- button.setTable("move container",movecontainer,2,49,8,12)
- button.setTable("send container",sendcontainer,2,49,14,18)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function getcontainer()
- button.flash("get container")
- fin = 0
- a = 0
- b = 0
- m.clear()
- button.clearTable()
- function fillTable()
- button.setTable("1",one,2,4,2,4)
- button.setTable("2",two,6,8,2,4)
- button.setTable("3",three,10,12,2,4)
- button.setTable("4",four,14,16,2,4)
- button.setTable("5",five,18,20,2,4)
- button.setTable("6",six,2,4,6,8)
- button.setTable("7",seven,6,8,6,8)
- button.setTable("8",eight,10,12,6,8)
- button.setTable("9",nine,14,16,6,8)
- button.setTable("10",ten,18,21,6,8)
- button.setTable("11",eleven,2,5,10,12)
- button.setTable("12",twelve,7,10,10,12)
- button.setTable("13",thirteen,12,15,10,12)
- button.setTable("14",fourteen,17,20,10,12)
- button.setTable("15",fifteen,22,25,10,12)
- button.setTable("confirm",confirm,39,49,16,18)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function one()
- button.flash("1")
- if a == 0 then
- a = 1
- else
- b = 1
- end
- end
- function two()
- button.flash("2")
- if a == 0 then
- a = 2
- else
- b = 2
- end
- end
- function three()
- button.flash("3")
- if a == 0 then
- a = 3
- else
- b = 3
- end
- end
- function four()
- button.flash("4")
- if a == 0 then
- a = 4
- else
- b = 4
- end
- end
- function five()
- button.flash("5")
- if a == 0 then
- a = 5
- else
- b = 5
- end
- end
- function six()
- button.flash("6")
- if a == 0 then
- a = 6
- else
- b = 6
- end
- end
- function seven()
- button.flash("7")
- if a == 0 then
- a = 7
- else
- b = 7
- end
- end
- function eight()
- button.flash("8")
- if a == 0 then
- a = 8
- else
- b = 8
- end
- end
- function nine()
- button.flash("9")
- if a == 0 then
- a = 9
- else
- b = 9
- end
- end
- function ten()
- button.flash("10")
- if a == 0 then
- a = 10
- else
- b = 10
- end
- end
- function eleven()
- button.flash("11")
- if a == 0 then
- a = 11
- else
- b = 11
- end
- end
- function twelve()
- button.flash("12")
- if a == 0 then
- a = 12
- else
- b = 12
- end
- end
- function thirteen()
- button.flash("13")
- if a == 0 then
- a = 13
- else
- b = 13
- end
- end
- function fourteen()
- button.flash("14")
- if a == 0 then
- a = 14
- else
- b = 14
- end
- end
- function fifteen()
- button.flash("15")
- if a == 0 then
- a = 15
- else
- b = 15
- end
- end
- function confirm()
- button.flash("confirm")
- fin = 1
- end
- fillTable()
- button.heading("enter coordinates of container to be moved:")
- while fin == 0 do
- getClick()
- m.setCursorPos(2,14)
- m.write("koordynaty - x: ",a," y: ",b)
- end
- redf.setOutput("north",true) --do zrobienia - sygnal blokujacy os y
- sleep(0,5)
- redf.setAnalogOutput("east",a)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(5) -- przesuwa sie na osi x
- redf.setOutput("north",false) --odblokowuje os y
- sleep(0,5)
- redf.setAnalogOutput("east",b)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(3) -- przesuwa sie na osi y
- redf.setOutput("north",true) --blokuje os y
- redf.setOutput("down",true) --blokuje os x
- redconst.setOutput("down",true) --wlancza obroty suwnic
- sleep(0,5)
- redf.setOutput("up",true) --emiter sygnalu aktywuje lepki tlok
- sleep(0,5)
- redf.setOutput("up",false)
- sleep(2.5)
- redconst.setOutput("down",false)
- redf.setOutput("north",false) --odblokowuje wszystkie osie oraz wylancza obroty walu
- redf.setOutput("down",false)
- sleep(0,5)
- redf.setOutput("north",true) --blokuje os y
- redb.setAnalogOutput("east",a)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false) --oblokowyje os y
- sleep(0,5)
- redf.setAnalogOutput("east",8 - b)
- sleep(0,5) --przesuwa sie na osi y
- redf.setAnalogOutput("east",0)
- sleep(3)
- redf.setOutput("north",true) --blokuje os y
- redf.setOutput("down",true) --blokuje os x
- redconst.setOutput("down",true) --wlancza obroty suwnic
- sleep(0,5)
- redf.setOutput("south",true) --emiter sygnalu aktywuje pchajacy tlok
- sleep(0,5)
- redf.setOutput("south",false)
- sleep(2.5)
- redconst.setOutput("down",false)
- redf.setOutput("north",false) --odblokowuje wszystkie osie oraz wylancza obroty walu
- redf.setOutput("down",false)
- --powrot do poz. pocz.
- sleep(0,5)
- redb.setAnalogOutput("east",8)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- end
- function movecontainer()
- button.flash("move container")
- fin = 0
- a = 0
- b = 0
- m.clear()
- button.clearTable()
- function fillTable()
- button.setTable("1",one,2,4,2,4)
- button.setTable("2",two,6,8,2,4)
- button.setTable("3",three,10,12,2,4)
- button.setTable("4",four,14,16,2,4)
- button.setTable("5",five,18,20,2,4)
- button.setTable("6",six,2,4,6,8)
- button.setTable("7",seven,6,8,6,8)
- button.setTable("8",eight,10,12,6,8)
- button.setTable("9",nine,14,16,6,8)
- button.setTable("10",ten,18,21,6,8)
- button.setTable("11",eleven,2,5,10,12)
- button.setTable("12",twelve,7,10,10,12)
- button.setTable("13",thirteen,12,15,10,12)
- button.setTable("14",fourteen,17,20,10,12)
- button.setTable("15",fifteen,22,25,10,12)
- button.setTable("confirm",confirm,39,49,16,18)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function one()
- button.flash("1")
- if a == 0 then
- a = 1
- else
- b = 1
- end
- end
- function two()
- button.flash("2")
- if a == 0 then
- a = 2
- else
- b = 2
- end
- end
- function three()
- button.flash("3")
- if a == 0 then
- a = 3
- else
- b = 3
- end
- end
- function four()
- button.flash("4")
- if a == 0 then
- a = 4
- else
- b = 4
- end
- end
- function five()
- button.flash("5")
- if a == 0 then
- a = 5
- else
- b = 5
- end
- end
- function six()
- button.flash("6")
- if a == 0 then
- a = 6
- else
- b = 6
- end
- end
- function seven()
- button.flash("7")
- if a == 0 then
- a = 7
- else
- b = 7
- end
- end
- function eight()
- button.flash("8")
- if a == 0 then
- a = 8
- else
- b = 8
- end
- end
- function nine()
- button.flash("9")
- if a == 0 then
- a = 9
- else
- b = 9
- end
- end
- function ten()
- button.flash("10")
- if a == 0 then
- a = 10
- else
- b = 10
- end
- end
- function eleven()
- button.flash("11")
- if a == 0 then
- a = 11
- else
- b = 11
- end
- end
- function twelve()
- button.flash("12")
- if a == 0 then
- a = 12
- else
- b = 12
- end
- end
- function thirteen()
- button.flash("13")
- if a == 0 then
- a = 13
- else
- b = 13
- end
- end
- function fourteen()
- button.flash("14")
- if a == 0 then
- a = 14
- else
- b = 14
- end
- end
- function fifteen()
- button.flash("15")
- if a == 0 then
- a = 15
- else
- b = 15
- end
- end
- function confirm()
- button.flash("confirm")
- fin = 1
- end
- fillTable()
- button.heading("enter coordinates of container to be moved: ")
- while fin == 0 do
- getClick()
- local starta = a
- local startb = b
- m.setCursorPos(2,14)
- m.write("koordynaty poczatkowe - x: ",a," y: ",b)
- end
- fin = 0
- a = 0
- b = 0
- m.clear()
- button.clearTable()
- function fillTable()
- button.setTable("1",one,2,4,2,4)
- button.setTable("2",two,6,8,2,4)
- button.setTable("3",three,10,12,2,4)
- button.setTable("4",four,14,16,2,4)
- button.setTable("5",five,18,20,2,4)
- button.setTable("6",six,2,4,6,8)
- button.setTable("7",seven,6,8,6,8)
- button.setTable("8",eight,10,12,6,8)
- button.setTable("9",nine,14,16,6,8)
- button.setTable("10",ten,18,21,6,8)
- button.setTable("11",eleven,2,5,10,12)
- button.setTable("12",twelve,7,10,10,12)
- button.setTable("13",thirteen,12,15,10,12)
- button.setTable("14",fourteen,17,20,10,12)
- button.setTable("15",fifteen,22,25,10,12)
- button.setTable("confirm",confirm,39,49,16,18)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function one()
- button.flash("1")
- if a == 0 then
- a = 1
- else
- b = 1
- end
- end
- function two()
- button.flash("2")
- if a == 0 then
- a = 2
- else
- b = 2
- end
- end
- function three()
- button.flash("3")
- if a == 0 then
- a = 3
- else
- b = 3
- end
- end
- function four()
- button.flash("4")
- if a == 0 then
- a = 4
- else
- b = 4
- end
- end
- function five()
- button.flash("5")
- if a == 0 then
- a = 5
- else
- b = 5
- end
- end
- function six()
- button.flash("6")
- if a == 0 then
- a = 6
- else
- b = 6
- end
- end
- function seven()
- button.flash("7")
- if a == 0 then
- a = 7
- else
- b = 7
- end
- end
- function eight()
- button.flash("8")
- if a == 0 then
- a = 8
- else
- b = 8
- end
- end
- function nine()
- button.flash("9")
- if a == 0 then
- a = 9
- else
- b = 9
- end
- end
- function ten()
- button.flash("10")
- if a == 0 then
- a = 10
- else
- b = 10
- end
- end
- function eleven()
- button.flash("11")
- if a == 0 then
- a = 11
- else
- b = 11
- end
- end
- function twelve()
- button.flash("12")
- if a == 0 then
- a = 12
- else
- b = 12
- end
- end
- function thirteen()
- button.flash("13")
- if a == 0 then
- a = 13
- else
- b = 13
- end
- end
- function fourteen()
- button.flash("14")
- if a == 0 then
- a = 14
- else
- b = 14
- end
- end
- function fifteen()
- button.flash("15")
- if a == 0 then
- a = 15
- else
- b = 15
- end
- end
- function confirm()
- button.flash("confirm")
- fin = 1
- end
- fillTable()
- button.heading("enter coordinates, where container will be moved: ")
- while fin == 0 do
- m.setCursorPos(2,14)
- m.write("koordynaty pocz. - x: ",starta," y: ",startb)
- m.setCursorPos(2,16)
- m.write("koordynaty docelowe - x: ",a," y: ",b)
- end
- redf.setOutput("north",true) --blokada osi y
- redf.setAnalogOutput("east",starta)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false) --odlokowuje os y
- sleep(0,5)
- redf.setAnalogOutput("east",startb)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(3)
- redf.setOutput("north",true) --blokuje os y
- redf.setOutput("down",true) --blokuje os x
- redconst.setOutput("down",true) --wlancza obroty suwnic
- sleep(0,5)
- redf.setOutput("up",true) --emiter sygnalu aktywuje ciagnacy tlok
- sleep(0,5)
- redf.setOutput("up",false)
- sleep(2.5)
- redconst.setOutput("down",false)
- redf.setOutput("north",false) --odblokowuje wszystkie osie oraz wylancza obroty walu
- redf.setOutput("down",false)
- redf.setOutput("north",true) --blokada osi y
- redb.setAnalogOutput("east",starta)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false) --odlokowuje os y
- sleep(0,5)
- redb.setAnalogOutput("east",startb)
- sleep(0,5) --powrot do poz. 0 0
- redb.setAnalogOutput("east",0)
- sleep(3)
- redf.setOutput("north",true) --blokada osi y
- redf.setAnalogOutput("east",a)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false) --odlokowuje os y
- sleep(0,5)
- redf.setAnalogOutput("east",b)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(3)
- redf.setOutput("north",true) --blokuje os y
- redf.setOutput("down",true) --blokuje os x
- redconst.setOutput("down",true) --wlancza obroty suwnic
- sleep(0,5)
- redf.setOutput("south",true) --emiter sygnalu aktywuje pchajacy tlok
- sleep(0,5)
- redf.setOutput("south",false)
- sleep(2.5)
- redconst.setOutput("down",false)
- redf.setOutput("north",false) --odblokowuje wszystkie osie oraz wylancza obroty walu
- redf.setOutput("down",false)
- sleep(0,5)
- redf.setOutput("north",true) --blokada osi y
- redb.setAnalogOutput("east",a)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false)
- sleep(0,5)
- redb.setAnalogOutput("east",b)
- sleep(0,5) --powrot do poz. 0 0
- redb.setAnalogOutput("east",0)
- sleep(3)
- end
- function sendcontainer()
- button.flash("send container")
- fin = 0
- a = 0
- b = 0
- m.clear()
- button.clearTable()
- function fillTable()
- button.setTable("1",one,2,4,2,4)
- button.setTable("2",two,6,8,2,4)
- button.setTable("3",three,10,12,2,4)
- button.setTable("4",four,14,16,2,4)
- button.setTable("5",five,18,20,2,4)
- button.setTable("6",six,2,4,6,8)
- button.setTable("7",seven,6,8,6,8)
- button.setTable("8",eight,10,12,6,8)
- button.setTable("9",nine,14,16,6,8)
- button.setTable("10",ten,18,21,6,8)
- button.setTable("11",eleven,2,5,10,12)
- button.setTable("12",twelve,7,10,10,12)
- button.setTable("13",thirteen,12,15,10,12)
- button.setTable("14",fourteen,17,20,10,12)
- button.setTable("15",fifteen,22,25,10,12)
- button.setTable("confirm",confirm,39,49,16,18)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function one()
- button.flash("1")
- if a == 0 then
- a = 1
- else
- b = 1
- end
- end
- function two()
- button.flash("2")
- if a == 0 then
- a = 2
- else
- b = 2
- end
- end
- function three()
- button.flash("3")
- if a == 0 then
- a = 3
- else
- b = 3
- end
- end
- function four()
- button.flash("4")
- if a == 0 then
- a = 4
- else
- b = 4
- end
- end
- function five()
- button.flash("5")
- if a == 0 then
- a = 5
- else
- b = 5
- end
- end
- function six()
- button.flash("6")
- if a == 0 then
- a = 6
- else
- b = 6
- end
- end
- function seven()
- button.flash("7")
- if a == 0 then
- a = 7
- else
- b = 7
- end
- end
- function eight()
- button.flash("8")
- if a == 0 then
- a = 8
- else
- b = 8
- end
- end
- function nine()
- button.flash("9")
- if a == 0 then
- a = 9
- else
- b = 9
- end
- end
- function ten()
- button.flash("10")
- if a == 0 then
- a = 10
- else
- b = 10
- end
- end
- function eleven()
- button.flash("11")
- if a == 0 then
- a = 11
- else
- b = 11
- end
- end
- function twelve()
- button.flash("12")
- if a == 0 then
- a = 12
- else
- b = 12
- end
- end
- function thirteen()
- button.flash("13")
- if a == 0 then
- a = 13
- else
- b = 13
- end
- end
- function fourteen()
- button.flash("14")
- if a == 0 then
- a = 14
- else
- b = 14
- end
- end
- function fifteen()
- button.flash("15")
- if a == 0 then
- a = 15
- else
- b = 15
- end
- end
- function confirm()
- button.flash("confirm")
- fin = 1
- end
- fillTable()
- button.heading("choose coordinates where container will be sent:")
- while fin == 0 do
- m.setCursorPos(2,14)
- m.write("koordynaty - x: ",a," y: ",b)
- end
- redf.setAnalogOutput("east",8)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(3)
- redf.setOutput("north",true) --blokuje os y
- redf.setOutput("down",true) --blokuje os x
- redconst.setOutput("down",true) --wlancza obroty suwnic
- sleep(0,5)
- redf.setOutput("up",true) --emiter sygnalu aktywuje ciagnacy tlok
- sleep(0,5)
- redf.setOutput("up",false)
- sleep(2.5)
- redconst.setOutput("down",false)
- redf.setOutput("north",false) --odblokowuje wszystkie osie oraz wylancza obroty walu
- redf.setOutput("down",false)
- --powrot do poz. pocz.
- sleep(0,5)
- redb.setAnalogOutput("east",8)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- sleep(0,5)
- redf.setOutput("north",true) --blokada osi y
- redf.setAnalogOutput("east",a)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false) --odlokowuje os y
- sleep(0,5)
- redf.setAnalogOutput("east",b)
- sleep(0,5)
- redf.setAnalogOutput("east",0)
- sleep(3)
- sleep(0,5)
- redf.setOutput("north",true) --blokada osi y
- redb.setAnalogOutput("east",a)
- sleep(0,5)
- redb.setAnalogOutput("east",0)
- sleep(5)
- redf.setOutput("north",false)
- sleep(0,5)
- redb.setAnalogOutput("east",b)
- sleep(0,5) --powrot do poz. 0 0
- redb.setAnalogOutput("east",0)
- sleep(3)
- end
- fillTable()
- button.heading("choose action:")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment