Advertisement
TyanColte

apfinal

Jan 10th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.66 KB | None | 0 0
  1. m = peripheral.wrap("right")
  2.  
  3. rednet.open("top")
  4.  
  5.  
  6. tBarC = 8
  7. tBartC = 1
  8. backColor = 32768
  9.  
  10. function titlebar()
  11.   term.setCursorPos(1,1)
  12.   term.setBackgroundColor(tBarC)
  13.   term.setTextColor(tBartC)
  14.   term.clearLine()
  15.   term.setCursorPos(3,1)
  16.   print("[Select which apiary]")
  17.   term.setCursorPos(39,19)
  18.   print("[Start]")
  19. end
  20.  
  21. function background()
  22.   term.setBackgroundColor(backColor)
  23.   term.clear()
  24.   bground = paintutils.loadImage(".gui")
  25.   paintutils.drawImage(bground,1,1)
  26. end
  27.  
  28. function one()
  29.   term.setCursorPos(2,18)
  30.   term.setBackgroundColor(32768)
  31.   print("apairy 1")
  32.   rednet.send(474, "1")
  33. end
  34.  
  35. function two()
  36.   term.setCursorPos(2,18)
  37.   term.setBackgroundColor(32768)
  38.   print("apairy 2")
  39.   rednet.send(474, "2")
  40. end
  41.  
  42. function three()
  43.   term.setCursorPos(2,18)
  44.   term.setBackgroundColor(32768)
  45.   print("apairy 3")
  46.   rednet.send(474, "3")
  47. end
  48.  
  49. function four()
  50.   term.setCursorPos(2,18)
  51.   term.setBackgroundColor(32768)
  52.   print("apairy 4")
  53.   rednet.send(474, "4")
  54. end
  55.  
  56. function five()
  57.   term.setCursorPos(2,18)
  58.   term.setBackgroundColor(32768)
  59.   print("apairy 5")
  60.   rednet.send(474, "5")
  61. end
  62.  
  63. function six()
  64.   term.setCursorPos(2,18)
  65.   term.setBackgroundColor(32768)
  66.   print("apairy 6")
  67.   rednet.send(474, "6")
  68. end
  69.  
  70. function seven()
  71.   term.setCursorPos(2,18)
  72.   term.setBackgroundColor(32768)
  73.   print("apairy 7")
  74.   rednet.send(474, "7")
  75. end
  76.  
  77. function eight()
  78.   term.setCursorPos(2,18)
  79.   term.setBackgroundColor(32768)
  80.   print("apairy 8")
  81.   rednet.send(474, "8")
  82. end
  83.  
  84. function nine()
  85.   term.setCursorPos(2,18)
  86.   term.setBackgroundColor(32768)
  87.   print("apairy 9")
  88.   rednet.send(474, "9")
  89. end  
  90.  
  91. function ten()
  92.   term.setCursorPos(2,18)
  93.   term.setBackgroundColor(32768)
  94.   print("apairy 10")
  95.   rednet.send(474, "10")
  96.  
  97. end
  98.  
  99. function eleven()
  100.   term.setCursorPos(2,18)
  101.   term.setBackgroundColor(32768)
  102.   print("apairy 11")
  103.   rednet.send(474, "11")
  104. end
  105.  
  106. function tweleve()
  107.   term.setCursorPos(2,18)
  108.   term.setBackgroundColor(32768)
  109.   print("apairy 12")
  110.   rednet.send(474, "12")
  111. end
  112.  
  113. function thirteen()
  114.   term.setCursorPos(2,18)
  115.   term.setBackgroundColor(32768)
  116.   print("apairy 13")
  117.   rednet.send(474, "13")
  118. end
  119.  
  120. function fourteen()
  121.   term.setCursorPos(2,18)
  122.   term.setBackgroundColor(32768)
  123.   print("apairy 14")
  124.   rednet.send(474, "14")
  125. end
  126.  
  127. function fithteen()
  128.   term.setCursorPos(2,18)
  129.   term.setBackgroundColor(32768)
  130.   print("apairy 15")
  131.   rednet.send(474, "15")
  132. end
  133.  
  134. function sixteen()
  135.   term.setCursorPos(2,18)
  136.   term.setBackgroundColor(32768)
  137.   print("apairy 16")
  138.   rednet.send(474, "16")
  139. end
  140.  
  141. function seventeen()
  142.   term.setCursorPos(2,18)
  143.   term.setBackgroundColor(32768)
  144.   print("apairy 17")
  145.   rednet.send(474, "17")
  146. end
  147.  
  148. function eighteen()
  149.   term.setCursorPos(2,18)
  150.   term.setBackgroundColor(32768)
  151.   print("apairy 18")
  152.   rednet.send(474, "18")
  153. end
  154.  
  155. function nineteen()
  156.   term.setCursorPos(2,18)
  157.   term.setBackgroundColor(32768)
  158.   print("apairy 19")
  159.   rednet.send(474, "19")
  160. end
  161.  
  162. function twenty()
  163.   term.setCursorPos(2,18)
  164.   term.setBackgroundColor(32768)
  165.   print("apairy 20")
  166.   rednet.send(474, "20")
  167. end
  168.  
  169. function twentyone()
  170.   term.setCursorPos(2,18)
  171.   term.setBackgroundColor(32768)
  172.   print("apairy 21")
  173.   rednet.send(474, "21")
  174. end
  175.  
  176. function twentytwo()
  177.   term.setCursorPos(2,18)
  178.   term.setBackgroundColor(32768)
  179.   print("apairy 22")
  180.   rednet.send(474, "22")
  181. end
  182.  
  183. function twentythree()
  184.   term.setCursorPos(2,18)
  185.   term.setBackgroundColor(32768)
  186.   print("apairy 23")
  187.   rednet.send(474, "23")
  188. end
  189.  
  190. function twentyfour()
  191.   term.setCursorPos(2,18)
  192.   term.setBackgroundColor(32768)
  193.   print("apairy 24")
  194.   rednet.send(474, "24")
  195. end
  196.  
  197. function twentyfive()
  198.   term.setCursorPos(2,18)
  199.   term.setBackgroundColor(32768)
  200.   print("apairy 25")
  201.   rednet.send(474, "25")
  202. end
  203.  
  204. function twentysix()
  205.   term.setCursorPos(2,18)
  206.   term.setBackgroundColor(32768)
  207.   print("apairy 26")
  208.   rednet.send(474, "26")
  209. end
  210.  
  211. function twentyseven()
  212.   term.setCursorPos(2,18)
  213.   term.setBackgroundColor(32768)
  214.   print("apairy 27")
  215.   rednet.send(474, "27")
  216.  
  217. end
  218.  
  219. function twentyeight()
  220.   term.setCursorPos(2,18)
  221.   term.setBackgroundColor(32768)
  222.   print("apairy 28")
  223.   rednet.send(474, "28")
  224. end
  225.  
  226. function twentynine()
  227.   term.setCursorPos(2,18)
  228.   term.setBackgroundColor(32768)
  229.   print("apairy 29")
  230.   rednet.send(474, "29")
  231. end
  232.  
  233. function thirty()
  234.   term.setCursorPos(2,18)
  235.   term.setBackgroundColor(32768)
  236.   print("apairy 30")
  237.   rednet.send(474, "30")
  238. end
  239.  
  240. function thirtyone()
  241.   term.setCursorPos(2,18)
  242.   term.setBackgroundColor(32768)
  243.   print("apairy 31")
  244.   rednet.send(474, "31")
  245. end
  246.  
  247. function thirtytwo()
  248.   term.setCursorPos(2,18)
  249.   term.setBackgroundColor(32768)
  250.   print("apairy 32")
  251.   rednet.send(474, "32")
  252. end
  253.  
  254. function thirtythree()
  255.   term.setCursorPos(2,18)
  256.   term.setBackgroundColor(32768)
  257.   print("apairy 33")
  258.   rednet.send(474, "33")
  259. end
  260.  
  261. function thirtyfour()
  262.   term.setCursorPos(2,18)
  263.   term.setBackgroundColor(32768)
  264.   print("apairy 34")
  265.   rednet.send(474, "34")
  266. end
  267.  
  268. function thirtyfive()
  269.   term.setCursorPos(2,18)
  270.   term.setBackgroundColor(32768)
  271.   print("apairy 35")
  272.   rednet.send(474, "35")
  273. end
  274.  
  275. function thirtysix()
  276.   term.setCursorPos(2,18)
  277.   term.setBackgroundColor(32768)
  278.   print("apairy 36")
  279.   rednet.send(474, "36")
  280. end
  281.  
  282. function thirtyseven()
  283.   term.setCursorPos(2,18)
  284.   term.setBackgroundColor(32768)
  285.   print("apairy 37")
  286.   rednet.send(474, "37")
  287. end
  288.  
  289. function thirtyeight()
  290.   term.setCursorPos(2,18)
  291.   term.setBackgroundColor(32768)
  292.   print("apairy 38")
  293.   rednet.send(474, "38")
  294. end
  295.  
  296. function thirtynine()
  297.   term.setCursorPos(2,18)
  298.   term.setBackgroundColor(32768)
  299.   print("apairy 39")
  300.   rednet.send(474, "39")
  301. end
  302.  
  303. function fourty()
  304.   term.setCursorPos(2,18)
  305.   term.setBackgroundColor(32768)
  306.   print("apairy 40")
  307.   rednet.send(474, "40")
  308. end
  309.  
  310. function fourtyone()
  311.   term.setCursorPos(2,18)
  312.   term.setBackgroundColor(32768)
  313.   print("apairy 41")
  314.   rednet.send(474, "41")
  315. end
  316.  
  317. function fourtytwo()
  318.   term.setCursorPos(2,18)
  319.   term.setBackgroundColor(32768)
  320.   print("apairy 42")
  321.   rednet.send(474, "42")
  322. end
  323.  
  324. function fourtythree()
  325.   term.setCursorPos(2,18)
  326.   term.setBackgroundColor(32768)
  327.   print("apairy 43")
  328.   rednet.send(474, "43")
  329. end
  330.  
  331. function fourtyfour()
  332.   term.setCursorPos(2,18)
  333.   term.setBackgroundColor(32768)
  334.   print("apairy 44")
  335.   rednet.send(474, "44")
  336. end
  337.  
  338. function fourtyfive()
  339.   term.setCursorPos(2,18)
  340.   term.setBackgroundColor(32768)
  341.   print("apairy 45")
  342.   rednet.send(474, "45")
  343. end
  344.  
  345. function fourtysix()
  346.   term.setCursorPos(2,18)
  347.   term.setBackgroundColor(32768)
  348.   print("apairy 46")
  349.   rednet.send(474, "46")
  350. end
  351.  
  352. function fourtyseven()
  353.   term.setCursorPos(2,18)
  354.   term.setBackgroundColor(32768)
  355.   print("apairy 47")
  356.   rednet.send(474, "47")
  357. end
  358.  
  359. function fourtyeight()
  360.   term.setCursorPos(2,18)
  361.   term.setBackgroundColor(32768)
  362.   print("apairy 48")
  363.   rednet.send(474, "48")
  364. end
  365.  
  366. function fourtynine()
  367.   term.setCursorPos(2,18)
  368.   term.setBackgroundColor(32768)
  369.   print("apairy 49")
  370.   rednet.send(474, "49")
  371. end
  372.  
  373. function fifty()
  374.   term.setCursorPos(2,18)
  375.   term.setBackgroundColor(32768)
  376.   print("apairy 50")
  377.   rednet.send(474, "50")
  378. end
  379.  
  380. function fail()
  381.   term.setCursorPos(2,18)
  382.   print("Error")
  383.   term.setCursorPos(8,18)
  384.   print(X..", "..Y)
  385. end
  386. -- print(table.concat({os.pullEventRaw()}, ","))
  387.  
  388. function main()
  389. while true do
  390. event, button, X, Y = os.pullEvent("mouse_click")
  391.  
  392. X = tonumber(X)
  393. Y = tonumber(Y)
  394.  
  395.   if X == 5 and Y == 15 then
  396.     one()
  397.     break
  398.     elseif X == 9 and Y == 15 then
  399.     two()
  400.     break
  401.     elseif X == 13 and Y == 15 then
  402.     three()
  403.     break
  404.     elseif X == 17 and Y == 15 then
  405.     four()
  406.     break
  407.     elseif X == 21 and Y == 15 then
  408.     five()
  409.     break
  410.     elseif X == 25 and  Y == 15 then
  411.     six()
  412.     break
  413.     elseif X == 29 and Y == 15 then
  414.     seven()
  415.     break
  416.     elseif X == 33 and Y == 15 then
  417.     eight()
  418.     break
  419.     elseif X == 37 and Y == 15 then
  420.     nine()
  421.     break
  422.     elseif X == 41 and Y == 15 then
  423.     ten()
  424.     break
  425.     elseif X == 5 and Y == 12 then
  426.     eleven()
  427.     break
  428.     elseif X == 9 and Y == 12 then
  429.     tweleve()
  430.     break
  431.     elseif X == 13 and Y == 12 then
  432.     thirteen()
  433.     break
  434.     elseif X == 17 and Y == 12 then
  435.     fourteen()
  436.     break
  437.     elseif X == 21 and Y == 12 then
  438.     fithteen()
  439.     break
  440.     elseif X == 25 and Y == 12 then
  441.     sixteen()
  442.     break
  443.     elseif X == 29 and Y == 12 then
  444.     seventeen()
  445.     break
  446.     elseif X == 33 and Y == 12 then
  447.     eighteen()
  448.     break
  449.     elseif X == 37 and Y == 12 then
  450.     nineteen()
  451.     break
  452.     elseif X == 41 and Y == 12 then
  453.     twenty()
  454.     break
  455.     elseif X == 5 and Y == 9 then
  456.     twentyone()
  457.     break
  458.     elseif X == 9 and Y == 9 then
  459.     twentytwo()
  460.     break
  461.     elseif X == 13 and Y == 9 then
  462.     twentythree()
  463.     break
  464.     elseif X == 17 and Y == 9 then
  465.     twentyfour()
  466.     break
  467.     elseif X == 21 and Y == 9 then
  468.     twentyfive()
  469.     break
  470.     elseif X == 25 and Y == 9 then
  471.     twentysix()
  472.     break
  473.     elseif X == 29 and Y == 9 then
  474.     twentyseven()
  475.     break
  476.     elseif X == 33 and Y == 9 then
  477.     twentyeight()
  478.     break
  479.     elseif X == 37 and Y == 9 then
  480.     twentynine()
  481.     break
  482.     elseif X == 41 and Y == 9 then
  483.     thirty()
  484.     break
  485.     elseif X == 5 and Y == 6 then
  486.     thirtyone()
  487.     break
  488.     elseif X == 9 and Y == 6 then
  489.     thirtytwo()
  490.     break
  491.     elseif X == 13 and Y == 6 then
  492.     thirtythree()
  493.     break
  494.     elseif X == 17 and Y == 6 then
  495.     thirtyfour()
  496.     break
  497.     elseif X == 21 and Y == 6 then
  498.     thirtyfive()
  499.     break
  500.     elseif X == 25 and Y == 6 then
  501.     thirtysix()
  502.     break
  503.     elseif X == 29 and Y == 6 then
  504.     thirtyseven()
  505.     break
  506.     elseif X == 33 and Y == 6 then
  507.     thirtyeight()
  508.     break
  509.     elseif X == 37 and Y == 6 then
  510.     thirtynine()
  511.     break
  512.     elseif X == 41 and Y == 6 then
  513.     fourty()
  514.     break
  515.     elseif X == 5 and Y == 3 then
  516.     fourtyone()
  517.     break
  518.     elseif X == 9 and Y == 3 then
  519.     fourtytwo()
  520.     break
  521.     elseif X == 13 and Y == 3 then
  522.     fourtythree()
  523.     break
  524.     elseif X == 17 and Y == 3 then
  525.     fourtyfour()
  526.     break
  527.     elseif X == 21 and Y == 3 then
  528.     fourtyfive()
  529.     break
  530.     elseif X == 25 and Y == 3 then
  531.     fourtysix()
  532.     break
  533.     elseif X == 29 and Y == 3 then
  534.     fourtyseven()
  535.     break
  536.     elseif X == 33 and Y == 3 then
  537.     fourtyeight()
  538.     break
  539.     elseif X == 37 and Y == 3 then
  540.     fourtynine()
  541.     break
  542.     elseif X == 41 and Y == 3 then
  543.     fifty()
  544.     break
  545.     else
  546.     fail()
  547.     break
  548.   end
  549. end
  550. end
  551.  
  552. while true do
  553.   background()
  554.   main()
  555.   sleep(1)
  556. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement