Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "top"
- mon = peripheral.wrap(side)
- mon.setBackgroundColor(32768)
- mon.clear()
- function calc_color(color)
- return math.pow(2, color - 1)
- end
- function msg(gap, line, color, groundb, text)
- mon.setBackgroundColor(calc_color(groundb))
- mon.setCursorPos(gap,line)
- mon.setTextColor(calc_color(color))
- text = mon.write(text)
- end
- function PlayerOn() --")
- msg(01,01,16,06," ")
- msg(01,02,16,06," MagmaLP ist online ")
- msg(01,03,16,06," ")
- end
- function PlayerOff()
- msg(01,01,01,15," ")
- msg(01,02,01,15," MagmaLP ist offline ")
- msg(01,03,01,15," ")
- end
- function PigmanSpawnerOn()
- msg(01,05,16,06," ")
- msg(01,06,16,06," Pigman-Spawner ")
- msg(01,07,16,06," ")
- PigmanSpawner = 1
- end
- function PigmanSpawnerOff()
- msg(01,05,01,15," ")
- msg(01,06,01,15," Pigman-Spawner ")
- msg(01,07,01,15," ")
- PigmanSpawner = 0
- end
- function AutoSpawnerOn()
- msg(21,05,16,06," ")
- msg(21,06,16,06," Auto-Spawner ")
- msg(21,07,16,06," ")
- AutoSpawner = 1
- end
- function AutoSpawnerOff()
- msg(21,05,01,15," ")
- msg(21,06,01,15," Auto-Spawner ")
- msg(21,07,01,15," ")
- AutoSpawner = 0
- end
- function ChangeAutoSpawner()
- msg(01,09,01,08," ")
- msg(01,10,01,08," Auto-Spawner Mob wählen ")
- msg(01,11,01,08," ")
- end
- function SelectAutoSpawner()
- msg(01,01,01,16," ")
- mon.clear()
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 01 and X <= 42 and Y >= 01 and Y <= 20 and side == side then
- os.reboot()
- end
- end
- -------------------------------------------------------------
- PigmanSpawnerOff()
- rs.setOutput("left", true)
- AutoSpawnerOff()
- rs.setOutput("back", true)
- ChangeAutoSpawner()
- if rs.getInput("right", true) then
- PlayerOn()
- else
- PlayerOff()
- sleep(5)
- os.reboot()
- end
- while true do
- if rs.getInput("right", true) then
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 01 and X <= 19 and Y >= 05 and Y <= 07 and side == side and PigmanSpawner == 0 then
- PigmanSpawnerOn()
- rs.setOutput("left", false)
- elseif X >= 01 and X <= 19 and Y >= 05 and Y <= 07 and side == side and PigmanSpawner == 1 then
- PigmanSpawnerOff()
- rs.setOutput("left", true)
- elseif X >= 21 and X <= 42 and Y >= 05 and Y <= 07 and side == side and AutoSpawner == 0 then
- AutoSpawnerOn()
- rs.setOutput("back", false)
- elseif X >= 21 and X <= 42 and Y >= 05 and Y <= 07 and side == side and AutoSpawner == 1 then
- AutoSpawnerOff()
- rs.setOutput("back", true)
- elseif X >= 01 and X <= 42 and Y >= 09 and Y <= 11 and side == side then
- SelectAutoSpawner()
- end
- end
- sleep(0.5)
- end
Add Comment
Please, Sign In to add comment