Advertisement
SamSneedle

sinstaller1

Jan 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. function loadJSON()
  2.     local sName = 'JSON'
  3.        
  4.     local tEnv = {}
  5.     setmetatable( tEnv, { __index = _G } )
  6.     local fnAPI, err = loadstring(_jstr)
  7.     if fnAPI then
  8.         setfenv( fnAPI, tEnv )
  9.         fnAPI()
  10.     else
  11.         printError( err )
  12.         return false
  13.     end
  14.    
  15.     local tAPI = {}
  16.     for k,v in pairs( tEnv ) do
  17.         tAPI[k] =  v
  18.     end
  19.    
  20.     _G[sName] = tAPI
  21.     return true
  22. end
  23.  
  24. local mainTitle = 'OneOS Installer'
  25. local subTitle = 'Please wait...'
  26.  
  27. function Draw()
  28.     sleep(0)
  29.     term.setBackgroundColour(colours.white)
  30.     term.clear()
  31.     local w, h = term.getSize()
  32.     term.setTextColour(colours.lightBlue)
  33.     term.setCursorPos(math.ceil((w-#mainTitle)/2), 8)
  34.     term.write(mainTitle)
  35.     term.setTextColour(colours.blue)
  36.     term.setCursorPos(math.ceil((w-#subTitle)/2), 10)
  37.     term.write(subTitle)
  38. end
  39. sleep(10)
  40. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement