SuicidalSTDz

EnderOS v2.0

Jan 31st, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.68 KB | None | 0 0
  1. --License:
  2. --The code of "EnderOS" in any form is intellectual
  3. --property of SuicidalSTDz. You may not reproduce,
  4. --redistribute, or modify it in any way!
  5.  
  6.  
  7.  
  8. os.pullEvent = os.pullEventRaw
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. function sha256(msg)
  12. function band(int1, int2, int3, ...)
  13. local ret =
  14. ((int1%0x00000002>=0x00000001 and int2%0x00000002>=0x00000001 and 0x00000001) or 0)+
  15. ((int1%0x00000004>=0x00000002 and int2%0x00000004>=0x00000002 and 0x00000002) or 0)+
  16. ((int1%0x00000008>=0x00000004 and int2%0x00000008>=0x00000004 and 0x00000004) or 0)+
  17. ((int1%0x00000010>=0x00000008 and int2%0x00000010>=0x00000008 and 0x00000008) or 0)+
  18. ((int1%0x00000020>=0x00000010 and int2%0x00000020>=0x00000010 and 0x00000010) or 0)+
  19. ((int1%0x00000040>=0x00000020 and int2%0x00000040>=0x00000020 and 0x00000020) or 0)+
  20. ((int1%0x00000080>=0x00000040 and int2%0x00000080>=0x00000040 and 0x00000040) or 0)+
  21. ((int1%0x00000100>=0x00000080 and int2%0x00000100>=0x00000080 and 0x00000080) or 0)+
  22. ((int1%0x00000200>=0x00000100 and int2%0x00000200>=0x00000100 and 0x00000100) or 0)+
  23. ((int1%0x00000400>=0x00000200 and int2%0x00000400>=0x00000200 and 0x00000200) or 0)+
  24. ((int1%0x00000800>=0x00000400 and int2%0x00000800>=0x00000400 and 0x00000400) or 0)+
  25. ((int1%0x00001000>=0x00000800 and int2%0x00001000>=0x00000800 and 0x00000800) or 0)+
  26. ((int1%0x00002000>=0x00001000 and int2%0x00002000>=0x00001000 and 0x00001000) or 0)+
  27. ((int1%0x00004000>=0x00002000 and int2%0x00004000>=0x00002000 and 0x00002000) or 0)+
  28. ((int1%0x00008000>=0x00004000 and int2%0x00008000>=0x00004000 and 0x00004000) or 0)+
  29. ((int1%0x00010000>=0x00008000 and int2%0x00010000>=0x00008000 and 0x00008000) or 0)+
  30. ((int1%0x00020000>=0x00010000 and int2%0x00020000>=0x00010000 and 0x00010000) or 0)+
  31. ((int1%0x00040000>=0x00020000 and int2%0x00040000>=0x00020000 and 0x00020000) or 0)+
  32. ((int1%0x00080000>=0x00040000 and int2%0x00080000>=0x00040000 and 0x00040000) or 0)+
  33. ((int1%0x00100000>=0x00080000 and int2%0x00100000>=0x00080000 and 0x00080000) or 0)+
  34. ((int1%0x00200000>=0x00100000 and int2%0x00200000>=0x00100000 and 0x00100000) or 0)+
  35. ((int1%0x00400000>=0x00200000 and int2%0x00400000>=0x00200000 and 0x00200000) or 0)+
  36. ((int1%0x00800000>=0x00400000 and int2%0x00800000>=0x00400000 and 0x00400000) or 0)+
  37. ((int1%0x01000000>=0x00800000 and int2%0x01000000>=0x00800000 and 0x00800000) or 0)+
  38. ((int1%0x02000000>=0x01000000 and int2%0x02000000>=0x01000000 and 0x01000000) or 0)+
  39. ((int1%0x04000000>=0x02000000 and int2%0x04000000>=0x02000000 and 0x02000000) or 0)+
  40. ((int1%0x08000000>=0x04000000 and int2%0x08000000>=0x04000000 and 0x04000000) or 0)+
  41. ((int1%0x10000000>=0x08000000 and int2%0x10000000>=0x08000000 and 0x08000000) or 0)+
  42. ((int1%0x20000000>=0x10000000 and int2%0x20000000>=0x10000000 and 0x10000000) or 0)+
  43. ((int1%0x40000000>=0x20000000 and int2%0x40000000>=0x20000000 and 0x20000000) or 0)+
  44. ((int1%0x80000000>=0x40000000 and int2%0x80000000>=0x40000000 and 0x40000000) or 0)+
  45. ((int1>=0x80000000 and int2>=0x80000000 and 0x80000000) or 0)
  46.  
  47. return (int3 and band(ret, int3, ...)) or ret
  48. end
  49.  
  50. local function bxor(int1, int2, int3, ...)
  51. local ret =
  52. ((int1%0x00000002>=0x00000001 ~= (int2%0x00000002>=0x00000001) and 0x00000001) or 0)+
  53. ((int1%0x00000004>=0x00000002 ~= (int2%0x00000004>=0x00000002) and 0x00000002) or 0)+
  54. ((int1%0x00000008>=0x00000004 ~= (int2%0x00000008>=0x00000004) and 0x00000004) or 0)+
  55. ((int1%0x00000010>=0x00000008 ~= (int2%0x00000010>=0x00000008) and 0x00000008) or 0)+
  56. ((int1%0x00000020>=0x00000010 ~= (int2%0x00000020>=0x00000010) and 0x00000010) or 0)+
  57. ((int1%0x00000040>=0x00000020 ~= (int2%0x00000040>=0x00000020) and 0x00000020) or 0)+
  58. ((int1%0x00000080>=0x00000040 ~= (int2%0x00000080>=0x00000040) and 0x00000040) or 0)+
  59. ((int1%0x00000100>=0x00000080 ~= (int2%0x00000100>=0x00000080) and 0x00000080) or 0)+
  60. ((int1%0x00000200>=0x00000100 ~= (int2%0x00000200>=0x00000100) and 0x00000100) or 0)+
  61. ((int1%0x00000400>=0x00000200 ~= (int2%0x00000400>=0x00000200) and 0x00000200) or 0)+
  62. ((int1%0x00000800>=0x00000400 ~= (int2%0x00000800>=0x00000400) and 0x00000400) or 0)+
  63. ((int1%0x00001000>=0x00000800 ~= (int2%0x00001000>=0x00000800) and 0x00000800) or 0)+
  64. ((int1%0x00002000>=0x00001000 ~= (int2%0x00002000>=0x00001000) and 0x00001000) or 0)+
  65. ((int1%0x00004000>=0x00002000 ~= (int2%0x00004000>=0x00002000) and 0x00002000) or 0)+
  66. ((int1%0x00008000>=0x00004000 ~= (int2%0x00008000>=0x00004000) and 0x00004000) or 0)+
  67. ((int1%0x00010000>=0x00008000 ~= (int2%0x00010000>=0x00008000) and 0x00008000) or 0)+
  68. ((int1%0x00020000>=0x00010000 ~= (int2%0x00020000>=0x00010000) and 0x00010000) or 0)+
  69. ((int1%0x00040000>=0x00020000 ~= (int2%0x00040000>=0x00020000) and 0x00020000) or 0)+
  70. ((int1%0x00080000>=0x00040000 ~= (int2%0x00080000>=0x00040000) and 0x00040000) or 0)+
  71. ((int1%0x00100000>=0x00080000 ~= (int2%0x00100000>=0x00080000) and 0x00080000) or 0)+
  72. ((int1%0x00200000>=0x00100000 ~= (int2%0x00200000>=0x00100000) and 0x00100000) or 0)+
  73. ((int1%0x00400000>=0x00200000 ~= (int2%0x00400000>=0x00200000) and 0x00200000) or 0)+
  74. ((int1%0x00800000>=0x00400000 ~= (int2%0x00800000>=0x00400000) and 0x00400000) or 0)+
  75. ((int1%0x01000000>=0x00800000 ~= (int2%0x01000000>=0x00800000) and 0x00800000) or 0)+
  76. ((int1%0x02000000>=0x01000000 ~= (int2%0x02000000>=0x01000000) and 0x01000000) or 0)+
  77. ((int1%0x04000000>=0x02000000 ~= (int2%0x04000000>=0x02000000) and 0x02000000) or 0)+
  78. ((int1%0x08000000>=0x04000000 ~= (int2%0x08000000>=0x04000000) and 0x04000000) or 0)+
  79. ((int1%0x10000000>=0x08000000 ~= (int2%0x10000000>=0x08000000) and 0x08000000) or 0)+
  80. ((int1%0x20000000>=0x10000000 ~= (int2%0x20000000>=0x10000000) and 0x10000000) or 0)+
  81. ((int1%0x40000000>=0x20000000 ~= (int2%0x40000000>=0x20000000) and 0x20000000) or 0)+
  82. ((int1%0x80000000>=0x40000000 ~= (int2%0x80000000>=0x40000000) and 0x40000000) or 0)+
  83. ((int1>=0x80000000 ~= (int2>=0x80000000) and 0x80000000) or 0)
  84.  
  85. return (int3 and bxor(ret, int3, ...)) or ret
  86. end
  87.  
  88. local function bnot(int)
  89. return 4294967295 - int
  90. end
  91.  
  92. local function rshift(int, by)
  93. local shifted = int / (2 ^ by)
  94. return shifted - shifted % 1
  95. end
  96.  
  97. local function rrotate(int, by)
  98. local shifted = int / (2 ^ by)
  99. local fraction = shifted % 1
  100. return (shifted - fraction) + fraction * (2 ^ 32)
  101. end
  102.  
  103. local k = {
  104. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  105. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  106. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  107. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  108. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  109. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  110. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  111. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  112. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  113. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  114. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  115. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  116. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  117. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  118. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  119. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
  120. }
  121.  
  122. local function str2hexa(s)
  123. local h = string.gsub(s, ".", function(c)
  124. return string.format("%02x", string.byte(c))
  125. end)
  126. return h
  127. end
  128.  
  129. local function num2s(l, n)
  130. local s = ""
  131. for i = 1, n do
  132. local rem = l % 256
  133. s = string.char(rem) .. s
  134. l = (l - rem) / 256
  135. end
  136. return s
  137. end
  138.  
  139. local function s232num(s, i)
  140. local n = 0
  141. for i = i, i + 3 do n = n*256 + string.byte(s, i) end
  142. return n
  143. end
  144.  
  145. local function preproc(msg, len)
  146. local extra = 64 - ((len + 1 + 8) % 64)
  147. len = num2s(8 * len, 8)
  148. msg = msg .. "\128" .. string.rep("\0", extra) .. len
  149. return msg
  150. end
  151.  
  152. local function initH256(H)
  153. H[1] = 0x6a09e667
  154. H[2] = 0xbb67ae85
  155. H[3] = 0x3c6ef372
  156. H[4] = 0xa54ff53a
  157. H[5] = 0x510e527f
  158. H[6] = 0x9b05688c
  159. H[7] = 0x1f83d9ab
  160. H[8] = 0x5be0cd19
  161. return H
  162. end
  163.  
  164. local function digestblock(msg, i, H)
  165. local w = {}
  166. for j = 1, 16 do w[j] = s232num(msg, i + (j - 1) * 4) end
  167. for j = 17, 64 do
  168. local v = w[j - 15]
  169. local s0 = bxor(rrotate(v, 7), rrotate(v, 18), rshift(v, 3))
  170. v = w[j - 2]
  171. local s1 = bxor(rrotate(v, 17), rrotate(v, 19), rshift(v, 10))
  172. w[j] = w[j - 16] + s0 + w[j - 7] + s1
  173. end
  174.  
  175. local a, b, c, d, e, f, g, h = H[1], H[2], H[3], H[4], H[5], H[6], H[7], H[8]
  176. for i = 1, 64 do
  177. local s0 = bxor(rrotate(a, 2), rrotate(a, 13), rrotate(a, 22))
  178. local maj = bxor(band(a, b), band(a, c), band(b, c))
  179. local t2 = s0 + maj
  180. local s1 = bxor(rrotate(e, 6), rrotate(e, 11), rrotate(e, 25))
  181. local ch = bxor (band(e, f), band(bnot(e), g))
  182. local t1 = h + s1 + ch + k[i] + w[i]
  183. h, g, f, e, d, c, b, a = g, f, e, d + t1, c, b, a, t1 + t2
  184. end
  185.  
  186. H[1] = band(H[1], a)
  187. H[2] = band(H[2], b)
  188. H[3] = band(H[3], c)
  189. H[4] = band(H[4], d)
  190. H[5] = band(H[5], e)
  191. H[6] = band(H[6], f)
  192. H[7] = band(H[7], g)
  193. H[8] = band(H[8], h)
  194. end
  195.  
  196. msg = preproc(msg, #msg)
  197. local H = initH256({})
  198. for i = 1, #msg, 64 do digestblock(msg, i, H) end
  199. return str2hexa(num2s(H[1], 4) .. num2s(H[2], 4) .. num2s(H[3], 4) .. num2s(H[4], 4) ..
  200. num2s(H[5], 4) .. num2s(H[6], 4) .. num2s(H[7], 4) .. num2s(H[8], 4))
  201. end
  202. local running = shell.getRunningProgram()
  203. if running ~= startup then
  204. term.clear()
  205. term.setCursorPos(1,1)
  206. print("It is recommended that this file is named startup!")
  207. sleep(5)
  208. end
  209. function settingsChangeUser()
  210. reset()
  211. term.setTextColor(colors.orange)
  212. local passFile = io.open("/.EnderOS/.passInfo", "r")
  213. local passContents = passFile:read()
  214. passFile:close()
  215. print("Please enter your password: ")
  216. if sha256(read("*")) ~= passContents then
  217. print("Invalid password")
  218. sleep(1.5)
  219. settingsChangeUser()
  220. else
  221. local user = ("/.EnderOS/.userInfo")
  222. io.open(user)
  223. local username = io.open(user, "w")
  224. print("Enter new username: ")
  225. writeUser = read()
  226. local hash = sha256(writeUser)
  227. writeN = username:write(hash)
  228. username:close()
  229. print("Your new username is "..writeUser)
  230. sleep(2)
  231. start()
  232. end
  233. term.setTextColor(colors.white)
  234. end
  235. function settingsChangePass()
  236. reset()
  237. term.setTextColor(colors.orange)
  238. local passFile = io.open("/.EnderOS/.passInfo", "r")
  239. local passContents = passFile:read()
  240. passFile:close()
  241. print("Please enter your password: ")
  242. if sha256(read("*")) ~= passContents then
  243. print("Invalid password")
  244. sleep(1.5)
  245. settingsChangePass()
  246. else
  247. local pass = ("/.EnderOS/.passInfo")
  248. io.open(pass)
  249. local password = io.open(pass, "w")
  250. print("Enter new password: ")
  251. local writePass = read("*")
  252. local hash = sha256(writePass)
  253. local writeN = password:write(hash)
  254. password:close()
  255. print("Your new password is "..writePass)
  256. sleep(2)
  257. start()
  258. end
  259. term.setTextColor(colors.white)
  260. end
  261. function settingsChangeHint()
  262. reset()
  263. term.setTextColor(colors.orange)
  264. local passFile = io.open("/.EnderOS/.passInfo", "r")
  265. local passContents = passFile:read()
  266. passFile:close()
  267. print("Please enter your password: ")
  268. if sha256(read("*")) ~= passContents then
  269. print("Invalid password")
  270. sleep(1.5)
  271. settingsChangeHint()
  272. else
  273. local hint = ("/.EnderOS/.userHint")
  274. io.open(hint)
  275. local uHint = io.open(hint, "w")
  276. print("Enter new hint: ")
  277. local writeHint = read()
  278. local writeN = uHint:write(writeHint)
  279. uHint:close()
  280. print("Your new hint is "..writeHint)
  281. sleep(2)
  282. start()
  283. end
  284. term.setTextColor(colors.white)
  285. end
  286. version = "v2.0"
  287. userfile = shell.getRunningProgram()
  288. local v = ".(Period)"
  289. function reset()
  290. term.clear()
  291. term.setCursorPos(1,1)
  292. end
  293. function userInfo()
  294. reset()
  295. fs.makeDir("/.EnderOS/")
  296. user = ("/.EnderOS/.userInfo")
  297. io.open(user)
  298. username = io.open(user, "w")
  299. print("Please enter your desired Username")
  300. writeUser = read()
  301. local hash = sha256(writeUser)
  302. writeIsFailUser = username:write(hash)
  303. username:close()
  304. pass = ("/.EnderOS/.passInfo")
  305. io.open(pass)
  306. password = io.open(pass, "w")
  307. print("Please enter your desired Password")
  308. writePass = read("*")
  309. local hash = sha256(writePass)
  310. writeIsFailPass = password:write(hash)
  311. password:close()
  312. hint = ("/.EnderOS/.userHint")
  313. io.open(hint)
  314. uHint = io.open(hint, "w")
  315. print("Please enter your desired Password hint")
  316. writeHint = read()
  317. writeIsFailHint = uHint:write(writeHint)
  318. uHint:close()
  319. local installC = fs.open("/.EnderOS/.EnderOSisInstalled", "w")
  320. installC:close()
  321. end
  322. function frame()
  323. print("+-------------------------------------------------+")
  324. for i = 1,17 do
  325. print("| |")
  326. end
  327. term.write("+-------------------------------------------------+")
  328. end
  329. function no()
  330. term.clear()
  331. term.setTextColor(colors.red)
  332. term.setCursorPos(1,1)
  333. print("Sorry, I have not coded this in yet. Please be patient.")
  334. sleep(3)
  335. end
  336. function screen()
  337. reset()
  338. term.setTextColor(colors.lime)
  339. print("+-------------------------------------------------+")
  340. print("| |")
  341. print("| ")
  342. term.setCursorPos(19,3)
  343. term.setTextColor(colors.purple)
  344. write("EnderOS "..version)
  345. term.setTextColor(colors.lime)
  346. term.setCursorPos(31,3)
  347. print(" |")
  348. print("| |")
  349. print("| |")
  350. print("| |")
  351. print("| |")
  352. print("| ")
  353. term.setCursorPos(10,8)
  354. term.setTextColor(colors.orange)
  355. print("Username:")
  356. term.setCursorPos(19,8)
  357. print(" ")
  358. term.setCursorPos(50,8)
  359. term.setTextColor(colors.lime)
  360. print(" |")
  361. print("| |")
  362. print("| ")
  363. term.setTextColor(colors.orange)
  364. term.setCursorPos(10,10)
  365. print("Password:")
  366. term.setCursorPos(19,10)
  367. print(" ")
  368. term.setCursorPos(50,10)
  369. term.setTextColor(colors.lime)
  370. print(" |")
  371. print("| |")
  372. print("| |")
  373. print("| ")
  374. term.setCursorPos(8,13)
  375. term.setTextColor(colors.blue)
  376. print("forgot password ")
  377. term.setCursorPos(50,13)
  378. term.setTextColor(colors.lime)
  379. print(" |")
  380. print("| |")
  381. print("| |")
  382. print("| |")
  383. print("| |")
  384. print("| |")
  385. write("+-------------------------------------------------+")
  386. end
  387. function click()
  388. local userHint = io.open("/.EnderOS/.userHint", "r")
  389. hintContents = userHint:read()
  390. userHint:close()
  391. local event, button, xPos, yPos = os.pullEvent("mouse_click")
  392. if button == 1 then
  393. if (xPos >=8 and xPos <=22 and yPos == 13) then
  394. term.setCursorPos(10,15)
  395. term.setTextColor(colors.lightGray)
  396. print("Hint: "..hintContents)
  397. term.setTextColor(colors.white)
  398. click()
  399. elseif (xPos >=10 and xPos <=18 and yPos == 8) then
  400. term.setCursorPos(20,8)
  401. else
  402. screen()
  403. click()
  404. end
  405. else
  406. click()
  407. end
  408. end
  409. function login()
  410. click()
  411. local userFile = io.open("/.EnderOS/.userInfo", "r")
  412. userContents = userFile:read()
  413. userFile:close()
  414. local passFile = io.open("/.EnderOS/.passInfo", "r")
  415. passContents = passFile:read()
  416. passFile:close()
  417. term.setTextColor(colors.white)
  418. if sha256(read()) == userContents then
  419. term.setCursorPos(8,8)
  420. term.setTextColor(colors.lime)
  421. term.write("O")
  422. term.setTextColor(colors.white)
  423. term.setCursorPos(20,10)
  424. if sha256(read("*")) == passContents then
  425. term.setCursorPos(8,10)
  426. term.setTextColor(colors.lime)
  427. term.write("O")
  428. term.setTextColor(colors.white)
  429. sleep(0.8)
  430. term.clear()
  431. term.setCursorPos(19,9)
  432. x,y = term.getCursorPos()
  433. print("Logging in")
  434. term.setCursorPos(x+10,9)
  435. sleep(0.7)
  436. print(".")
  437. sleep(0.7)
  438. term.setCursorPos(x+11,9)
  439. print(".")
  440. sleep(0.7)
  441. term.setCursorPos(x+12,9)
  442. print(".")
  443. sleep(0.7)
  444. reset()
  445. start()
  446. else
  447. term.setCursorPos(8,10)
  448. term.setTextColor(colors.red)
  449. term.write("X")
  450. sleep(0.5)
  451. term.setTextColor(colors.white)
  452. screen()
  453. login()
  454. end
  455. else
  456. term.setCursorPos(8,8)
  457. term.setTextColor(colors.red)
  458. term.write("X")
  459. sleep(0.5)
  460. term.setTextColor(colors.white)
  461. screen()
  462. login()
  463. end
  464. end
  465. function settings()
  466. term.setTextColor(colors.purple)
  467. frame()
  468. term.setCursorPos(17,1)
  469. term.setTextColor(colors.lime)
  470. print("[EnderOS Settings]")
  471. term.setCursorPos(7,3)
  472. print("{Change Username} {Change Password}")
  473. term.setCursorPos(15,5)
  474. print("{Change Password Hint}")
  475. term.setCursorPos(3,1)
  476. term.setTextColor(colors.orange)
  477. term.write("[Back]")
  478. term.setTextColor(colors.white)
  479. local event, button, xPos, yPos = os.pullEvent("mouse_click")
  480. if button == 1 then
  481. if (xPos >=7 and xPos <=23 and yPos == 3) then
  482. settingsChangeUser()
  483. elseif (xPos >=27 and xPos <=43 and yPos == 3) then
  484. settingsChangePass()
  485. elseif (xPos >=15 and xPos <=36 and yPos == 5) then
  486. settingsChangeHint()
  487. elseif (xPos >=3 and xPos <=9 and yPos == 1) then
  488. start()
  489. else
  490. settings()
  491. end
  492. else
  493. sleep(1)--This is to prevent spamming, thus "overloading" EnderOS
  494. settings()
  495. end
  496. end
  497. function start()
  498. reset()
  499. term.setTextColor(colors.purple)
  500. frame()
  501. term.setCursorPos(3,19)
  502. term.setTextColor(colors.orange)
  503. term.write("[Log Out]")
  504. term.setCursorPos(17,1)
  505. term.setTextColor(colors.lime)
  506. print("[EnderOS Commands]")
  507. term.setCursorPos(3,3)
  508. print("{Settings} {Exit}")
  509. local event, button, xPos, yPos = os.pullEvent("mouse_click")
  510. if button == 1 then
  511. if (xPos >=16 and xPos <=21 and yPos == 3) then
  512. reset()
  513. elseif (xPos >=3 and xPos <=12 and yPos == 3) then
  514. settings()
  515. elseif (xPos >=3 and xPos <=11 and yPos == 19) then
  516. reset()
  517. screen()
  518. login()
  519. else
  520. start()
  521. end
  522. else
  523. sleep(1)--This is to prevent spamming, thus "overloading" EnderOS
  524. start()
  525. end
  526. end
  527.  
  528.  
  529. --EnderOS
  530. if not term.isColor() then
  531. term.clear()
  532. term.setCursorPos(1,1)
  533. print("EnderOS does not support non-color computers!")
  534. sleep(3)
  535. os.shutdown()
  536. end
  537. if not fs.exists("/.EnderOS/.EnderOSisInstalled") then
  538. userInfo()
  539. end
  540. reset()
  541. term.setTextColor(colors.purple)
  542. term.setCursorPos(13,7)
  543. print("EnderOS "..version.." Initializing")
  544. term.setTextColor(colors.white)
  545. term.setBackgroundColor(colors.lime)
  546. for i = 14,36 do
  547. term.setCursorPos(i,9)
  548. term.write(" ")
  549. sleep(0.3)
  550. end
  551. term.setBackgroundColor(colors.black)
  552. sleep(0.5)
  553. screen()
  554. login()
  555. start()
Advertisement
Add Comment
Please, Sign In to add comment