GamingwithAtos

MobFarmController.lua

Dec 7th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. m = peripheral.wrap("back")
  2. rednet.open("top")
  3. m.setTextColor(colors.white)
  4. m.setBackgroundColor(colors.black)
  5. m.clear()
  6. m.setTextScale(0.5)
  7. local offset = 17
  8. --AFK
  9. function Draw()
  10.  
  11. m.clear()
  12. m.setCursorPos(4,2)
  13. m.setBackgroundColor(colors.black)
  14. m.write("AFK Farming")
  15.  
  16. --AFK true/false
  17. if afk == true then
  18. m.setCursorPos(7,5)
  19. m.setBackgroundColor(colors.green)
  20. m.write("aktiv")
  21. m.setBackgroundColor(colors.black)
  22. else
  23. m.setCursorPos(6,5)
  24. m.setBackgroundColor(colors.red)
  25. m.write("inaktiv")
  26. m.setBackgroundColor(colors.black)
  27. end
  28.  
  29.  
  30. --ON
  31. m.setCursorPos(4,8)
  32. m.setBackgroundColor(colors.green)
  33. m.write("ON")
  34. m.setBackgroundColor(colors.black)
  35.  
  36. --OFF
  37. m.setCursorPos(12,8)
  38. m.setBackgroundColor(colors.red)
  39. m.write("OFF")
  40. m.setBackgroundColor(colors.black)
  41.  
  42. m.setCursorPos(23,2)
  43. m.setBackgroundColor(colors.black)
  44. m.write("MobFarm On/Off")
  45.  
  46. --MobFarm trueFalse
  47. if mfarm == true then
  48. m.setCursorPos(26,5)
  49. m.setBackgroundColor(colors.green)
  50. m.write("aktiv")
  51. m.setBackgroundColor(colors.black)
  52. else
  53. m.setCursorPos(25,5)
  54. m.setBackgroundColor(colors.red)
  55. m.write("inaktiv")
  56. m.setBackgroundColor(colors.black)
  57. end
  58.  
  59.  
  60. --ON
  61. m.setCursorPos(23,8)
  62. m.setBackgroundColor(colors.green)
  63. m.write("ON")
  64. m.setBackgroundColor(colors.black)
  65.  
  66. --OFF
  67. m.setCursorPos(31,8)
  68. m.setBackgroundColor(colors.red)
  69. m.write("OFF")
  70. m.setBackgroundColor(colors.black)
  71. end
  72.  
  73.  
  74. Draw()
  75.  
  76. while true do
  77. local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  78. print("x: "..xPos.." y: "..yPos)
  79. --AFK
  80. if xPos >= 4 and xPos <= 5 then
  81. rednet.broadcast("afk_on")
  82. afk = true
  83. Draw()
  84. end
  85. if xPos >= 12 and xPos <= 14 then
  86. rednet.broadcast("afk_off")
  87. afk = false
  88. Draw()
  89. end
  90. --AFK
  91. --MOBFARM
  92. if xPos >= 6 + offset and xPos <= 7 + offset then
  93. rednet.broadcast("mfarm_on")
  94. mfarm = true
  95. Draw()
  96. end
  97. if xPos >= 14 + offset and xPos <= 16 + offset then
  98. rednet.broadcast("mfarm_off")
  99. mfarm = false
  100. Draw()
  101. end
  102. --MOBFARM
  103. end
Add Comment
Please, Sign In to add comment