Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
48
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. end
  29.  
  30. while true do
  31.   event,side,x,y = os.pullEvent("monitor_touch")
  32.  
  33.   if x >= 5 and x <= 18 and y >= 3 and y <= 7 then
  34.     if bloodBool == false then
  35.       bloodBool = true
  36.     elseif bloodBool == true then
  37.       bloodBool = false
  38.     end
  39.     buttons()
  40.   elseif x >= 32 and x <= 44 and y >= 3 and y <= 7 then
  41.     if botaniaBool == false then
  42.       botaniaBool = true
  43.     elseif botaniaBool == true then
  44.       botaniaBool = false
  45.     end
  46.     buttons()
  47.   end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement