Advertisement
Guest User

test12

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