Advertisement
Guest User

startup

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