Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --tt = "droitegauchebas"
- --tt = "droitegauchehaut"
- tt = "centredroitebasethaut"
- tt = "centregauchebasethaut"
- action = {
- ["droitegauchebas"] = function ()
- while true do
- -- print("go")
- os.pullEvent("redstone")
- if rs.getInput("back") == true and rs.getInput("back") ~= etatback then
- print("dans true")
- rs.setOutput("top", true)
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- turtle.drop()
- sleep(0.5)
- local t = peripheral.wrap("front")
- t.turnOn()
- rs.setOutput("front", true)
- etatback = true
- elseif rs.getInput("back") == false and rs.getInput("back") ~= etatback then
- print("dans false")
- rs.setOutput("top", false)
- turtle.select(1)
- rs.setOutput("front", false)
- sleep(2)
- turtle.dig()
- etatback = false
- end
- end
- end ,
- ["droitegauchehaut"] = function ()
- while true do
- -- print("go")
- os.pullEvent("redstone")
- if rs.getInput("bottom") == true and rs.getInput("bottom") ~= etatback then
- print("dans true")
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- turtle.drop()
- local t = peripheral.wrap("front")
- t.turnOn()
- rs.setOutput("front", true)
- -- rs.setOutput("top", true)
- etatback = true
- elseif rs.getInput("bottom") == false and rs.getInput("bottom") ~= etatback then
- print("dans false")
- turtle.select(1)
- rs.setOutput("front", false)
- -- rs.setOutput("top", false)
- sleep(2)
- turtle.dig()
- etatback = false
- end
- end
- end ,
- ["centredroitebasethaut"] = function ()
- while true do
- -- print("go")
- os.pullEvent("redstone")
- if rs.getInput("back") == true and rs.getInput("back") ~= etatback then
- print("dans true")
- turtle.turnRight()
- turtle.select(1)
- turtle.place()
- turtle.turnLeft()
- etatback = true
- elseif rs.getInput("back") == false and rs.getInput("back") ~= etatback then
- print("dans false")
- turtle.select(1)
- turtle.turnRight()
- turtle.dig()
- turtle.turnRight()
- turtle.drop()
- etatback = false
- end
- end
- end ,
- ["centregauchebasethaut"] = function ()
- while true do
- -- print("go")
- os.pullEvent("redstone")
- if rs.getInput("back") == true and rs.getInput("back") ~= etatback then
- print("dans true")
- turtle.turnLeft()
- turtle.select(1)
- turtle.place()
- turtle.turnRight()
- etatback = true
- elseif rs.getInput("back") == false and rs.getInput("back") ~= etatback then
- print("dans false")
- turtle.select(1)
- turtle.turnLeft()
- turtle.dig()
- turtle.turnLeft()
- turtle.drop()
- etatback = false
- end
- end
- end
- }
- local etatback = rs.getInput("back")
- local etatbottom = rs.getInput("bottom")
- --a = read()
- action[tt]()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement