Advertisement
Guest User

gui

a guest
Aug 1st, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.98 KB | None | 0 0
  1. ---wanna put up the password? well change false to true--
  2. shell.run("pastebin get cahDmkZD _Ep")
  3. shell.run("pastebin get pnzdr8FB filebrowseros")
  4. shell.run("pastebin get GCvQSFS0 test")
  5. shell.run("pastebin get Y77q7RnS painter ")
  6. shell.run("pastebin get PjTj9kEk _window")
  7. shell.run("pastebin get bUeXqDnQ _timer")
  8. shell.run("pastebin get ZUvcfnC8 _BootUp")
  9. shell.run("pastebin get 0Trs8n1f _password")
  10. shell.run("pastebin get b00Ji592 _em")
  11. shell.run("pastebin get 4x0a1G9H _dt")
  12. passwordOn = false
  13. ---dont change anything else unless you know what your doing------------------------------------------------------------------------------------------------------sup---------------------------------------------------------TINCAN---------------------------------------------------------------------------------------tincans :D--
  14. _window = paintutils.loadImage("_window")
  15. _timer = paintutils.loadImage("_timer")
  16. _BootUp = paintutils.loadImage("_BootUp")
  17. _password = paintutils.loadImage("_password")
  18. _em = paintutils.loadImage("_em")
  19. _dt = paintutils.loadImage("_dt")
  20. running = true
  21. version = "1.0"
  22. time = os.time()
  23. _cm = 0
  24. _ms = 0
  25. _ee = 0
  26. _oo = 0
  27. ex = 0
  28. ey = 0
  29. contextX = 0
  30. contextY = 0
  31. alarm = 50
  32. _tb = 0
  33. _tmb = 0
  34. etm = 0
  35. tcX = 0
  36. tcY = 0
  37. ---------------------------------------------
  38. function ie()
  39. term.setCursorPos(46, 3)
  40. term.setTextColour(colours.white)
  41. term.setBackgroundColour(colours.red)
  42. print("X")
  43. while true do
  44. event, button, x, y = os.pullEventRaw()
  45. if event == "mouse_click" and x == 46 and y == 3 and button == 1 then
  46. term.setCursorPos(46,3)
  47. term.setTextColour(colours.white)
  48. term.setBackgroundColour(colours.pink)
  49. print("X")
  50. buttonSound()
  51. term.setBackgroundColour(colours.red)
  52. term.setCursorPos(46,3)
  53. print("X")
  54. sleep(0.1)
  55. Init()
  56. elseif event == "mouse_click" and x >= 9 and x <= 43 and y == 6 and button == 1 then
  57. term.setBackgroundColour(colours.lightGrey)
  58. term.setTextColour(colours.black)
  59. term.setCursorPos(9, 6)
  60. searchb = read()
  61. if searchb == "youtube" then
  62. youtube()
  63. end
  64. end
  65. end
  66. end
  67.  
  68.  
  69.  
  70. function youtube()
  71.  
  72. end
  73.  
  74. function window()
  75. paintutils.drawImage(_window, 1, 1)
  76. ie()
  77. end
  78.  
  79. function pinon()
  80. term.setCursorPos(7,1)
  81. term.setBackgroundColour(colours.cyan)
  82. term.setTextColour(colours.blue)
  83. print("EE")
  84. term.setCursorPos(7,19)
  85. end
  86.  
  87. function buttonSound()
  88. redstone.setOutput("back", true)
  89. sleep(0.3)
  90. redstone.setOutput("back", false)
  91. end
  92.  
  93. function toggleOn(text)
  94. term.setTextColour(colours.black)
  95. term.setBackgroundColour(colours.lightGrey)
  96. print(text)
  97. sleep(0.1)
  98. end
  99.  
  100. function toggleOff(text)
  101. term.setTextColour(colours.black)
  102. term.setBackgroundColour(colours.white)
  103. print(text)
  104. buttonSound()
  105. end
  106.  
  107. Alarm = function()
  108. rednet.open("right")
  109. rednet.broadcast("clock")
  110. sleep(3)
  111. rednet.broadcast("CO")
  112. end
  113.  
  114. drawMenu6 = function()
  115. term.setCursorPos(tcX, tcY)
  116. term.setBackgroundColour(colours.white)
  117. term.setTextColour(colours.black)
  118. print("Exit          ")
  119. term.setCursorPos(tcX,tcY+1)
  120. print("Reboot        ")
  121. term.setCursorPos(tcX, tcY-1)
  122. term.setTextColour(colours.white)
  123. term.setBackgroundColour(colours.blue)
  124. print("Slide-out Menu")
  125. end
  126.  
  127. drawMenu5 = function()
  128. term.setCursorPos(1,2)
  129. term.setBackgroundColour(colours.white)
  130. term.setTextColour(colours.black)
  131. print("1 min.     ")
  132. print("15 mins.   ")
  133. print("30 mins.   ")
  134. print("1 hour     ")
  135. print("Other      ")
  136. term.setCursorPos(1,7)
  137. term.setBackgroundColour(colours.blue)
  138. term.setTextColour(colours.white)
  139. print("Select Time")
  140. end
  141.  
  142. Timer = function()
  143. _tmb = 0
  144. term.setBackgroundColour(colours.lightBlue)
  145. clear()
  146. term.setBackgroundColour(colours.blue)
  147. term.setCursorPos(1,1)
  148. term.clearLine()
  149. term.setCursorPos(1,1)
  150. term.setTextColour(colours.black)
  151. term.setBackgroundColour(colours.grey)
  152. print("TIME  ")
  153. while true do
  154. event, button, x, y = os.pullEventRaw()
  155. if _tmb == 0 and event == "mouse_click" and x < 6 and y == 1 and button == 1 then
  156. term.setCursorPos(1,1)
  157. toggleOn("TIME  ")
  158. buttonSound()
  159. term.setCursorPos(1,1)
  160. term.setBackgroundColour(colours.grey)
  161. print("TIME  ")
  162. sleep(0.1)
  163. drawMenu5()
  164. _tmb = _tmb + 1
  165. elseif event == "mouse_click"and button == 1 and _tmb == 1 and x < 12 and y == 2 then
  166. term.setCursorPos(1,2)
  167. toggleOn("1 min.     ")
  168. term.setCursorPos(1,2)
  169. toggleOff("1 min.     ")
  170. tm = 60
  171. _tmb = 0
  172. gTime()
  173. elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 3 and button == 1 then
  174. term.setCursorPos(1,3)
  175. toggleOn("15 mins.   ")
  176. term.setCursorPos(1,3)
  177. toggleOff("15 mins.   ")
  178. tm = 900
  179. _tmb = 0
  180. gTime()
  181. elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 4 and button == 1 then
  182. term.setCursorPos(1,4)
  183. toggleOn("30 mins.   ")
  184. term.setCursorPos(1,4)
  185. toggleOff("30 mins.   ")
  186. tm = 1800
  187. _tmb = 0
  188. gTime()
  189. elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 5 and button == 1 then
  190. term.setCursorPos(1,5)
  191. toggleOn("1 hour     ")
  192. term.setCursorPos(1,5)
  193. toggleOff("1 hour     ")
  194. tm = 3600
  195. _tmb = 0
  196. gTime()
  197. elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 6 and button == 1 then
  198. term.setCursorPos(1,6)
  199. toggleOn("Other      ")
  200. term.setCursorPos(1,6)
  201. toggleOff("Other      ")
  202. term.setCursorPos(1,1)
  203. term.setBackgroundColour(colours.white)
  204. term.clear()
  205. term.setCursorPos(10,1)
  206. term.setTextColour(colours.black)
  207. term.setBackgroundColour(colours.white)
  208. print("Seconds.")
  209. term.setCursorPos(1,1)
  210. tm = read()
  211. _tmb = 0
  212. gTime()
  213. elseif event == "mouse_click" and _tmb < 2 and x < 38 and y < 15 and x > 0 and y > 1 and button == 2 then
  214. tcX = x
  215. tcY = y
  216. drawMenu6()
  217. _tmb = 2
  218. elseif event == "mouse_click" and x >tcX-1 and x < tcX + 15 and y == tcY and button == 1 and _tmb == 2 then
  219. term.setCursorPos(tcX, tcY)
  220. toggleOn("Exit          ")
  221. term.setCursorPos(tcX, tcY)
  222. toggleOff("Exit          ")
  223. _tmb = 0
  224. _ms = 0
  225. Init()
  226. elseif event == "mouse_click" and x >tcX-1 and x <tcX + 15 and y == tcY + 1 and button == 1 and _tmb == 2 then
  227. term.setCursorPos(tcX, tcY + 1)
  228. toggleOn("Reboot        ")
  229. term.setCursorPos(tcX, tcY + 1)
  230. toggleOff("Reboot        ")
  231. os.reboot()
  232. else
  233. Timer()
  234. _tmb = 0
  235. end
  236. end
  237. end
  238.  
  239. gTime = function()
  240. term.setCursorPos(1,1)
  241. term.setBackgroundColour(colours.white)
  242. clear()
  243. paintutils.drawImage(_timer, 1, 1)
  244. term.setCursorPos(4,1)
  245. term.setBackgroundColour(colours.lightGrey)
  246. term.setTextColour(colours.black)
  247. print(" Seconds")
  248. flashOn()
  249. term.setCursorPos(12,1)
  250. print("GO>")
  251. term.setCursorPos(1,1)
  252. term.setTextColour(colours.black)
  253. term.setBackgroundColour(colours.lightGrey)
  254. term.setCursorPos(1,1)
  255. term.setBackgroundColour(colours.lightGrey)
  256. term.setTextColour(colours.black)
  257. print(tm)
  258. event, button, x, y = os.pullEventRaw()
  259. if event == "mouse_click" and x > 11 and x < 15 and y == 1 and button == 1 then
  260. flashOff()
  261. term.setCursorPos(12,1)
  262. print("GO>")
  263. buttonSound()
  264. flashOn()
  265. term.setCursorPos(12,1)
  266. print("GO>")
  267. sleep(0.1)
  268. term.setBackgroundColour(colours.white)
  269. term.setTextColour(colours.black)
  270. while true do
  271. term.setCursorPos(25,1)
  272. print("-"..tm.."-")
  273. sleep(1)
  274. tm = tm - 1
  275. if tm < 1 then
  276. clear()
  277. term.setCursorPos(25,1)
  278. print("0")
  279. sleep(1)
  280. term.setBackgroundColour(colours.white)
  281. clear()
  282. OriginCoords()
  283. print("FINISHED")
  284. Alarm()
  285. sleep(1)
  286. _ms = 0
  287. _tb = 0
  288. Init()
  289. end
  290. end
  291. end
  292. end
  293.  
  294. flashOn = function()
  295. term.setTextColour(colours.white)
  296. term.setBackgroundColour(colours.lime)
  297. end
  298.  
  299. flashOff = function()
  300. term.setTextColour(colours.white)
  301. term.setBackgroundColour(colours.green)
  302. end
  303.  
  304. BootUp = function()
  305. term.setBackgroundColour(colours.white)
  306. term.clear()
  307. term.setCursorPos(8,9)
  308. term.setTextColour(colours.black)
  309. print("Booting up OS - this won't take long")
  310. term.setBackgroundColour(colours.white)
  311. paintutils.drawImage(_BootUp, 1, 1)
  312. term.setCursorPos(12,10)
  313. term.setBackgroundColour(colours.lime)
  314. term.setTextColour(colours.lime)
  315. textutils.slowPrint("a;klsjfdlkajsfkdja;lskdjflkajs")
  316. end
  317.  
  318. OriginCoords = function()
  319. term.setCursorPos(1,1)
  320. end
  321.  
  322. clear = function()
  323. term.clear()
  324. end
  325.  
  326. OnKeyPressed = function()
  327. event, key = os.pullEvent("key")
  328. end
  329. ---------------------------------------------
  330. password = function()
  331. if passwordOn == true then
  332. password2()
  333. else
  334. Init()
  335. end
  336. end
  337.  
  338. password2 = function()
  339. term.setBackgroundColour(colours.cyan)
  340. term.clear()
  341. paintutils.drawImage(_password, 1, 1)
  342. term.setCursorPos(30,17)
  343. term.setTextColour(colours.white)
  344. print("OK")
  345. term.setCursorPos(18, 17)
  346. print("CANCEL")
  347. term.setCursorPos(18, 14)
  348. term.setBackgroundColour(colours.white)
  349. term.setTextColour(colours.black)
  350. v = read()
  351. if v == "12547" then
  352. while true do
  353. _oo = 1
  354. event, button, x, y = os.pullEventRaw()
  355. if event == "mouse_click" and _oo == 1 and x > 27 and x < 34 and y == 17 and button == 1 then
  356. term.setCursorPos(28,17)
  357. term.setTextColour(colours.white)
  358. term.setBackgroundColour(colours.green)
  359. print("  OK  ")
  360. buttonSound()
  361. term.setBackgroundColour(colours.lime)
  362. term.setTextColour(colours.white)
  363. term.setCursorPos(28,17)
  364. print("  OK  ")
  365. sleep(0.1)
  366. Init()
  367. elseif event == "mouse_click" and _oo == 1 and x > 16 and x < 24 and y == 17 and button == 1 then
  368. term.setCursorPos(17,17)
  369. flashOff()
  370. print(" CANCEL")
  371. buttonSound()
  372. flashOn()
  373. term.setCursorPos(17,17)
  374. print(" CANCEL")
  375. sleep(0.1)
  376. password()
  377. end
  378. end
  379. else
  380. while true do
  381. event, button, x, y = os.pullEventRaw()
  382. if event == "mouse_click" then
  383. if _oo == 0 and x > 27 and x < 34 and y == 17 and button == 1 then
  384. flashOff()
  385. term.setCursorPos(28,17)
  386. print("  OK  ")
  387. buttonSound()
  388. flashOn()
  389. term.setCursorPos(28,17)
  390. print("  OK  ")
  391. sleep(0.1)
  392. password()
  393. elseif _oo == 0 and x > 16 and x < 24 and y == 17 and button == 1 then
  394. term.setCursorPos(17,17)
  395. flashOff()
  396. print(" CANCEL")
  397. buttonSound()
  398. flashOn()
  399. term.setCursorPos(17,17)
  400. print(" CANCEL")
  401. sleep(0.1)
  402. password()
  403. end
  404. end
  405. end
  406. end
  407. end
  408.  
  409. email = function()
  410. term.setBackgroundColour(colours.white)
  411. term.clear()
  412. term.setCursorPos(1,1)
  413. paintutils.drawImage(_em, 1, 1)
  414. term.setCursorPos(1,1)
  415. rednet.open("right")
  416. term.setTextColour(colours.black)
  417. term.setBackgroundColour(colours.white)
  418. input = read()
  419. rednet.broadcast(input)
  420. _ms = 0
  421. Init()
  422. end
  423.  
  424.  
  425. function exit(x, y)
  426. term.setCursorPos(x, y)
  427. term.setBackgroundColour(colours.red)
  428. term.setTextColour(colours.white)
  429. print("X")
  430. ex = x
  431. ey = y
  432. while true do
  433. event, button, x, y = os.pullEvent("mouse_click")
  434. if button == 1 and ex == x and ey == y then
  435. term.setCursorPos(ex, ey)
  436. term.setBackgroundColour(colours.pink)
  437. term.setTextColour(colours.white)
  438. print("X")
  439. buttonSound()
  440. term.setBackgroundColour(colours.red)
  441. term.setTextColour(colours.white)
  442. term.setCursorPos(ex, ey)
  443. print("X")
  444. sleep(0.1)
  445. Init()
  446. end  
  447. end
  448. end
  449.  
  450. drawMenu1 = function()
  451. term.setCursorPos(1,2)
  452. term.setTextColour(colours.black)
  453. term.setBackgroundColour(colours.white)
  454. print("Power      ")
  455. print("Reboot     ")
  456. print("Email      ")
  457. print("Code       ")
  458. print("Timer      ")
  459. print("Other     >")
  460. term.setBackgroundColour(colours.red)
  461. term.setTextColour(colours.white)
  462. term.setCursorPos(11,8)
  463. print("X")
  464. term.setCursorPos(1, 8)
  465. term.setBackgroundColour(colours.blue)
  466. term.setTextColour(colours.white)
  467. print("Welcome   ")
  468. term.setTextColour(colours.white)
  469. end
  470.  
  471. drawTaskbar = function()
  472. term.setBackgroundColour(colours.blue)
  473. term.setCursorPos(1,1)
  474. term.clearLine()
  475. term.setCursorPos(1,1)
  476. term.setBackgroundColour(colours.lime)
  477. term.setTextColour(colours.white)
  478. term.setCursorPos(1,1)
  479. write("START")
  480. end
  481.  
  482. drawMenu2 = function()
  483. term.setBackgroundColour(colours.white)
  484. term.setTextColour(colours.black)
  485. term.setCursorPos(contextX, contextY)
  486. print("Background   ")
  487. term.setCursorPos(contextX, contextY + 1)
  488. print("OS code      ")
  489. term.setCursorPos(contextX, contextY + 2)
  490. print("Time         ")
  491. term.setCursorPos(contextX, contextY - 1)
  492. term.setBackgroundColour(colours.blue)
  493. term.setTextColour(colours.white)
  494. print("Shack-os V"..version)
  495. end
  496.  
  497. function xToggleOn(text)
  498. term.setBackgroundColour(colours.pink)
  499. print(text)
  500. buttonSound()
  501. end
  502.  
  503. function xToggleOff(text)
  504. term.setBackgroundColour(colours.red)
  505. print(text)
  506. sleep(0.1)
  507. end
  508.  
  509. drawDesktop = function()
  510. term.setBackgroundColour(colours.lightBlue)
  511. clear()
  512. OriginCoords()
  513. paintutils.drawImage(_dt, 1, 1)
  514. end
  515.  
  516. drawMenu3 = function()
  517. term.setCursorPos(27,9)
  518. term.setBackgroundColour(colours.blue)
  519. term.setTextColour(colours.white)
  520. print("Other-Games")
  521. term.setCursorPos(27,10)
  522. term.setBackgroundColour(colours.white)
  523. term.setTextColour(colours.black)
  524. print(" Worm      ")
  525. term.setCursorPos(27,11)
  526. print(" Adventure ")
  527. end
  528. -----------------THIS is the function that runs the whole prog.----
  529. Init = function()
  530. _ms = 0
  531. drawDesktop()
  532. drawTaskbar()
  533. term.setCursorPos(1,17)
  534. term.setBackgroundColour(colours.green)
  535. term.clearLine()
  536. term.setCursorPos(1,18)
  537. term.clearLine()
  538. term.setCursorPos(1,19)
  539. term.clearLine()
  540. pinon()
  541. term.setCursorPos(35,1)
  542. print("Shack-OS V"..version)
  543. runTime()
  544. end
  545.  
  546. ---------------------------------------------------------------------------
  547.  
  548. drawMenu4 = function()
  549. term.setCursorPos(12,6)
  550. term.setBackgroundColour(colours.blue)
  551. term.setTextColour(colours.white)
  552. print("Other          ")
  553. term.setCursorPos(12,7)
  554. term.setBackgroundColour(colours.white)
  555. term.setTextColour(colours.black)
  556. print("Paint a Picture")
  557. term.setCursorPos(12,8)
  558. print("File-Browser   ")
  559. term.setCursorPos(12,9)
  560. print("test3          ")
  561. term.setCursorPos(12,10)
  562. print("Games         >")
  563. end
  564.  
  565. runTime = function()
  566. while running do
  567. event, button, x, y = os.pullEventRaw()
  568. if event == "mouse_click" then
  569. if _ms == 0 and button == 1 and x < 6 and y == 1 then
  570. term.setCursorPos(1,1)
  571. flashOff()
  572. term.setCursorPos(1,1)
  573. print("START")
  574. buttonSound()
  575. term.setCursorPos(1,1)
  576. flashOn()
  577. term.setCursorPos(1,1)
  578. print("START")
  579. drawMenu1()
  580. _ms = _ms + 1
  581. elseif _ms == 1 and button == 1 and x < 12 and y == 2 then
  582. term.setCursorPos(1,2)
  583. toggleOn("Power      ")
  584. term.setCursorPos(1,2)
  585. toggleOff("Power      ")
  586. os.shutdown()
  587. elseif _ms == 1 and button == 1 and x < 12 and y == 3 then
  588. term.setCursorPos(1,3)
  589. toggleOn("Reboot     ")
  590. term.setCursorPos(1,3)
  591. toggleOff("Reboot     ")
  592. os.reboot()
  593. elseif _ms == 1 and button == 1 and x < 12 and y == 4 then
  594. term.setCursorPos(1,4)
  595. toggleOn("Email      ")
  596. term.setCursorPos(1,4)
  597. toggleOff("Email      ")
  598. email()
  599. elseif _ms == 1 and button == 1 and x < 12 and y == 5 then
  600. term.setCursorPos(1,5)
  601. toggleOn("Code       ")
  602. term.setCursorPos(1,5)
  603. toggleOff("Code       ")
  604. shell.run("test")
  605. elseif _ms == 1 and button == 1 and x < 12 and y == 6 then
  606. term.setCursorPos(1,6)
  607. toggleOn("Timer      ")
  608. term.setCursorPos(1,6)
  609. toggleOff("Timer      ")
  610. Timer()
  611. elseif _ms == 1 and button == 1 and x < 12 and y == 7 then
  612. term.setCursorPos(1,7)
  613. toggleOn("Other     >")
  614. term.setCursorPos(1,7)
  615. toggleOff("Other     >")
  616. drawMenu4()
  617. _ms = 4
  618. elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 7 then
  619. term.setCursorPos(12,7)
  620. toggleOn("Paint a Picture")
  621. term.setCursorPos(12,7)
  622. toggleOff("Paint a Picture")
  623. shell.run("painter")
  624. elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 8 then
  625. term.setCursorPos(12,8)
  626. toggleOn("File-Browser   ")
  627. term.setCursorPos(12,8)
  628. toggleOff("File-Browser   ")
  629. shell.run("filebrowseros")
  630. shell.run("gui")
  631. elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 9 then
  632. term.setCursorPos(12,9)
  633. toggleOn("test3          ")
  634. term.setCursorPos(12,9)
  635. toggleOff("test3          ")
  636. elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 10 then
  637. term.setCursorPos(12,10)
  638. toggleOn("Games         >")
  639. term.setCursorPos(12,10)
  640. toggleOff("Games         >")
  641. drawMenu3()
  642. _ms = 5
  643. elseif _ms == 5 and button == 1 and x >= 27 and x <=38 and y == 10 and event == "mouse_click" then
  644. term.setCursorPos(27,10)
  645. toggleOn(" Worm      ")
  646. term.setCursorPos(27,10)
  647. toggleOff(" Worm      ")
  648. term.setBackgroundColour(colours.black)
  649. term.setTextColour(colours.white)
  650. shell.run("worm")
  651. elseif _ms == 5 and button == 1 and x >= 27 and x <= 38 and y == 11 and event == "mouse_click" then
  652. term.setCursorPos(27,11)
  653. toggleOn(" Adventure ")
  654. term.setCursorPos(27,11)
  655. toggleOff(" Adventure ")
  656. term.setBackgroundColour(colours.black)
  657. term.setTextColour(colours.white)
  658. term.clear()
  659. shell.run("adventure")
  660. elseif _ms == 1 and button == 1 and x < 12 and x > 10 and y == 8 then
  661. term.setCursorPos(11,8)
  662. xToggleOn("X")
  663. term.setCursorPos(11,8)
  664. xToggleOff("X")
  665. clear()
  666. _ms = _ms - 1
  667. Init()
  668. elseif button == 1 and x >= 7 and x < 9 and y == 1 then
  669. term.setCursorPos(7,1)
  670. term.setBackgroundColour(colours.blue)
  671. term.setTextColour(colours.cyan)
  672. print("EE")
  673. buttonSound()
  674. term.setCursorPos(7,1)
  675. term.setBackgroundColour(colours.lightBlue)
  676. print("EE")
  677. sleep(0.1)
  678. window()
  679. elseif _ms>=0 and _ms<3 and x > 0 and x < 38 and y < 17 and y > 1 and button == 2 then
  680. contextX = x
  681. contextY = y
  682. term.setCursorPos(contextX, contextY)
  683. drawMenu2()
  684. _ms = 3
  685. elseif button==1 and _ms==3 and x >= contextX and x <= contextX+13 and y==contextY then
  686. term.setCursorPos(contextX, contextY)
  687. term.setTextColour(colours.black)
  688. term.setBackgroundColour(colours.lightGrey)
  689. print("Background   ")
  690. buttonSound()
  691. term.setCursorPos(contextX, contextY)
  692. term.setBackgroundColour(colours.white)
  693. print("Background   ")
  694. sleep(0.1)
  695. shell.run("paint _dt")
  696. _ms = 0
  697. Init()
  698. elseif button==1 and _ms==3 and x >= contextX and x <= contextX+13 and y==contextY+1 then
  699. term.setCursorPos(contextX, contextY+1)
  700. term.setTextColour(colours.black)
  701. term.setBackgroundColour(colours.lightGrey)
  702. print("OS code      ")
  703. buttonSound()
  704. term.setBackgroundColour(colours.white)
  705. term.setCursorPos(contextX, contextY+1)
  706. print("OS code      ")
  707. sleep(0.1)
  708. shell.run("edit gui")
  709. _ms = 0
  710. Init()
  711. elseif button == 1 and _ms == 3 and x >= contextX and x <= contextX + 13 and y == contextY+2 then
  712. term.setCursorPos(contextX, contextY+2)
  713. toggleOn("Time         ")
  714. term.setCursorPos(contextX, contextY+2)
  715. toggleOff("Time         ")
  716. term.setCursorPos(23,10)
  717. term.setBackgroundColour(colours.black) --black and yellow black and yellow black and yellow
  718. term.setTextColour(colours.yellow)
  719. tincan = os.time()
  720. tincanreturns = textutils.formatTime(time, false)
  721. print(tincanreturns)
  722. sleep(3)
  723. Init()
  724. else
  725. _ms = 0
  726. Init()
  727. end
  728. end
  729. end
  730. end
  731.  
  732. --------------------------------------------------------
  733. password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement