Posted 06 April 2013 - 08:20 PM
Okay so I have been revamping my previous version of code for one of my mine cart roller coasters on my lan server, however I cant get the count down timer to stop counting. The function wont let me break the loop. Please Help I'm already at (0:0-1385).
Here's the code.
EDIT: Wonderful, I just discovered that my options don't work, no matter what I type out of the choices that are presented ("1,2,3,Start,Info,Update,Shut Down") They all just start the timer.
Here's the code.
on = boot do
term.clear()
term.setCursorPos(14.5,9)
textutils.slowPrint ("Launch Terminal V.2.2")
term.setCursorPos(14.5,10)
textutils.slowPrint ("SPIRE® & JmanSites™\©")
sleep(2)
end
-- BREAK LINE -- CONTENT ABOVE NOT INCLUDED IN 'REFRESH' --
--[Setup]--
term.clear()
term.setCursorPos(1,1)
a1="1"; a2="2"; a3="3"; b1="Start"; b2="Info"; b3="Update"
print "1] Start Ride 2] Info 3] Update"
write "Input: "
ip = read()
--[Functions]--
local function check()
if s == 0 then
term.setCursorPos(15,10)
textutils.slowPrint (" Ride Stoping ")
os.pullEvent("redstone")
rs.setOutput("back", false)
sleep(.2)
rs.setOutput("back", false)
term.clear()
term.setCursorPos(14.5,10)
textutils.slowPrint ("Ride Stopped!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint ("Reseting Launch Terminal")
sleep(0.5)
shell.run("Refresh")
end
end
--[CODE]--
--(start)--
if ip == a1 or b1 then
term.clear()
term.setCursorPos(13,9)
textutils.slowPrint ("Ride Duration - 1 minute")
term.setCursorPos(15,10)
print ("Remaining: 1:00")
redstone.setOutput("back", true)
s=59 -- Miliseconds Coming Soon
while true do
term.clear()
term.setCursorPos(13,9)
print ("Ride Duration - 1 minute")
term.setCursorPos(15,10)
if s >= 10 then -- Time Read Start
print ("Remaining: 0:"..s)
elseif s <= 10 then
print ("Remaining: 0:0"..s)
end -- Time Read End
sleep(0.95)
s = s-1
check()
end
--(info\update)--
elseif ip == a2 or b2 then
term.clear()
print("Info Not Yet Available")
shell.run("Refresh")
elseif ip == a3 or b3 then
term.clear()
term.setCursorPos(1,1)
print("[SERVER] Updating Software")
sleep(3)
print("[SERVER] Auto-Updater may be Corrupt or Disabled")
sleep(1)
print("[SERVER] Requesting Service Engine")
sleep(.75)
print("[ASE] Would You Like to...")
sleep(.5)
print("[ASE] ERROR!")
print("[ASE] Automated Service Engine Incomplete. Executing Process")
sleep(1)
shell.run("MOC")
--(hidden shutdown)--
elseif ip == "Shut Down" then
term.clear()
term.setCursorPos(0,1)
print ("[SYSTEM]")
sleep(0.6); term.setCursorPos(9,1)
textutils.slowPrint("DISABLING PRESSURE BLOCK")
os.shutdown()
else
print "Unknown Command"
shell.run("Refresh")
end
EDIT: Wonderful, I just discovered that my options don't work, no matter what I type out of the choices that are presented ("1,2,3,Start,Info,Update,Shut Down") They all just start the timer.