Advertisement
DanielLaby99

Setup - LabyOS - Step 4

Jul 20th, 2013
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.71 KB | None | 0 0
  1. local function screen()
  2. local data = fs.open(".minecraft/config/background", "r")
  3. if data then
  4. term.setBackgroundColor(tonumber(data.readAll()))
  5. data.close()
  6. end
  7. shell.run("clear")
  8. term.setBackgroundColor(colors.white)
  9. term.setCursorPos(2,2)
  10. for f=0,15 do
  11. for f2=0,47 do
  12. write(" ")
  13. end
  14. term.setBackgroundColor(colors.black)
  15. if f<1 then
  16. local data = fs.open(".minecraft/config/background", "r")
  17. if data then
  18. term.setBackgroundColor(tonumber(data.readAll()))
  19. data.close()
  20. end
  21. end
  22. print(" ")
  23. local data = fs.open(".minecraft/config/background", "r")
  24. if data then
  25. term.setBackgroundColor(tonumber(data.readAll()))
  26. data.close()
  27. end
  28. write(" ")
  29. term.setBackgroundColor(colors.white)
  30. end
  31. local data = fs.open(".minecraft/config/background", "r")
  32. if data then
  33. term.setBackgroundColor(tonumber(data.readAll()))
  34. data.close()
  35. end
  36. write(" ")
  37. term.setBackgroundColor(colors.black)
  38. for f=0,47 do
  39. write(" ")
  40. end
  41. end
  42. screen()
  43.  
  44. term.setCursorPos(46,3)
  45. term.setBackgroundColor(colors.white)
  46. term.setTextColor(colors.black)
  47. write("3/3")
  48. term.setTextColor(colors.lightGray)
  49. term.setBackgroundColor(colors.white)
  50. term.setCursorPos(3,3)
  51. write("> Design ")
  52. write("> Name ")
  53. term.setTextColor(colors.gray)
  54. write("> Color ")
  55. term.setTextColor(colors.lightGray)
  56. term.setBackgroundColor(colors.white)
  57. term.setCursorPos(3,5)
  58. textutils.slowWrite("Do you want a different",100)
  59. term.setCursorPos(3,6)
  60. textutils.slowWrite("color of the start bar? ",100)
  61.  
  62. term.setCursorPos(3,16)
  63. term.setTextColor(colors.gray)
  64. term.setBackgroundColor(colors.lightGray)
  65. textutils.slowWrite(" ")
  66. term.setCursorPos(3,16)
  67. textutils.slowWrite(" No ")
  68. term.setCursorPos(44,16)
  69. textutils.slowWrite(" ")
  70. term.setCursorPos(44,16)
  71. textutils.slowWrite(" Yes ")
  72. term.setCursorPos(3,10)
  73.  
  74. local function cont()
  75. screen()
  76. term.setCursorPos(46,3)
  77. term.setBackgroundColor(colors.white)
  78. term.setTextColor(colors.black)
  79. write("3/3")
  80. term.setTextColor(colors.lightGray)
  81. term.setBackgroundColor(colors.white)
  82. term.setCursorPos(3,3)
  83. write("> Design ")
  84. write("> Name ")
  85. term.setTextColor(colors.gray)
  86. write("> Color ")
  87. term.setTextColor(colors.lightGray)
  88. term.setCursorPos(3,5)
  89. write("Which start bar color do you want?")
  90. term.setCursorPos(3,8)
  91. term.setTextColor(colors.lightGray)
  92. term.setBackgroundColor(colors.red)
  93. write(" ")
  94. term.setBackgroundColor(colors.white)
  95. write(" Red :")
  96. term.setCursorPos(3,9)
  97. term.setBackgroundColor(colors.blue)
  98. write(" ")
  99. term.setBackgroundColor(colors.white)
  100. write(" Blue :")
  101. term.setCursorPos(3,10)
  102. term.setBackgroundColor(colors.yellow)
  103. write(" ")
  104. term.setBackgroundColor(colors.white)
  105. write(" Yellow :")
  106. term.setCursorPos(3,11)
  107. term.setBackgroundColor(colors.green)
  108. write(" ")
  109. term.setBackgroundColor(colors.white)
  110. write(" Green :")
  111. term.setCursorPos(3,12)
  112. term.setBackgroundColor(colors.brown)
  113. write(" ")
  114. term.setBackgroundColor(colors.white)
  115. write(" Brown :")
  116. term.setCursorPos(3,13)
  117. term.setBackgroundColor(colors.orange)
  118. write(" ")
  119. term.setBackgroundColor(colors.white)
  120. write(" Orange :")
  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 color")
  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.  
  161. local function s1()
  162. while true do
  163. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  164. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  165. cont()
  166. break
  167. end
  168. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  169. config = fs.open(".minecraft/config/startbar", "w")
  170. config.write("16384")
  171. config.close()
  172. shell.run(".minecraft/bin/labyos/setup/b")
  173. break
  174. end
  175. end
  176. end
  177.  
  178. local function s2()
  179. while true do
  180. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  181. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  182. cont()
  183. break
  184. end
  185. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  186. config = fs.open(".minecraft/config/startbar", "w")
  187. config.write("2048")
  188. config.close()
  189. shell.run(".minecraft/bin/labyos/setup/b")
  190. break
  191. end
  192. end
  193. end
  194.  
  195. local function s3()
  196. while true do
  197. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  198. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  199. cont()
  200. break
  201. end
  202. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  203. config = fs.open(".minecraft/config/startbar", "w")
  204. config.write("16")
  205. config.close()
  206. shell.run(".minecraft/bin/labyos/setup/b")
  207. break
  208. end
  209. end
  210. end
  211.  
  212. local function s4()
  213. while true do
  214. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  215. if mouseX >= 30 and mouseX <= 36 and mouseY == 16 then
  216. cont()
  217. break
  218. end
  219. if mouseX >= 38 and mouseX <= 44 and mouseY == 16 then
  220. config = fs.open(".minecraft/config/startbar", "w")
  221. config.write("8192")
  222. config.close()
  223. shell.run(".minecraft/bin/labyos/setup/b")
  224. break
  225. end
  226. end
  227. end
  228.  
  229.  
  230. local function s5()
  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/startbar", "w")
  239. config.write("4096")
  240. config.close()
  241. shell.run(".minecraft/bin/labyos/setup/b")
  242. break
  243. end
  244. end
  245. end
  246.  
  247. local function s6()
  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/startbar", "w")
  256. config.write("2")
  257. config.close()
  258. shell.run(".minecraft/bin/labyos/setup/b")
  259. break
  260. end
  261. end
  262. end
  263.  
  264.  
  265. local function s7()
  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.  
  273. end
  274. end
  275.  
  276.  
  277.  
  278.  
  279. while true do
  280. local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
  281. if mouseX >= 3 and mouseX <= 16 and mouseY == 8 then
  282. term.setCursorPos(16,mouseY)
  283. print("< Selected!")
  284. select()
  285. s1()
  286. break
  287. end
  288.  
  289. if mouseX >= 3 and mouseX <= 16 and mouseY == 9 then
  290. term.setCursorPos(16,mouseY)
  291. print("< Selected!")
  292. select()
  293. s2()
  294. break
  295. end
  296.  
  297. if mouseX >= 3 and mouseX <= 16 and mouseY == 10 then
  298. term.setCursorPos(16,mouseY)
  299. print("< Selected!")
  300. select()
  301. s3()
  302. break
  303. end
  304.  
  305. if mouseX >= 3 and mouseX <= 16 and mouseY == 11 then
  306. term.setCursorPos(16,mouseY)
  307. print("< Selected!")
  308. select()
  309. s4()
  310. break
  311. end
  312.  
  313. if mouseX >= 3 and mouseX <= 16 and mouseY == 12 then
  314. term.setCursorPos(16,mouseY)
  315. print("< Selected!")
  316. select()
  317. s5()
  318. break
  319. end
  320.  
  321. if mouseX >= 3 and mouseX <= 16 and mouseY == 13 then
  322. term.setCursorPos(16,mouseY)
  323. print("< Selected!")
  324. select()
  325. s6()
  326. break
  327. end
  328.  
  329.  
  330. end
  331.  
  332. end
  333.  
  334.  
  335.  
  336. local function exit()
  337. config = fs.open(".minecraft/config/startbar", "w")
  338. config.write("128")
  339. config.close()
  340. shell.run(".minecraft/bin/labyos/setup/b")
  341. end
  342.  
  343. while true do
  344. local event, button, X, Y = os.pullEvent("mouse_click")
  345. XY = X..","..Y
  346.  
  347. if XY == "3,16" and button == 1 then
  348. exit()
  349. break
  350. end
  351. if XY == "4,16" and button == 1 then
  352. exit()
  353. break
  354. end
  355. if XY == "5,16" and button == 1 then
  356. exit()
  357. break
  358. end
  359. if XY == "6,16" and button == 1 then
  360. exit()
  361. break
  362. end
  363. if XY == "7,16" and button == 1 then
  364. exit()
  365. break
  366. end
  367. if XY == "8,16" and button == 1 then
  368. exit()
  369. break
  370. end
  371.  
  372.  
  373.  
  374.  
  375. if XY == "39,16" and button == 1 then
  376. cont()
  377. break
  378. end
  379. if XY == "40,16" and button == 1 then
  380. cont()
  381. break
  382. end
  383. if XY == "41,16" and button == 1 then
  384. cont()
  385. break
  386. end
  387. if XY == "42,16" and button == 1 then
  388. cont()
  389. break
  390. end
  391. if XY == "43,16" and button == 1 then
  392. cont()
  393. break
  394. end
  395. if XY == "43,16" and button == 1 then
  396. cont()
  397. break
  398. end
  399. if XY == "44,16" and button == 1 then
  400. cont()
  401. break
  402. end
  403. if XY == "45,16" and button == 1 then
  404. cont()
  405. break
  406. end
  407. if XY == "46,16" and button == 1 then
  408. cont()
  409. break
  410. end
  411. if XY == "47,16" and button == 1 then
  412. cont()
  413. break
  414. end
  415.  
  416. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement