Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ##################### Variablen #####################
- mon = peripheral.wrap("top")
- -- ##################### START Funktionen
- function destination( ... )
- mon.clear()
- mon.setTextScale("2")
- mon.setBackgroundcolor(color)
- mon.setCursorPos("1,1")
- mon.write(dest)
- end
- -- ##################### START Hauptprogramm
- while true do
- redstone.setOutput("back", true) -- Cargolinie aktiv
- redstone.setOutput("right", false)
- redstone.setOutput("left", false)
- mon.setBackgroundcolor(colours.red)
- mon.setTextScale(1)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Base")
- mon.setCursorPos(2,2)
- mon.write("III")
- mon.setCursorPos(2,4)
- mon.write("<--")
- for i = 5,0,-1 do
- mon.setCursorPos(6,i)
- mon.write("|")
- end
- mon.setCursorPos(8,1)
- mon.write("Base")
- mon.setCursorPos(9,2)
- mon.write("II")
- mon.setCursorPos(9,4)
- mon.write("<--")
- for foo = 5,0,-1 do
- mon.setCursorPos(12,foo)
- mon.write("|")
- end
- mon.setCursorPos(14,1)
- mon.write("Cargo")
- mon.setCursorPos(15,4)
- mon.write("-->")
- local event, side, x, y = os.pullEvent()
- if event == "monitor_touch" then
- if x <= 5 then -- Basecamp III
- redstone.setOutput("back", false)
- redstone.setOutput("right", true)
- redstone.setOutput("left", false)
- color = colours.green
- dest1 = "Basecamp"
- dest2 = "III"
- destination()
- sleep(5)
- elseif x > 5 and x <= 10 then -- Basecamp II
- redstone.setOutput("back", false)
- redstone.setOutput("right", true)
- redstone.setOutput("left", true)
- color = colours.green
- dest = "Basecamp"
- destII = "II"
- destination()
- sleep(5)
- elseif x > 10 then -- Cargo
- redstone.setOutput("back", true)
- redstone.setOutput("right", false)
- redstone.setOutput("left", false)
- color = colours.red
- dest1 = "Cargo"
- dest2 = " "
- destination()
- sleep(5)
- end
- end
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment