Advertisement
Guest User

test14

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