MagmaLP

Mobfarm_Minium_Shards

May 13th, 2022 (edited)
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.04 KB | None | 0 0
  1. side = "top"
  2. mon = peripheral.wrap(side)
  3. mon.setBackgroundColor(32768)
  4. mon.clear()
  5.  
  6. function calc_color(color)
  7.     return math.pow(2, color - 1)
  8. end
  9.  
  10. function msg(gap, line, color, groundb, text)
  11.     mon.setBackgroundColor(calc_color(groundb))
  12.     mon.setCursorPos(gap,line)
  13.     mon.setTextColor(calc_color(color))
  14.     text = mon.write(text)
  15. end  
  16.  
  17. function PlayerOn()                                   --")
  18.     msg(01,01,16,06,"                                       ")
  19.     msg(01,02,16,06,"          MagmaLP ist online           ")
  20.     msg(01,03,16,06,"                                       ")
  21. end
  22.  
  23. function PlayerOff()
  24.     msg(01,01,01,15,"                                       ")
  25.     msg(01,02,01,15,"          MagmaLP ist offline          ")
  26.     msg(01,03,01,15,"                                       ")
  27. end
  28.  
  29. function PigmanSpawnerOn()
  30.     msg(01,05,16,06,"                   ")
  31.     msg(01,06,16,06,"   Pigman-Spawner  ")
  32.     msg(01,07,16,06,"                   ")
  33.     PigmanSpawner = 1
  34. end
  35.  
  36. function PigmanSpawnerOff()
  37.     msg(01,05,01,15,"                   ")
  38.     msg(01,06,01,15,"   Pigman-Spawner  ")
  39.     msg(01,07,01,15,"                   ")
  40.     PigmanSpawner = 0
  41. end
  42.  
  43. function AutoSpawnerOn()
  44.     msg(21,05,16,06,"                   ")
  45.     msg(21,06,16,06,"   Auto-Spawner    ")
  46.     msg(21,07,16,06,"                   ")
  47.     AutoSpawner = 1
  48. end
  49.  
  50. function AutoSpawnerOff()
  51.     msg(21,05,01,15,"                   ")
  52.     msg(21,06,01,15,"   Auto-Spawner    ")
  53.     msg(21,07,01,15,"                   ")
  54.     AutoSpawner = 0
  55. end
  56.  
  57. function ChangeAutoSpawner()
  58.     msg(01,09,01,08,"                                       ")
  59.     msg(01,10,01,08,"       Auto-Spawner Mob wählen         ")
  60.     msg(01,11,01,08,"                                       ")
  61. end
  62.  
  63. function SelectAutoSpawner()
  64.     msg(01,01,01,16," ")
  65.     mon.clear()
  66.     local event, side, X, Y = os.pullEvent("monitor_touch")
  67.     if X >= 01 and X <= 42 and Y >= 01 and Y <= 20 and side == side then
  68.         os.reboot()
  69.     end
  70. end
  71.  
  72. -------------------------------------------------------------
  73.  
  74. PigmanSpawnerOff()
  75. rs.setOutput("left", true)
  76. AutoSpawnerOff()
  77. rs.setOutput("back", true)
  78. ChangeAutoSpawner()
  79.  
  80. if rs.getInput("right", true) then
  81.     PlayerOn()
  82. else
  83.     PlayerOff()
  84.     sleep(5)
  85.     os.reboot()
  86. end
  87.  
  88. while true do
  89.     if rs.getInput("right", true) then
  90.         local event, side, X, Y = os.pullEvent("monitor_touch")
  91.         if X >= 01 and X <= 19 and Y >= 05 and Y <= 07 and side == side and PigmanSpawner == 0 then
  92.             PigmanSpawnerOn()
  93.             rs.setOutput("left", false)
  94.         elseif X >= 01 and X <= 19 and Y >= 05 and Y <= 07 and side == side and PigmanSpawner == 1 then
  95.             PigmanSpawnerOff()
  96.             rs.setOutput("left", true)
  97.         elseif X >= 21 and X <= 42 and Y >= 05 and Y <= 07 and side == side and AutoSpawner == 0 then
  98.             AutoSpawnerOn()
  99.             rs.setOutput("back", false)
  100.         elseif X >= 21 and X <= 42 and Y >= 05 and Y <= 07 and side == side and AutoSpawner == 1 then
  101.             AutoSpawnerOff()
  102.             rs.setOutput("back", true)
  103.         elseif X >= 01 and X <= 42 and Y >= 09 and Y <= 11 and side == side then
  104.             SelectAutoSpawner()
  105.         end
  106.     end
  107.     sleep(0.5)
  108. end
  109.    
Add Comment
Please, Sign In to add comment