Smiley43210

Launch Terminal Corrected

Apr 6th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. on = boot do
  2. term.clear()
  3. term.setCursorPos(14.5,9)
  4. textutils.slowPrint ("Launch Terminal V.2.2")
  5. term.setCursorPos(14.5,10)
  6. textutils.slowPrint ("SPIRE® & JmanSites™\©")
  7. sleep(2)
  8. end
  9. -- BREAK LINE -- CONTENT ABOVE NOT INCLUDED IN 'REFRESH' --
  10. --[Functions]--
  11. local function check()
  12.  if s == 0 then
  13.    term.setCursorPos(15,10)
  14.    textutils.slowPrint ("        Ride Stopping    ")
  15.    os.pullEvent("redstone")
  16.    rs.setOutput("back", false)
  17.    sleep(.2)
  18.    rs.setOutput("back", false)
  19.    term.clear()
  20.    term.setCursorPos(14.5,10)
  21.    textutils.slowPrint ("Ride Stopped!")
  22.    sleep(2)
  23.    term.clear()
  24.    term.setCursorPos(1,1)
  25.    textutils.slowPrint ("Resetting Launch Terminal")
  26.    sleep(0.5)
  27.    return true
  28.  end
  29.  return false
  30. end
  31. --[Setup]--
  32. while true do
  33.  term.clear()
  34.  term.setCursorPos(1,1)
  35.  a1="1"; a2="2"; a3="3"; b1="Start"; b2="Info"; b3="Update"
  36.  print "1] Start Ride  2] Info  3] Update"
  37.  write "Input: "
  38.  ip = read()
  39.  --[CODE]--
  40.  --(start)--
  41.  if ip == a1 or ip == b1 then
  42.  term.clear()
  43.  term.setCursorPos(13,9)
  44.  textutils.slowPrint ("Ride Duration - 1 minute")
  45.  term.setCursorPos(15,10)
  46.  print ("Remaining: 1:00")
  47.  redstone.setOutput("back", true)
  48.  s=9       -- Miliseconds Coming Soon
  49.  while true do
  50.    term.clear()
  51.    term.setCursorPos(13,9)
  52.    print ("Ride Duration - 1 minute")
  53.    term.setCursorPos(15,10)
  54.    if s >= 10 then   -- Time Read Start
  55.     print ("Remaining: 0:"..s)
  56.    elseif s < 10 then
  57.     print ("Remaining: 0:0"..s)
  58.    end    -- Time Read End
  59.    sleep(0.95)
  60.    s = s-1
  61.    if check() then
  62.     break
  63.    end
  64.  end
  65.  --(info\update)--
  66.  elseif ip == a2 or ip == b2 then
  67.  term.clear()
  68.  print("Info Not Yet Available")
  69.  sleep(1)
  70.  elseif ip == a3 or ip == b3 then
  71.  term.clear()
  72.  term.setCursorPos(1,1)
  73.  print("[SERVER] Updating Software")
  74.  sleep(3)
  75.  print("[SERVER] Auto-Updater may be Corrupt or Disabled")
  76.  sleep(1)
  77.  print("[SERVER] Requesting Service Engine")
  78.  sleep(.75)
  79.  print("[ASE] Would You Like to...")
  80.  sleep(.5)
  81.  print("[ASE] ERROR!")
  82.  print("[ASE] Automated Service Engine Incomplete. Executing Process")
  83.  sleep(1)
  84.  shell.run("MOC")
  85.  --(hidden shutdown)--
  86.  elseif ip == "Shut Down" then
  87.  term.clear()
  88.  term.setCursorPos(0,1)
  89.  print ("[SYSTEM]")
  90.  sleep(0.6); term.setCursorPos(9,1)
  91.  textutils.slowPrint("DISABLING PRESSURE BLOCK")
  92.  os.shutdown()
  93.  else
  94.  print "Unknown Command"
  95.  sleep(1)
  96. end
  97. end
Advertisement
Add Comment
Please, Sign In to add comment