Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- local monitor = peripheral.wrap("top")
- -- Created by Gunnar Jessee / LostboyDev
- local mobs = { wither = "wither", skeletons = "skeletons", witherSkeletons = "WS",
- witch = "witch", chicken = "chicken" }
- local selectedMob = mobs.witherSkeletons
- local width, height = monitor.getSize()
- function fillButtons()
- button.setTable(mobs.wither, wither, 2, 10, 2, 4)
- button.setTable(mobs.skeletons, skeletons, 2, 10, 6, 8)
- button.setTable(mobs.witherSkeletons, witherSkeletons, 2, 10, 10, 12)
- button.setTable(mobs.chicken, chicken, 2, 10, 14, 16)
- button.setTable(mobs.witch, witch, 12, 20, 2, 4)
- end
- function wither()
- local name = mobs.wither
- button.flash(name)
- rednet.broadcast(name, "woot")
- end
- function witherSkeletons()
- local name = mobs.witherSkeletons
- button.flash(name)
- rednet.broadcast(name, "woot")
- end
- function skeletons()
- local name = mobs.skeletons
- button.flash(name)
- rednet.broadcast(name, "woot")
- end
- function witch()
- local name = mobs.witch
- button.flash(name)
- rednet.broadcast(name, "woot")
- end
- function chicken()
- local name = mobs.chicken
- button.flash(name)
- rednet.broadcast(name, "woot")
- end
- rednet.open("left")
- function sendPacket(name)
- rednet.broadcast(name, "woot")
- end
- function checkClick()
- event, side, x, y = os.pullEvent("monitor_touch")
- button.checkxy(x, y)
- end
- local backgroundColor = colors.white
- function changeBackgroundColor()
- if backgroundColor == colors.white then
- backgroundColor = colors.white
- else
- backgroundColor = colors.white
- end
- end
- function checkeredPattern()
- for x = 1, width do
- for y = 1, height do
- changeBackgroundColor()
- monitor.setBackgroundColor(backgroundColor)
- monitor.setCursorPos(x, y)
- monitor.write(" ")
- monitor.setTextColor(colors.black)
- end
- end
- end
- monitor.clear()
- monitor.setCursorPos(1, 1)
- checkeredPattern()
- button.heading("COMAS")
- fillButtons()
- button.screen()
- while true do
- checkClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement