Advertisement
Guest User

GUI

a guest
Mar 3rd, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.28 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. rednet.open("back")
  5.  
  6. local id = 547
  7.  
  8.  
  9. while true do
  10.  term.clear()
  11. --Buttons- up, down
  12.  paintutils.drawFilledBox(1,2,6,4,colors.cyan)
  13.  
  14.  paintutils.drawFilledBox(1,7,6,9,colors.cyan)
  15.  
  16.  paintutils.drawFilledBox(10,2,19,4,colors.cyan)
  17.  
  18.  paintutils.drawFilledBox(7,5,13,7,colors.cyan)
  19.  
  20.  paintutils.drawFilledBox(16,5,22,7,colors.cyan)
  21.  
  22.  paintutils.drawFilledBox(10,8,19,10,colors.cyan)
  23.  
  24.  paintutils.drawFilledBox(1,12,6,14,colors.brown)
  25.  
  26.  paintutils.drawFilledBox(1,16,6,18,colors.brown)
  27.  
  28.  paintutils.drawFilledBox(8,12,14,14,colors.green)
  29.  
  30.  paintutils.drawFilledBox(8,16,14,18,colors.green)
  31.  
  32.  paintutils.drawFilledBox(24,2,26,2,colors.blue)
  33.  
  34.  paintutils.drawFilledBox(25,3,26,18,colors.blue)
  35.  
  36.  
  37.  term.setCursorPos(3,3)
  38.  term.setBackgroundColor(colors.cyan)
  39.  print("UP")
  40.  term.setCursorPos(2,8)
  41.  print("DOWN")
  42.  term.setCursorPos(12,3)
  43.  print("FORWARD")
  44.  term.setCursorPos(9,6)
  45.  print("LEFT")
  46.  term.setCursorPos(17,6)
  47.  print("RIGHT")
  48.  term.setCursorPos(13,9)
  49.  print("BACK")
  50.  term.setBackgroundColor(colors.brown)
  51.  term.setCursorPos(2,13)
  52.  print("DIG")
  53.   term.setCursorPos(2,17)
  54.   print("DIG")
  55.   term.setCursorPos(2,18)
  56.   print("DOWN")
  57.  term.setBackgroundColor(colors.green)
  58.  term.setCursorPos(9,13)
  59.  print("PLACE")
  60.   term.setCursorPos(9,17)
  61.   print("PLACE")
  62.   term.setCursorPos(10,18)
  63.   print("DOWN")
  64.  term.setBackgroundColor(colors.blue)
  65.   term.setCursorPos(24,2)
  66.   print("INV")
  67.   term.setCursorPos(26,3)
  68.   print("1")
  69.   term.setCursorPos(26,4)
  70.   print("2")
  71.   term.setCursorPos(26,5)
  72.   print("3")
  73.   term.setCursorPos(26,6)
  74.   print("4")
  75.   term.setCursorPos(26,7)
  76.   print("5")
  77.   term.setCursorPos(26,8)
  78.   print("6")
  79.   term.setCursorPos(26,9)
  80.   print("7")
  81.   term.setCursorPos(26,10)
  82.   print("8")
  83.   term.setCursorPos(26,11)
  84.   print("9")
  85.   term.setCursorPos(25,12)
  86.   print("10")
  87.   term.setCursorPos(25,13)
  88.   print("11")
  89.   term.setCursorPos(25,14)
  90.   print("12")
  91.   term.setCursorPos(25,15)
  92.   print("13")
  93.   term.setCursorPos(25,16)
  94.   print("14")
  95.   term.setCursorPos(25,17)
  96.   print("15")
  97.   term.setCursorPos(25,18)
  98.   print("16")
  99.  
  100.  term.setBackgroundColor(colors.black)
  101.  term.setCursorPos(16,18)
  102.  
  103.  local evnt = { os.pullEvent("mouse_click") }
  104.  local x = evnt[3]
  105.  local y = evnt[4]
  106.  if y >= 1 and y <= 6 and x >= 2 and x <= 4 then
  107.   rednet.send(id,"up")
  108.   print("up")
  109.   sleep(.5)
  110.  end
  111.  
  112.  if y >= 7 and y <= 9 and x >= 1 and x <= 6 then
  113.   rednet.send(id,"down")
  114.   print("down")
  115.   sleep(.5)
  116.  end
  117.  
  118.  if y >= 2 and y <= 4 and x >= 10 and x <= 19 then
  119.  rednet.send(id,"forward")
  120.  print("forward")
  121.  sleep(.5)
  122.  end
  123.  
  124.  if y >= 5 and y <= 7 and x >= 7 and x <= 13 then
  125.   rednet.send(id,"left")
  126.   print("left")
  127.   sleep(.5)
  128.  end
  129.  
  130.  if y >= 5 and y <= 7 and x >= 16 and x <= 22 then
  131.   rednet.send(id,"right")
  132.   print("right")
  133.   sleep(.5)
  134.  end
  135.  
  136.  if y >= 8 and y <= 10 and x >= 10 and x <= 19 then
  137.   rednet.send(id,"back")
  138.   print("back")
  139.   sleep(.5)
  140.  end
  141.  
  142.  if y >= 12 and y <= 14 and x >= 1 and x <= 6 then
  143.   rednet.send(id,"dig")
  144.   print("dig")
  145.   sleep(.5)
  146.  end
  147.  
  148.  if y >= 16 and y <= 18 and x >= 1 and x <= 6 then
  149.   rednet.send(id,"digdown")
  150.   print("DigDown")
  151.   sleep(.5)
  152.  end
  153.  
  154.  if y >= 12 and y <= 14 and x >= 8 and x <= 14 then
  155.   rednet.send(id,"place")
  156.   print("place")
  157.   sleep(.5)
  158.  end
  159.  
  160.  if y >= 16 and y <= 18 and x >= 8 and x <= 14 then
  161.   rednet.send(id,"placedown")
  162.   print("placeDown")
  163.   sleep(.5)
  164.  end
  165.  
  166.  if y >= 3 and y <= 3 and x >= 25 and x <= 26 then
  167.   rednet.send(id,"inv1")
  168.   print("inv1")
  169.   sleep(.5)
  170.  end
  171.  
  172.  if y >= 4 and y <= 4 and x >= 25 and x <= 26 then
  173.   rednet.send(id,"inv2")
  174.   print("inv2")
  175.   sleep(.5)
  176.  end
  177.  
  178.  if y >= 5 and y <= 5 and x >= 25 and x <= 26 then
  179.   rednet.send(id,"inv3")
  180.   print("inv3")
  181.   sleep(.5)
  182.  end
  183.  
  184.  if y >= 6 and y <= 6 and x >= 25 and x <= 26 then
  185.   rednet.send(id,"inv4")
  186.   print("inv4")
  187.   sleep(.5)
  188.  end
  189.  
  190.  if y >= 7 and y <= 7 and x >= 25 and x <= 26 then
  191.  rednet.send(id,"inv5")
  192.  print("inv5")
  193.  sleep(.5)
  194.  end
  195.  
  196.  if y >= 8 and y <= 8 and x >= 25 and x <= 26 then
  197.   rednet.send(id,"inv6")
  198.   print("inv6")
  199.   sleep(.5)
  200.  end
  201.  
  202.  if y >= 9 and y <= 9 and x >= 25 and x <= 26 then
  203.   rednet.send(id,"inv7")
  204.   print("inv7")
  205.   sleep(.5)
  206.  end
  207.  
  208.  if y >= 10 and y <= 10 and x >= 25 and x <= 26 then
  209.   rednet.send(id,"inv8")
  210.   print("inv8")
  211.   sleep(.5)
  212.  end
  213.  
  214.  if y >= 11 and y <= 11 and x >= 25 and x <= 26 then
  215.   rednet.send(id,"inv9")
  216.   print("inv9")
  217.   sleep(.5)
  218.  end
  219.  
  220.  if y >= 12 and y <= 12 and x >= 25 and x <= 26 then
  221.   rednet.send(id,"inv10")
  222.   print("inv10")
  223.   sleep(.5)
  224.  end
  225.  
  226.  if y >= 13 and y <= 13 and x >= 25 and x <= 26 then
  227.   rednet.send(id,"inv11")
  228.   print("inv11")
  229.   sleep(.5)
  230.  end
  231.  
  232.  if y >= 14 and y <= 14 and x >= 15 and x <= 26 then
  233.   rednet.send(id,"inv12")
  234.   print("inv12")
  235.   sleep(.5)
  236.  end
  237.  
  238.  if y >= 15 and y <= 15 and x >= 25 and x <= 26 then
  239.   rednet.send(id,"inv13")
  240.   print("inv13")
  241.   sleep(.5)
  242.  end
  243.  
  244.  if y >= 16 and y <= 16 and x >= 25 and x <= 26 then
  245.   rednet.send(id,"inv14")
  246.   print("inv14")
  247.   sleep(.5)
  248.  end
  249.  
  250.  if y >= 17 and y <= 17 and x >= 25 and x <= 26 then
  251.   rednet.send(id,"inv15")
  252.   print("inv15")
  253.   sleep(.5)
  254.  end
  255.  
  256.  if y >= 18 and y <= 18 and x >= 25 and x <= 26 then
  257.   rednet.send(id,"inv16")
  258.   print("inv16")
  259.   sleep(.5)
  260.  end
  261. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement