Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- station = peripheral.wrap("left")
- relay = peripheral.wrap("redstone_relay_2")
- local function gantry(gantry_bool)
- relay.setOutput("back", gantry_bool)
- end
- local function gearshift(gearshift_bool)
- relay.setOutput("front", gearshift_bool)
- end
- local function clutch(clutch_bool)
- relay.setOutput("left", clutch_bool)
- end
- local function sequenced_impulse()
- relay.setOutput("right", true)
- sleep(0.1)
- relay.setOutput("right", false)
- end
- local function grab()
- --attrape le wagon et le remonte
- clutch(true)
- gantry(true)
- gearshift(false)
- clutch(false)
- sleep(2)
- gearshift(true)
- sleep(2)
- clutch(true)
- end
- local function put()
- --pose le wagon
- clutch(true)
- gantry(true)
- gearshift(false)
- clutch(false)
- sleep(2)
- rednet.send(rednet.lookup("Portique", "PortiquePulleyTurtle"), "dig", "Portique")
- clutch(true)
- end
- local function move(sens_bool)
- --déplace la poulie
- gantry(false)
- gearshift(not sens_bool)
- sequenced_impulse()
- sleep(2)
- end
- local function bois()
- grab()
- move(true)
- move(true)
- --put()
- end
- while true do
- if station.isTrainPresent() then
- train_name = station.getTrainName()
- if train_name == "Bois" then
- sleep(1)
- station.disassemble()
- bois()
- end
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement