Hello everyone,
After building a spiral staircase out of microblocks in my last world I thought to myself never again. This time I wanted a fun way of travelling between floors that works quite nicely in a futuristic base. I had six floors and a elevator shaft connects all of them. I ran elevator rails all the way up it and at each floor I connected the rail to minefactory reloaded rednet cable. Each floor connection has a unique colour. Each floor also has a computer terminal that automatically summons the cart and then allows the user to select a floor and then it sends the cart there (well I would hope so given that is the whole point!)
All control is handled by the computers so no rednet controller blocks are required. The program works although there is an occasional error when the redstone messes up. When you boot up the program it fires off a redstone pulse on the red channel that turns off every other computer in the system to stop it from sending signals to the elevator rail which would stop it from working properly. Occasionally that doesn't work though so more than one floor is switched on so that the cart goes only to the higher floor.
If anyone wants to take a look at it, maybe suggest improvements or use it on there own world here is the code.
After building a spiral staircase out of microblocks in my last world I thought to myself never again. This time I wanted a fun way of travelling between floors that works quite nicely in a futuristic base. I had six floors and a elevator shaft connects all of them. I ran elevator rails all the way up it and at each floor I connected the rail to minefactory reloaded rednet cable. Each floor connection has a unique colour. Each floor also has a computer terminal that automatically summons the cart and then allows the user to select a floor and then it sends the cart there (well I would hope so given that is the whole point!)
All control is handled by the computers so no rednet controller blocks are required. The program works although there is an occasional error when the redstone messes up. When you boot up the program it fires off a redstone pulse on the red channel that turns off every other computer in the system to stop it from sending signals to the elevator rail which would stop it from working properly. Occasionally that doesn't work though so more than one floor is switched on so that the cart goes only to the higher floor.
If anyone wants to take a look at it, maybe suggest improvements or use it on there own world here is the code.
local floor = 0
function callcart(floor)
redstone.setBundledOutput("back", colors.red)
sleep(0.05)
if floor == 0 then
floor = colors.orange
elseif floor == 1 then
floor = colors.magenta
elseif floor == 2 then
floor = colors.lightBlue
elseif floor == 3 then
floor = colors.yellow
elseif floor == 4 then
floor = colors.lime
elseif floor == 5 then
floor = colors.pink
end
redstone.setBundledOutput("back", 0)
redstone.setBundledOutput("back", floor)
end
function gocart(input)
redstone.setBundledOutput("back", 0)
if input == "0" then
input = colors.orange
elseif input == "1" then
input = colors.magenta
elseif input == "2" then
input = colors.lightBlue
elseif input == "3" then
input = colors.yellow
elseif input == "4" then
input = colors.lime
elseif input == "5" then
input = 0
end
redstone.setBundledOutput("back", input)
end
print("Welcome")
print("You are on level ".. floor)
callcart(floor)
print("Floor Directory")
print("0 - Ground Floor: Hospitality and accomodation")
print("1 - Level One: Liquid Storage and Primary Power Generation")
print("2 - Level Two: Workshop and Primary Storage")
print("3 - Level Three: Central Processing")
print("4 - Level Four: Secondary Power Generation")
print("5 - Level Five: Deep Storage")
term.write("Which floor would you like to go to? ")
local input = read()
if input == 0 or 1 or 2 or 3 or 4 or 5 then
print("Please step into the cart and keep your hands and feet inside the cart at all times")
sleep(2)
print("Thank you using Elevatron 1.0")
sleep(1)
gocart(input)
end
while true do
event = os.pullEvent("redstone")
local redsignal = redstone.testBundledInput("back", colors.red)
if redsignal == true then
sleep(2)
os.shutdown()
end
end
function callcart(floor)
redstone.setBundledOutput("back", colors.red)
sleep(0.05)
if floor == 0 then
floor = colors.orange
elseif floor == 1 then
floor = colors.magenta
elseif floor == 2 then
floor = colors.lightBlue
elseif floor == 3 then
floor = colors.yellow
elseif floor == 4 then
floor = colors.lime
elseif floor == 5 then
floor = colors.pink
end
redstone.setBundledOutput("back", 0)
redstone.setBundledOutput("back", floor)
end
function gocart(input)
redstone.setBundledOutput("back", 0)
if input == "0" then
input = colors.orange
elseif input == "1" then
input = colors.magenta
elseif input == "2" then
input = colors.lightBlue
elseif input == "3" then
input = colors.yellow
elseif input == "4" then
input = colors.lime
elseif input == "5" then
input = 0
end
redstone.setBundledOutput("back", input)
end
print("Welcome")
print("You are on level ".. floor)
callcart(floor)
print("Floor Directory")
print("0 - Ground Floor: Hospitality and accomodation")
print("1 - Level One: Liquid Storage and Primary Power Generation")
print("2 - Level Two: Workshop and Primary Storage")
print("3 - Level Three: Central Processing")
print("4 - Level Four: Secondary Power Generation")
print("5 - Level Five: Deep Storage")
term.write("Which floor would you like to go to? ")
local input = read()
if input == 0 or 1 or 2 or 3 or 4 or 5 then
print("Please step into the cart and keep your hands and feet inside the cart at all times")
sleep(2)
print("Thank you using Elevatron 1.0")
sleep(1)
gocart(input)
end
while true do
event = os.pullEvent("redstone")
local redsignal = redstone.testBundledInput("back", colors.red)
if redsignal == true then
sleep(2)
os.shutdown()
end
end