Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2. m = peripheral.wrap("monitor_2")
  3. m.setBackgroundColor(colors.black)
  4. m.clear()
  5. local bloodBool = false
  6. local botaniaBool= false
  7. local farmBool = false
  8. local bool = false
  9. local i = 0
  10. local i2 = 0
  11.  
  12. --BloodMagic
  13. function buttons()
  14.   if bloodBool == false then
  15.     m.setBackgroundColor(colors.red)
  16.   elseif bloodBool == true then
  17.     m.setBackgroundColor(colors.green)
  18.   end
  19.  
  20.   i = 3
  21.  
  22.   repeat
  23.     m.setCursorPos(5,i)
  24.     m.write("              ")
  25.     i = i+1
  26.     term.write(i)
  27.   until i == 7
  28.  
  29.   if botaniaBool == false then
  30.     m.setBackgroundColor(colors.red)
  31.   elseif botaniaBool == true then
  32.     m.setBackgroundColor(colors.green)
  33.   end
  34.  
  35.   i = 3
  36.  
  37.   repeat
  38.     m.setCursorPos(32,i)
  39.     m.write("              ")
  40.     i = i+1
  41.   until i == 7
  42. end
  43.  
  44. while true do
  45.   event,side,x,y = os.pullEvent("monitor_touch")
  46.  
  47.   if x >= 5 and x <= 18 and y >= 3 and y <= 7 then
  48.     if bloodBool == false then
  49.       bloodBool = true
  50.     elseif bloodBool == true then
  51.       bloodBool = false
  52.     end
  53.     buttons()
  54.   elseif x >= 32 and x <= 44 and y >= 3 and y <= 7 then
  55.     if botaniaBool == false then
  56.       botaniaBool = true
  57.     elseif botaniaBool == true then
  58.       botaniaBool = false
  59.     end
  60.     buttons()
  61.   end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement