Advertisement
Guest User

test

a guest
Nov 7th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.96 KB | None | 0 0
  1. if warpdriveCommons then os.unloadAPI("warpdriveCommons") end
  2. if not os.loadAPI("warpdrive/warpdriveCommons") then error("missing warpdriveCommons") end
  3. local w = warpdriveCommons.w
  4.  
  5. local data
  6.  
  7. ----------- Ship support
  8. local monitor_textScale = 0.5
  9. local ship
  10. local ship_front = 0
  11. local ship_right = 0
  12. local ship_up = 0
  13. local ship_back = 0
  14. local ship_left = 0
  15. local ship_down = 0
  16. local ship_isInHyper = false
  17. local ship_x, ship_y, ship_z = 0, 0, 0
  18. local ship_xTarget, ship_yTarget, ship_zTarget = 0, 0, 0
  19. local ship_actualDistance = 0
  20. local ship_energyRequired = 0
  21. local ship_movement = { 0, 0, 0 }
  22. local ship_rotationSteps = 0
  23. local ship_indexPlayer = 0
  24. local ship_arrayPlayers = { }
  25. local ship_indexTarget = 0
  26. w.clear()
  27. local lmonitor = w.device_get("top")
  28. lmonitor.setTextScale(monitor_textScale)
  29.  w.page_begin("Zephyr3 - Connections")
  30.   w.writeLn("")
  31.   w.setColorSuccess()
  32.   w.writeLn("1 monitor detected")
  33.   w.writeLn("Ship controller detected")
  34.   w.writeLn("")        
  35.   w.setColorNormal()
  36.   w.writeLn("Booting Ship")
  37.   w.write("- acquiring parameters: ")
  38.   w.setColorSuccess()
  39.   w.writeLn("ok")
  40.  
  41.   w.setColorNormal()
  42.   w.write("- checking assembly   : ")
  43.   local timeout = 10
  44.   local isValid, message
  45.   repeat
  46.     w.sleep(0.05)
  47.     timeout = timeout - 1
  48.   until isValid == true or timeout < 0
  49.   if timeout < 0 then
  50.     w.setColorWarning()
  51.     w.writeLn("failed")
  52.     w.writeLn(message)
  53.     w.setColorNormal()
  54.     w.sleep(6)
  55.    else
  56.     w.setColorSuccess()
  57.     w.writeLn("passed")
  58.   end
  59.   w.sleep(0.2)
  60.  
  61.   w.setColorNormal()
  62.   w.write("- celestial position  : ")
  63.   timeout = 10
  64.   local pos
  65.   repeat
  66.     w.sleep(0.05)
  67.     timeout = timeout - 1
  68.   until pos ~= nil or timeout < 0
  69.   if timeout < 0 then
  70.     w.setColorWarning()
  71.     w.writeLn("failed")
  72.     w.writeLn("")
  73.     w.writeLn("Something is wrong here, rebooting...")
  74.     w.writeLn("[THC] Was Here!.")
  75.     w.setColorNormal()
  76.     w.sleep(4)
  77.     w.reboot()
  78.   else
  79.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement