Posted 23 December 2014 - 02:23 PM
SO I have a Remain In motion elevator with GUI buttons sending the id and message to the elevator thn this piece of code is suppose to handle it
Whichi it takes one of my hard coded Computers and decides to move up or down then it is suppose to toggle a redstone system then reboot
Issue is whenever I go up or down I have to manually restart the computer no error
function Up()
drive = peripheral.wrap("right")
local i = 1
repeat
drive.move(1, false, true)
os.sleep(1)
until i == 8
end
function Down()
drive = peripheral.wrap("right")
local i = 1
repeat
drive.move(0, false, true)
os.sleep(1)
until i == 8
end
function Toggle()
rs.setOutput("bottom", true)
os.sleep(.1)
rs.setOutput("bottom", false)
end
while true do
rednet.open("left")
local event, senderId, message = os.pullEvent("rednet_message")
if senderId == 38 and message == "Up" then
Up()
Toggle()
os.reboot()
elseif senderId == 28 and message == "Down" then
Down()
Toggle()
os.reboot()
elseif senderId == 30 and message == "Down" then
Down()
Ttoggle()
os.reboot()
elseif senderId == 31 and message == "Up" then
Up()
Toggle()
os.reboot()
end
end
Whichi it takes one of my hard coded Computers and decides to move up or down then it is suppose to toggle a redstone system then reboot
Issue is whenever I go up or down I have to manually restart the computer no error