Advertisement
Guest User

test13

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