Advertisement
Guest User

startup

a guest
Jul 24th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.46 KB | None | 0 0
  1. term.clear()
  2. term.setTextColor(colors.cyan)
  3. term.setCursorPos(1,1)
  4. print("GazzOS V.7 - Market-Exchange")
  5. term.setTextColor(colors.white)
  6. --rednet.open("right")
  7. local deposit = peripheral.wrap("diamond_0")
  8. local top = peripheral.wrap("monitor_12")
  9. rednet.open("left")
  10. mouseWidth = 0
  11. mouseHeight = 0
  12. local m = peripheral.wrap("back")
  13. m.clear()
  14. m.setCursorPos(1,1)
  15. w,h=m.getSize()
  16. print(w)
  17. print(h)
  18. function checkbalance()
  19. monitorbalance = 0
  20. rs.setBundledOutput("right", colors.brown)
  21. sleep(.2)
  22. rs.setBundledOutput("right", 0)
  23. sleep(.1)
  24. id, message = rednet.receive()
  25. monitorbalance = monitorbalance + message
  26. if monitorbalance < 2 then
  27. print("Broke-Ass")
  28. m.clear()
  29. m.setCursorPos(27,10)
  30. m.setBackgroundColor(colors.red)
  31. m.write("You Cannot Afford.")
  32. m.setCursorPos(65,18)
  33. m.write("Restart")
  34. m.setBackgroundColor(colors.black)
  35. rs.setBundledOutput("bottom", colors.magenta)
  36. sleep(5)
  37. rs.setBundledOutput("bottom", 0)
  38. else
  39. charge()
  40. m.clear()
  41. top.clear()
  42. m.setCursorPos(32,10)
  43. m.write("Thank You!")
  44. m.setCursorPos(27,11)
  45. sleep(.3)
  46. m.write("For Shopping Gazz-Co!")
  47. rs.setBundledOutput("bottom", colors.orange)
  48. sleep(5)
  49. os.reboot()
  50. end
  51. end
  52. function topupdate()
  53. rs.setBundledOutput("right", colors.brown)
  54. sleep(.2)
  55. rs.setBundledOutput("right", 0)
  56. sleep(.1)
  57. end
  58. --DurrDurr--
  59. function charge()
  60. deposit.condenseItems()
  61. if rost < 128 then
  62. deposit.pushItem("east",1,rost,1)
  63. rost = rost - 64
  64. deposit.pushItem("east",2,rost,2)
  65. topupdate()
  66. elseif rost < 192 then
  67. deposit.condenseItems()
  68. deposit.pushItem("east",1,rost,1)
  69. rost = rost - 64
  70. deposit.pushItem("east",2,rost,2)
  71. rost = rost - 64
  72. deposit.pushItem("east",3,rost,3)
  73. rost = rost - 64
  74. topupdate()
  75. elseif rost > 192 then
  76. deposit.condenseItems()
  77. deposit.pushItem("east",1,rost,1)
  78. rost = rost - 64
  79. deposit.pushItem("east",2,rost,2)
  80. rost = rost - 64
  81. deposit.pushItem("east",3,rost,3)
  82. rost = rost - 64
  83. deposit.pushItem("east",4,rost,4)
  84. rost = rost - 64
  85. topupdate()
  86. elseif rost < 64 then
  87. deposit.pushItem("east",1,rost,1)
  88. rs.setOutput("left", true)
  89. sleep(.8)
  90. rs.setOutput("left", false)
  91. end
  92. end
  93. --Set Values--
  94. function clean()
  95. AmmountDiamond = 0
  96. AmmountWood = 0
  97. AmmountCopper = 0
  98. AmmountLapis = 0
  99. AmmountRedstone = 0
  100. AmmountTin = 0
  101. AmmountOsmium = 0
  102. AmmountIron = 0
  103. AmmountGold = 0
  104. newBal = 0
  105. end
  106. -----------------All Item Transfer Relations------------------------------------
  107. function onestackw()
  108. rs.setBundledOutput("right", colors.lightGray)
  109. sleep(.2)
  110. rs.setBundledOutput("right", 0)
  111. sleep(.2)
  112. end
  113. function twostackw()
  114. onestackw()
  115. onestackw()
  116. end
  117. function fourstackw()
  118. twostackw()
  119. twostackw()
  120. end
  121. function onestacko()
  122. rs.setBundledOutput("right", colors.pink)
  123. sleep(.2)
  124. rs.setBundledOutput("right", 0)
  125. sleep(.2)
  126. end
  127. function twostacko()
  128. onestacko()
  129. onestacko()
  130. end
  131. function fourstacko()
  132. twostacko()
  133. twostacko()
  134. end
  135. function onestackl()
  136. rs.setBundledOutput("right", colors.lime)
  137. sleep(.2)
  138. rs.setBundledOutput("right", 0)
  139. sleep(.2)
  140. end
  141. function twostackl()
  142. onestackl()
  143. onestackl()
  144. end
  145. function fourstackl()
  146. twostackl()
  147. twostackl()
  148. end
  149. function onestackt()
  150. rs.setBundledOutput("right", colors.lightBlue)
  151. sleep(.2)
  152. rs.setBundledOutput("right", 0)
  153. sleep(.2)
  154. end
  155. function twostackt()
  156. onestackt()
  157. onestackt()
  158. end
  159. function fourstackt()
  160. twostackt()
  161. twostackt()
  162. end
  163. function onestackr()
  164. rs.setBundledOutput("right", colours.magenta)
  165. sleep(.2)
  166. rs.setBundledOutput("right", 0)
  167. sleep(.2)
  168. end
  169. function twostackr()
  170. onestackr()
  171. onestackr()
  172. end
  173. function fourstackr()
  174. twostackr()
  175. twostackr()
  176. end
  177. function onestackc()
  178. rs.setBundledOutput("right", colours.yellow)
  179. sleep(.2)
  180. rs.setBundledOutput("right", 0)
  181. sleep(.2)
  182. end
  183. function twostackc()
  184. onestackc()
  185. onestackc()
  186. end
  187. function fourstackc()
  188. twostackc()
  189. twostackc()
  190. end
  191. function onestackg()
  192. rs.setBundledOutput("right", colours.orange)
  193. sleep(.2)
  194. rs.setBundledOutput("right", 0)
  195. sleep(.2)
  196. end
  197. function twostackg()
  198. onestackg()
  199. onestackg()
  200. end
  201. function fourstackg()
  202. twostackg()
  203. twostackg()
  204. end
  205. function onestack()
  206. rs.setBundledOutput("right", colours.white)
  207. sleep(.2)
  208. rs.setBundledOutput("right", 0)
  209. sleep(.2)
  210. end
  211. function twostack()
  212. onestack()
  213. onestack()
  214. end
  215. function fourstack()
  216. twostack()
  217. twostack()
  218. end
  219. function doiron()
  220. if AmmountIron < 63 then
  221. print("No Iron")
  222. elseif AmmountIron < 65 then
  223. onestack()
  224. elseif AmmountIron < 129 then
  225. onestack()
  226. onestack()
  227. elseif AmmountIron < 193 then
  228. twostack()
  229. onestack()
  230. elseif AmmountIron < 257 then
  231. twostack()
  232. twostack()
  233. elseif AmmountIron < 321 then
  234. fourstack()
  235. onestack()
  236. elseif AmmountIron < 384 then
  237. fourstack()
  238. twostack()
  239. elseif AmmountIron < 449 then
  240. fourstack()
  241. twostack()
  242. onestack()
  243. elseif AmmountIron < 513 then
  244. fourstack()
  245. fourstack()
  246. elseif AmmountIron < 577 then
  247. fourstack()
  248. fourstack()
  249. onestack()
  250. elseif AmmountIron < 641 then
  251. fourstack()
  252. fourstack()
  253. twostack()
  254. elseif AmmountIron < 705 then
  255. fourstack()
  256. fourstack()
  257. twostack()
  258. onestack()
  259. elseif AmmountIron < 769 then
  260. fourstack()
  261. fourstack()
  262. fourstack()
  263. elseif AmmountIron < 833 then
  264. fourstack()
  265. fourstack()
  266. fourstack()
  267. onestack()
  268. elseif AmmountIron < 897 then
  269. fourstack()
  270. fourstack()
  271. fourstack()
  272. twostack()
  273. elseif AmmountIron < 961 then
  274. fourstack()
  275. fourstack()
  276. fourstack()
  277. twostack()
  278. onestack()
  279. elseif AmmountIron < 1025 then
  280. fourstack()
  281. fourstack()
  282. fourstack()
  283. fourstack()
  284. end
  285. end
  286. function docopper()
  287. if AmmountCopper < 63 then
  288. print("No Copper")
  289. elseif AmmountCopper < 65 then
  290. onestackc()
  291. elseif AmmountCopper < 129 then
  292. onestackc()
  293. onestackc()
  294. elseif AmmountCopper < 193 then
  295. twostackc()
  296. onestackc()
  297. elseif AmmountCopper < 257 then
  298. twostackc()
  299. twostackc()
  300. elseif AmmountCopper < 321 then
  301. fourstackc()
  302. onestackc()
  303. elseif AmmountCopper < 384 then
  304. fourstackc()
  305. twostackc()
  306. elseif AmmountCopper < 449 then
  307. fourstackc()
  308. twostackc()
  309. onestackc()
  310. elseif AmmountCopper < 513 then
  311. fourstackc()
  312. fourstackc()
  313. elseif AmmountCopper < 577 then
  314. fourstackc()
  315. fourstackc()
  316. onestackc()
  317. elseif AmmountCopper < 641 then
  318. fourstackc()
  319. fourstackc()
  320. twostackc()
  321. elseif AmmountCopper < 705 then
  322. fourstackc()
  323. fourstackc()
  324. twostackc()
  325. onestackc()
  326. elseif AmmountCopper < 769 then
  327. fourstackc()
  328. fourstackc()
  329. fourstackc()
  330. elseif AmmountCopper < 833 then
  331. fourstackc()
  332. fourstackc()
  333. fourstackc()
  334. onestackc()
  335. elseif AmmountCopper < 897 then
  336. fourstackc()
  337. fourstackc()
  338. fourstackc()
  339. twostackc()
  340. elseif AmmountCopper < 961 then
  341. fourstackc()
  342. fourstackc()
  343. fourstackc()
  344. twostackc()
  345. onestackc()
  346. elseif AmmountCopper < 1025 then
  347. fourstackc()
  348. fourstackc()
  349. fourstackc()
  350. fourstackc()
  351. end
  352. end
  353. function dogold()
  354. if AmmountGold < 31 then
  355. print("No Gold")
  356. elseif AmmountGold < 32 then
  357. onestackg()
  358. elseif AmmountGold < 64 then
  359. onestackg()
  360. onestackg()
  361. elseif AmmountGold < 97 then
  362. twostackg()
  363. onestackg()
  364. elseif AmmountGold < 129 then
  365. twostackg()
  366. twostackg()
  367. elseif AmmountGold < 161 then
  368. fourstackg()
  369. onestackg()
  370. elseif AmmountGold < 193 then
  371. fourstackg()
  372. twostackg()
  373. elseif AmmountGold < 225 then
  374. fourstackg()
  375. twostackg()
  376. onestackg()
  377. elseif AmmountGold < 257 then
  378. fourstackg()
  379. fourstackg()
  380. elseif AmmountGold < 289 then
  381. fourstackg()
  382. fourstackg()
  383. onestackg()
  384. elseif AmmountGold < 321 then
  385. fourstackg()
  386. fourstackg()
  387. twostackg()
  388. elseif AmmountGold < 353 then
  389. fourstackg()
  390. fourstackg()
  391. twostackg()
  392. onestackg()
  393. elseif AmmountGold < 385 then
  394. fourstackg()
  395. fourstackg()
  396. fourstackg()
  397. elseif AmmountGold < 417 then
  398. fourstackg()
  399. fourstackg()
  400. fourstackg()
  401. onestackg()
  402. elseif AmmountGold < 449 then
  403. fourstackg()
  404. fourstackg()
  405. fourstackg()
  406. twostackg()
  407. elseif AmmountGold < 481 then
  408. fourstackg()
  409. fourstackg()
  410. fourstackg()
  411. twostackg()
  412. onestackg()
  413. elseif AmmountGold < 513 then
  414. fourstackg()
  415. fourstackg()
  416. fourstackg()
  417. fourstackg()
  418. end
  419. end
  420. function doredstone()
  421. if AmmountRedstone < 63 then
  422. print("No Redstone")
  423. elseif AmmountRedstone < 65 then
  424. onestackr()
  425. elseif AmmountRedstone < 129 then
  426. onestackr()
  427. onestackr()
  428. elseif AmmountRedstone < 193 then
  429. twostackr()
  430. onestackr()
  431. elseif AmmountRedstone < 257 then
  432. twostackr()
  433. twostackr()
  434. elseif AmmountRedstone < 321 then
  435. fourstackr()
  436. onestackr()
  437. elseif AmmountRedstone < 384 then
  438. fourstackr()
  439. twostackr()
  440. elseif AmmountRedstone < 449 then
  441. fourstackr()
  442. twostackr()
  443. onestackr()
  444. elseif AmmountRedstone < 513 then
  445. fourstackr()
  446. fourstackr()
  447. elseif AmmountRedstone < 577 then
  448. fourstackr()
  449. fourstackr()
  450. onestackr()
  451. elseif AmmountRedstone < 641 then
  452. fourstackr()
  453. fourstackr()
  454. twostackr()
  455. elseif AmmountRedstone < 705 then
  456. fourstackr()
  457. fourstackr()
  458. twostackr()
  459. onestackr()
  460. elseif AmmountRedstone < 769 then
  461. fourstackr()
  462. fourstackr()
  463. fourstackr()
  464. elseif AmmountRedstone < 833 then
  465. fourstackr()
  466. fourstackr()
  467. fourstackr()
  468. onestackr()
  469. elseif AmmountRedstone < 897 then
  470. fourstackr()
  471. fourstackr()
  472. fourstackr()
  473. twostackr()
  474. elseif AmmountRedstone < 961 then
  475. fourstackr()
  476. fourstackr()
  477. fourstackr()
  478. twostackr()
  479. onestackr()
  480. elseif AmmountRedstone < 1025 then
  481. fourstackr()
  482. fourstackr()
  483. fourstackr()
  484. fourstackr()
  485. end
  486. end
  487. function dotin()
  488. if AmmountTin < 63 then
  489. print("No Tin")
  490. elseif AmmountTin < 65 then
  491. onestackt()
  492. elseif AmmountTin < 129 then
  493. onestackt()
  494. onestackt()
  495. elseif AmmountTin < 193 then
  496. twostackt()
  497. onestackt()
  498. elseif AmmountTin < 257 then
  499. twostackt()
  500. twostackt()
  501. elseif AmmountTin < 321 then
  502. fourstackt()
  503. onestackt()
  504. elseif AmmountTin < 384 then
  505. fourstackt()
  506. twostackt()
  507. elseif AmmountTin < 449 then
  508. fourstackt()
  509. twostackt()
  510. onestackt()
  511. elseif AmmountTin < 513 then
  512. fourstackt()
  513. fourstackt()
  514. elseif AmmountTin < 577 then
  515. fourstackt()
  516. fourstackt()
  517. onestackt()
  518. elseif AmmountTin < 641 then
  519. fourstackt()
  520. fourstackt()
  521. twostackt()
  522. elseif AmmountTin < 705 then
  523. fourstackt()
  524. fourstackt()
  525. twostackt()
  526. onestackt()
  527. elseif AmmountTin < 769 then
  528. fourstackt()
  529. fourstackt()
  530. fourstackt()
  531. elseif AmmountTin < 833 then
  532. fourstackt()
  533. fourstackt()
  534. fourstackt()
  535. onestackt()
  536. elseif AmmountTin < 897 then
  537. fourstackt()
  538. fourstackt()
  539. fourstackt()
  540. twostackt()
  541. elseif AmmountTin < 961 then
  542. fourstackt()
  543. fourstackt()
  544. fourstackt()
  545. twostackt()
  546. onestackt()
  547. elseif AmmountTin < 1025 then
  548. fourstackt()
  549. fourstackt()
  550. fourstackt()
  551. fourstackt()
  552. end
  553. end
  554. function dolapis()
  555. if AmmountLapis < 63 then
  556. print("No Lapis")
  557. elseif AmmountLapis < 65 then
  558. onestackl()
  559. elseif AmmountLapis < 129 then
  560. onestackl()
  561. onestackl()
  562. elseif AmmountLapis < 193 then
  563. twostackl()
  564. onestackl()
  565. elseif AmmountLapis < 257 then
  566. twostackl()
  567. twostackl()
  568. elseif AmmountLapis < 321 then
  569. fourstackl()
  570. onestackl()
  571. elseif AmmountLapis < 384 then
  572. fourstackl()
  573. twostackl()
  574. elseif AmmountLapis < 449 then
  575. fourstackl()
  576. twostackl()
  577. onestackl()
  578. elseif AmmountLapis < 513 then
  579. fourstackl()
  580. fourstackl()
  581. elseif AmmountLapis < 577 then
  582. fourstackl()
  583. fourstackl()
  584. onestackl()
  585. elseif AmmountLapis < 641 then
  586. fourstackl()
  587. fourstackl()
  588. twostackl()
  589. elseif AmmountLapis < 705 then
  590. fourstackl()
  591. fourstackl()
  592. twostackl()
  593. onestackl()
  594. elseif AmmountLapis < 769 then
  595. fourstackl()
  596. fourstackl()
  597. fourstackl()
  598. elseif AmmountLapis < 833 then
  599. fourstackl()
  600. fourstackl()
  601. fourstackl()
  602. onestackl()
  603. elseif AmmountLapis < 897 then
  604. fourstackl()
  605. fourstackl()
  606. fourstackl()
  607. twostackl()
  608. elseif AmmountLapis < 961 then
  609. fourstackl()
  610. fourstackl()
  611. fourstackl()
  612. twostackl()
  613. onestackl()
  614. elseif AmmountLapis < 1025 then
  615. fourstackl()
  616. fourstackl()
  617. fourstackl()
  618. fourstackl()
  619. end
  620. end
  621. function doosmium()
  622. if AmmountOsmium < 63 then
  623. print("No Osmium")
  624. elseif AmmountOsmium < 65 then
  625. onestacko()
  626. elseif AmmountOsmium < 129 then
  627. onestacko()
  628. onestacko()
  629. elseif AmmountOsmium < 193 then
  630. twostacko()
  631. onestacko()
  632. elseif AmmountOsmium < 257 then
  633. twostacko()
  634. twostacko()
  635. elseif AmmountOsmium < 321 then
  636. fourstacko()
  637. onestacko()
  638. elseif AmmountOsmium < 384 then
  639. fourstacko()
  640. twostacko()
  641. elseif AmmountOsmium < 449 then
  642. fourstacko()
  643. twostacko()
  644. onestacko()
  645. elseif AmmountOsmium < 513 then
  646. fourstacko()
  647. fourstacko()
  648. elseif AmmountOsmium < 577 then
  649. fourstacko()
  650. fourstacko()
  651. onestacko()
  652. elseif AmmountOsmium < 641 then
  653. fourstacko()
  654. fourstacko()
  655. twostacko()
  656. elseif AmmountOsmium < 705 then
  657. fourstacko()
  658. fourstacko()
  659. twostacko()
  660. onestacko()
  661. elseif AmmountOsmium < 769 then
  662. fourstacko()
  663. fourstacko()
  664. fourstacko()
  665. elseif AmmountOsmium < 833 then
  666. fourstacko()
  667. fourstacko()
  668. fourstacko()
  669. onestacko()
  670. elseif AmmountOsmium < 897 then
  671. fourstacko()
  672. fourstacko()
  673. fourstacko()
  674. twostacko()
  675. elseif AmmountOsmium < 961 then
  676. fourstacko()
  677. fourstacko()
  678. fourstacko()
  679. twostacko()
  680. onestacko()
  681. elseif AmmountOsmium < 1025 then
  682. fourstacko()
  683. fourstacko()
  684. fourstacko()
  685. fourstacko()
  686. end
  687. end
  688. function dowood()
  689. if AmmountWood < 63 then
  690. print("No Wood")
  691. elseif AmmountWood < 65 then
  692. onestackw()
  693. elseif AmmountWood < 129 then
  694. onestackw()
  695. onestackw()
  696. elseif AmmountWood < 193 then
  697. twostackw()
  698. onestackw()
  699. elseif AmmountWood < 257 then
  700. twostackw()
  701. twostackw()
  702. elseif AmmountWood < 321 then
  703. fourstackw()
  704. onestackw()
  705. elseif AmmountWood < 384 then
  706. fourstackw()
  707. twostackw()
  708. elseif AmmountWood < 449 then
  709. fourstackw()
  710. twostackw()
  711. onestackw()
  712. elseif AmmountWood < 513 then
  713. fourstackw()
  714. fourstackw()
  715. elseif AmmountWood < 577 then
  716. fourstackw()
  717. fourstackw()
  718. onestackw()
  719. elseif AmmountWood < 641 then
  720. fourstackw()
  721. fourstackw()
  722. twostackw()
  723. elseif AmmountWood < 705 then
  724. fourstackw()
  725. fourstackw()
  726. twostackw()
  727. onestackw()
  728. elseif AmmountWood < 769 then
  729. fourstackw()
  730. fourstackw()
  731. fourstackw()
  732. elseif AmmountWood < 833 then
  733. fourstackw()
  734. fourstackw()
  735. fourstackw()
  736. onestackw()
  737. elseif AmmountWood < 897 then
  738. fourstackw()
  739. fourstackw()
  740. fourstackw()
  741. twostackw()
  742. elseif AmmountWood < 961 then
  743. fourstackw()
  744. fourstackw()
  745. fourstackw()
  746. twostackw()
  747. onestackw()
  748. elseif AmmountWood < 1025 then
  749. fourstackw()
  750. fourstackw()
  751. fourstackw()
  752. fourstackw()
  753. end
  754. end
  755. --------------------------------------------------------------------------------------------------------
  756. --Clean Up--
  757. function default()
  758. newBal = 0
  759. cash = 0
  760. clean()
  761. m.clear()
  762. rs.setBundledOutput("right", colors.brown)
  763. sleep(.2)
  764. rs.setBundledOutput("right", 0)
  765. sleep(.1)
  766. m.setBackgroundColour((colours.black))
  767. top.clear()
  768. top.setBackgroundColour((colours.blue))
  769.  top.setCursorPos(1,1)
  770. top.write("Cart Balance:")
  771.  top.setCursorPos(27,1)
  772. top.write("Your balance:"..cash)
  773.  top.setBackgroundColour((colours.black))
  774. m.setBackgroundColour((colours.blue))
  775.  m.setCursorPos(63, 2)
  776. m.write("Purchase?")
  777.  m.setCursorPos(65,18)
  778. m.write("Clear")
  779. m.setCursorPos(63,19)
  780. m.write("Cash-Back")
  781.  m.setCursorPos(2,1)
  782. m.write("-3 Copper-")
  783.  m.setCursorPos(2,2)
  784. m.write("Iron 64x")
  785.  m.setCursorPos(2,4)
  786. m.write("Gold 32x")
  787.  m.setCursorPos(2,6)
  788. m.write("Redstone 64x")
  789.  m.setCursorPos(2,8)
  790. m.write("Tin 64x")
  791.  m.setCursorPos(2,10)
  792. m.write("Copper 64x")
  793.  m.setCursorPos(2,12)
  794. m.write("Lapis 64x")
  795.  m.setCursorPos(2,14)
  796. m.write("Osmium 64x")
  797.  m.setCursorPos(2,16)
  798. m.write("Diamond 8x")
  799.  m.setCursorPos(2,18)
  800. m.write("Oak Log 64x")
  801. m.setCursorPos(7,19)
  802. m.write("Ammounts over 1,024 are Currently Rendered Void.")
  803.  m.setBackgroundColour((colours.black))
  804. end
  805.  top.clear()
  806.  m.clear()
  807.  m.setBackgroundColour((colours.blue))
  808.  m.setCursorPos(23,9)
  809.  m.write("Insert Cash, Press start.")
  810.  m.setCursorPos(33,10)
  811.  m.write("START.")
  812.  m.setTextScale(1)
  813.  m.setBackgroundColour((colours.black))
  814. ----Physical Code----
  815. function checkClickPosition()
  816.   if mouseWidth > 64 and mouseWidth < 71 and mouseHeight == 18 then
  817.   default()
  818.   elseif mouseWidth > 63 and mouseWidth < 71 and mouseHeight == 2 then
  819.   m.setCursorPos(63,2)
  820.   m.setBackgroundColor((colors.lime))
  821.   m.write("Purchase?")
  822.   m.setBackgroundColor((colors.black))
  823.   AmmountGoldMath = AmmountGold *2
  824.   AmmountDiamondMath = AmmountDiamond * 8
  825.   yourcostbeforefirst = AmmountDiamondMath + AmmountWood + AmmountCopper + AmmountLapis + AmmountRedstone + AmmountTin + AmmountOsmium + AmmountIron + AmmountGoldMath
  826.   yourcostbefore = yourcostbeforefirst /3
  827.   youcost = yourcostbefore /7
  828.   yourcost = math.floor(youcost)
  829.   print(youcost)
  830.   rost = yourcost
  831.   charge()
  832.   checkbalance()
  833.   print(monitorbalance)
  834.   doiron()
  835.   docopper()
  836.   dogold()
  837.   doosmium()
  838.   dolapis()
  839.   dowood()
  840.   dotin()
  841.   doredstone()
  842.   m.setBackgroundColor(colors.black)
  843.   elseif mouseWidth > 13 and mouseHeight < 18 and mouseHeight == 10 then
  844.   m.setCursorPos(33,10)
  845.   m.setBackgroundColour((colours.lime))
  846.   m.write("START.")
  847.   m.setBackgroundColour((colours.black))
  848.   sleep(.2)
  849.   m.clear()
  850.   default()
  851. elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 2 then
  852.     m.setCursorPos(2,2)
  853.     m.setBackgroundColour((colours.lime))
  854.     m.write("Iron 64x")
  855.     newBal = newBal + 3
  856.    top.setCursorPos(14,1)
  857.    top.write(newBal)
  858.      m.setBackgroundColour((colours.black))
  859.     top.setCursorPos(1,2)
  860.     AmmountIron = AmmountIron + 64
  861.     top.write("Iron:"..AmmountIron)
  862.     top.setBackgroundColour((colours.black))
  863.    
  864.  elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 14 then
  865.  m.setCursorPos(2,14)
  866.  m.setBackgroundColour((colours.lime))
  867.  m.write("Osmium 64x")
  868.  newBal = newBal + 3
  869.  top.setCursorPos(14,1)
  870.  top.write(newBal)
  871.  m.setBackgroundColour((colours.black))
  872.  top.setCursorPos(17,4)
  873.  AmmountOsmium = AmmountOsmium + 64
  874.  top.write("Osmium:"..AmmountOsmium)
  875.  top.setBackgroundColour((colours.black))
  876.  elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 12 then
  877.  m.setCursorPos(2,12)
  878.  m.setBackgroundColour((colours.lime))
  879.  m.write("Lapis 64x")
  880.  newBal = newBal + 3
  881.  top.setCursorPos(14,1)
  882.  top.write(newBal)
  883.  m.setBackgroundColour((colours.black))
  884.  AmmountLapis = AmmountLapis + 64
  885.  top.setCursorPos(17,3)
  886.  top.write("Lapis:"..AmmountLapis)
  887.  top.setBackgroundColour((colours.black))
  888.  elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 10 then
  889.  m.setCursorPos(2,10)
  890.  m.setBackgroundColour((colours.lime))
  891.  m.write("Copper 64x")
  892.  newBal = newBal + 3
  893.  top.setCursorPos(14,1)
  894.  top.write(newBal)
  895.  m.setBackgroundColour((colours.black))
  896.  AmmountCopper = AmmountCopper + 64
  897.  top.setCursorPos(17,2)
  898.  top.write("Copper:"..AmmountCopper)
  899.  top.setBackgroundColour((colours.black))
  900.  elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 8 then
  901.  m.setCursorPos(2,8)
  902.  m.setBackgroundColour((colours.lime))
  903.  m.write("Tin 64x")
  904.  newBal = newBal + 3
  905.  top.setCursorPos(14,1)
  906.  top.write(newBal)
  907.  m.setBackgroundColour((colours.black))
  908.  top.setCursorPos(1,5)
  909.  AmmountTin = AmmountTin + 64
  910.  top.write("Tin:"..AmmountTin)
  911.  top.setBackgroundColour((colours.black))
  912.    elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 6 then
  913.   m.setCursorPos(2,6)
  914.   m.setBackgroundColour((colours.lime))
  915.   m.write("Redstone 64x")
  916.   newBal = newBal + 3
  917.   top.setCursorPos(14,1)
  918.   top.write(newBal)
  919.   m.setBackgroundColour((colours.black))
  920.   top.setCursorPos(1,4)
  921.   AmmountRedstone = AmmountRedstone + 64
  922.   top.write("Redstone:"..AmmountRedstone)
  923.   top.setBackgroundColour((colours.black))
  924.    elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 16 then
  925.   m.setCursorPos(2,16)
  926.   m.setBackgroundColour((colours.lime))
  927.   AmmountDiamond= AmmountDiamond + 8
  928.   m.write("Diamond 8x")
  929.   newBal = newBal + 3
  930.   top.setCursorPos(14,1)
  931.   top.write(newBal)
  932.   top.setCursorPos(29,2)
  933.   top.write("Diamond:"..AmmountDiamond)
  934.   top.setBackgroundColour((colours.black))
  935.     elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 18 then
  936.   m.setCursorPos(2,18)
  937.   m.setBackgroundColour((colours.lime))
  938.   AmmountWood = AmmountWood + 64
  939.   m.write("Oak Log 64x")
  940.   newBal = newBal + 3
  941.   top.setCursorPos(14,1)
  942.   top.write(newBal)
  943.   m.setBackgroundColour((colours.black))
  944.   --top.setCursorPos(1,3)
  945.   top.setCursorPos(17,5)
  946.   top.write("Oak Log:"..AmmountWood)
  947.   top.setBackgroundColour((colours.black))
  948.  elseif mouseWidth > 63 and mouseWidth < 72 and mouseHeight == 19 then
  949.  m.setCursorPos(63,19)
  950.  m.setBackgroundColor((colors.lime))
  951.  m.write("Cash-Back")
  952.  m.setBackgroundColor((colors.black))
  953.  top.setCursorPos(18,5)
  954.  top.write("Returning Cash.")
  955.  rs.setBundledOutput("bottom", colors.white)
  956.  sleep(3)
  957.  rs.setBundledOutput("bottom", 0)
  958.  sleep(.2)
  959.  os.reboot()
  960.  
  961.    elseif mouseWidth > 2 and mouseWidth < 8 and mouseHeight == 4 then
  962.     m.setCursorPos(2,4)
  963.     m.setBackgroundColour((colours.lime))
  964.     AmmountGold = AmmountGold + 32
  965.     m.write("Gold 32x")
  966.    newBal = newBal + 3
  967.     top.setCursorPos(14,1)
  968.     top.write(newBal)
  969.     --moneyN()
  970.     m.setBackgroundColour((colours.black))
  971.     top.setCursorPos(1,3)
  972.     top.write("Gold:"..AmmountGold)
  973.     top.setBackgroundColour((colours.black))
  974.    end
  975. end
  976. repeat
  977.   event,p1,p2,p3 = os.pullEvent()
  978.    if event=="monitor_touch" then
  979.      mouseWidth = p2
  980.      mouseHeight = p3
  981.      checkClickPosition()
  982.      end
  983.    until event=="char" and p1==("x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement