Advertisement
DanielLaby99

Setup - LabyOS - Step 1

Jul 15th, 2013
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.49 KB | None | 0 0
  1. local function screen()
  2. term.setBackgroundColor(colors.gray)
  3. shell.run("clear")
  4. term.setBackgroundColor(colors.white)
  5. term.setCursorPos(2,2)
  6. for f=0,15 do
  7. for f2=0,47 do
  8. write(" ")
  9. end
  10. term.setBackgroundColor(colors.black)
  11. if f<1 then
  12. term.setBackgroundColor(colors.gray)
  13. end
  14. print(" ")
  15. term.setBackgroundColor(colors.gray)
  16. write(" ")
  17. term.setBackgroundColor(colors.white)
  18. end
  19. term.setBackgroundColor(colors.gray)
  20. write(" ")
  21. term.setBackgroundColor(colors.black)
  22. for f=0,47 do
  23. write(" ")
  24. end
  25. end
  26. screen()
  27.  
  28. local data = fs.open(".minecraft/lastlogin", "r")
  29. if data then
  30. name = data.readLine()
  31. data.close()
  32. end
  33.  
  34. term.setTextColor(colors.lightGray)
  35. term.setBackgroundColor(colors.white)
  36. term.setCursorPos(3,3)
  37. textutils.slowWrite("Hello ",100)
  38. write(name)
  39. term.setCursorPos(12,3)
  40. write(" ")
  41. sleep(0,1)
  42. term.setCursorPos(9,3)
  43. write(name,",")
  44. term.setCursorPos(15,3)
  45. write(" ")
  46. sleep(0,1)
  47. term.setCursorPos(9,3)
  48. write(name,",")
  49. sleep(0,1)
  50. write(",")
  51. term.setCursorPos(3,5)
  52. textutils.slowWrite("Welcome to the setup, here you can edit",100)
  53. term.setCursorPos(3,6)
  54. textutils.slowWrite("the settings from LabyOS!",100)
  55. term.setCursorPos(3,8)
  56. textutils.slowPrint("Continue?",100)
  57.  
  58. term.setCursorPos(3,16)
  59. term.setTextColor(colors.gray)
  60. term.setBackgroundColor(colors.lightGray)
  61. textutils.slowWrite(" ")
  62. term.setCursorPos(3,16)
  63. textutils.slowWrite(" Exit ")
  64. term.setCursorPos(39,16)
  65. textutils.slowWrite(" ")
  66. term.setCursorPos(39,16)
  67. textutils.slowWrite(" Continue ")
  68. term.setCursorPos(3,10)
  69.  
  70. local function cont()
  71. screen()
  72. term.setCursorPos(46,3)
  73. term.setBackgroundColor(colors.white)
  74. term.setTextColor(colors.black)
  75. write("1/3")
  76. term.setTextColor(colors.gray)
  77. term.setBackgroundColor(colors.white)
  78. term.setCursorPos(3,3)
  79. write("> Design")
  80. term.setTextColor(colors.lightGray)
  81. term.setCursorPos(3,5)
  82. write("Well, let's start with your desktop design.")
  83. term.setCursorPos(3,6)
  84. write("What desktop background color do you want?")
  85. term.setCursorPos(3,8)
  86. term.setTextColor(colors.lightGray)
  87. term.setBackgroundColor(colors.red)
  88. write(" ")
  89. term.setBackgroundColor(colors.white)
  90. write(" Red :")
  91. term.setCursorPos(3,9)
  92. term.setBackgroundColor(colors.blue)
  93. write(" ")
  94. term.setBackgroundColor(colors.white)
  95. write(" Blue :")
  96. term.setCursorPos(3,10)
  97. term.setBackgroundColor(colors.yellow)
  98. write(" ")
  99. term.setBackgroundColor(colors.white)
  100. write(" Yellow :")
  101. term.setCursorPos(3,11)
  102. term.setBackgroundColor(colors.green)
  103. write(" ")
  104. term.setBackgroundColor(colors.white)
  105. write(" Green :")
  106. term.setCursorPos(3,12)
  107. term.setBackgroundColor(colors.brown)
  108. write(" ")
  109. term.setBackgroundColor(colors.white)
  110. write(" Brown :")
  111. term.setCursorPos(3,13)
  112. term.setBackgroundColor(colors.orange)
  113. write(" ")
  114. term.setBackgroundColor(colors.white)
  115. write(" Orange :")
  116. term.setCursorPos(3,15)
  117. term.setBackgroundColor(colors.gray)
  118. write(" ")
  119. term.setBackgroundColor(colors.white)
  120. write(" Picture :")
  121.  
  122. function select()
  123. term.setCursorPos(28,8)
  124. write(":")
  125. term.setCursorPos(28,9)
  126. write(":")
  127. term.setCursorPos(28,10)
  128. write(":")
  129. term.setCursorPos(28,11)
  130. write(":")
  131. term.setCursorPos(28,12)
  132. write(":")
  133. term.setCursorPos(28,13)
  134. write(":")
  135. term.setCursorPos(28,14)
  136. write(" ")
  137. term.setCursorPos(28,15)
  138. write(":")
  139. term.setCursorPos(30,8)
  140. write("Are you sure?")
  141. term.setCursorPos(30,9)
  142. write("You can change")
  143. term.setCursorPos(30,10)
  144. write("the background")
  145. term.setCursorPos(30,11)
  146. write("later too.")
  147. term.setCursorPos(30,16)
  148. term.setTextColor(colors.gray)
  149. term.setBackgroundColor(colors.lightGray)
  150. textutils.slowWrite(" ")
  151. term.setCursorPos(30,16)
  152. textutils.slowWrite(" Other ")
  153. term.setCursorPos(38,16)
  154. textutils.slowWrite(" ")
  155. term.setCursorPos(38,16)
  156. textutils.slowWrite(" Next ")
  157. term.setCursorPos(3,10)
  158. end
  159.  
  160. function select2()
  161. term.setCursorPos(28,8)
  162. write(":")
  163. term.setCursorPos(28,9)
  164. write(":")
  165. term.setCursorPos(28,10)
  166. write(":")
  167. term.setCursorPos(28,11)
  168. write(":")
  169. term.setCursorPos(28,12)
  170. write(":")
  171. term.setCursorPos(28,13)
  172. write(":")
  173. term.setCursorPos(28,14)
  174. write(" ")
  175. term.setCursorPos(28,15)
  176. write(":")
  177. term.setCursorPos(30,8)
  178. write("Sorry that is in")
  179. term.setCursorPos(30,9)
  180. write("development!")
  181. term.setCursorPos(30,10)
  182. write("")
  183. term.setCursorPos(30,11)
  184. write("")
  185. term.setCursorPos(30,16)
  186. term.setTextColor(colors.gray)
  187. term.setBackgroundColor(colors.lightGray)
  188. textutils.slowWrite(" ")
  189. term.setCursorPos(30,16)
  190. textutils.slowWrite(" Other ")
  191. term.setCursorPos(3,10)
  192. end
  193.  
  194.  
  195.  
  196. local function s1()
  197. while true do
  198. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  199. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  200. cont()
  201. break
  202. end
  203. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  204. config = fs.open(".minecraft/config/background", "w")
  205. config.write("16384")
  206. config.close()
  207. shell.run(".minecraft/bin/labyos/setup/step2")
  208. break
  209. end
  210. end
  211. end
  212.  
  213. local function s2()
  214. while true do
  215. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  216. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  217. cont()
  218. break
  219. end
  220. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  221. config = fs.open(".minecraft/config/background", "w")
  222. config.write("2048")
  223. config.close()
  224. shell.run(".minecraft/bin/labyos/setup/step2")
  225. break
  226. end
  227. end
  228. end
  229.  
  230. local function s3()
  231. while true do
  232. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  233. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  234. cont()
  235. break
  236. end
  237. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  238. config = fs.open(".minecraft/config/background", "w")
  239. config.write("16")
  240. config.close()
  241. shell.run(".minecraft/bin/labyos/setup/step2")
  242. break
  243. end
  244. end
  245. end
  246.  
  247. local function s4()
  248. while true do
  249. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  250. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  251. cont()
  252. break
  253. end
  254. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  255. config = fs.open(".minecraft/config/background", "w")
  256. config.write("8192")
  257. config.close()
  258. shell.run(".minecraft/bin/labyos/setup/step2")
  259. break
  260. end
  261. end
  262. end
  263.  
  264.  
  265. local function s5()
  266. while true do
  267. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  268. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  269. cont()
  270. break
  271. end
  272. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  273. config = fs.open(".minecraft/config/background", "w")
  274. config.write("4096")
  275. config.close()
  276. shell.run(".minecraft/bin/labyos/setup/step2")
  277. break
  278. end
  279. end
  280. end
  281.  
  282. local function s6()
  283. while true do
  284. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  285. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  286. cont()
  287. break
  288. end
  289. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  290. config = fs.open(".minecraft/config/background", "w")
  291. config.write("2")
  292. config.close()
  293. shell.run(".minecraft/bin/labyos/setup/step2")
  294. break
  295. end
  296. end
  297. end
  298.  
  299.  
  300. local function s7()
  301. while true do
  302. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  303. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  304. cont()
  305. break
  306. end
  307.  
  308. end
  309. end
  310.  
  311.  
  312.  
  313.  
  314. while true do
  315. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  316. if mouseX >= 3 and mouseX <= 16 and mouseY == 8 then
  317. term.setCursorPos(16,mouseY)
  318. print("< Selected!")
  319. select()
  320. s1()
  321. break
  322. end
  323.  
  324. if mouseX >= 3 and mouseX <= 16 and mouseY == 9 then
  325. term.setCursorPos(16,mouseY)
  326. print("< Selected!")
  327. select()
  328. s2()
  329. break
  330. end
  331.  
  332. if mouseX >= 3 and mouseX <= 16 and mouseY == 10 then
  333. term.setCursorPos(16,mouseY)
  334. print("< Selected!")
  335. select()
  336. s3()
  337. break
  338. end
  339.  
  340. if mouseX >= 3 and mouseX <= 16 and mouseY == 11 then
  341. term.setCursorPos(16,mouseY)
  342. print("< Selected!")
  343. select()
  344. s4()
  345. break
  346. end
  347.  
  348. if mouseX >= 3 and mouseX <= 16 and mouseY == 12 then
  349. term.setCursorPos(16,mouseY)
  350. print("< Selected!")
  351. select()
  352. s5()
  353. break
  354. end
  355.  
  356. if mouseX >= 3 and mouseX <= 16 and mouseY == 13 then
  357. term.setCursorPos(16,mouseY)
  358. print("< Selected!")
  359. select()
  360. s6()
  361. break
  362. end
  363.  
  364. if mouseX >= 3 and mouseX <= 16 and mouseY == 15 then
  365. term.setCursorPos(16,mouseY)
  366. print("< Selected!")
  367. select2()
  368. s7()
  369. break
  370. end
  371.  
  372. end
  373.  
  374. end
  375.  
  376.  
  377.  
  378. local function exit()
  379. shell.run(".minecraft/bin/minecraft/menu/screen")
  380. end
  381.  
  382. while true do
  383. local event, button, X, Y = os.pullEvent("mouse_click")
  384. XY = X..","..Y
  385.  
  386. if XY == "3,16" and button == 1 then
  387. exit()
  388. break
  389. end
  390. if XY == "4,16" and button == 1 then
  391. exit()
  392. break
  393. end
  394. if XY == "5,16" and button == 1 then
  395. exit()
  396. break
  397. end
  398. if XY == "6,16" and button == 1 then
  399. exit()
  400. break
  401. end
  402. if XY == "7,16" and button == 1 then
  403. exit()
  404. break
  405. end
  406. if XY == "8,16" and button == 1 then
  407. exit()
  408. break
  409. end
  410.  
  411.  
  412.  
  413.  
  414. if XY == "39,16" and button == 1 then
  415. cont()
  416. break
  417. end
  418. if XY == "40,16" and button == 1 then
  419. cont()
  420. break
  421. end
  422. if XY == "41,16" and button == 1 then
  423. cont()
  424. break
  425. end
  426. if XY == "42,16" and button == 1 then
  427. cont()
  428. break
  429. end
  430. if XY == "43,16" and button == 1 then
  431. cont()
  432. break
  433. end
  434. if XY == "43,16" and button == 1 then
  435. cont()
  436. break
  437. end
  438. if XY == "44,16" and button == 1 then
  439. cont()
  440. break
  441. end
  442. if XY == "45,16" and button == 1 then
  443. cont()
  444. break
  445. end
  446. if XY == "46,16" and button == 1 then
  447. cont()
  448. break
  449. end
  450. if XY == "47,16" and button == 1 then
  451. cont()
  452. break
  453. end
  454.  
  455. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement