Advertisement
Guest User

test6

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