Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- And here begine the real shit
- rednet.open("bottom")
- mouseWidth = 0
- mouseHeight = 0
- monitor = peripheral.wrap("top")
- monitor.setBackgroundColor((colors.white))
- monitor.clear()
- monitor.setCursorPos(1,1)
- w,h=monitor.getSize()
- print(w)
- print(h)
- --Building Interface
- --Row 1
- monitor.setBackgroundColor((colors.cyan))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(2,2)
- monitor.write(" COW ")
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(2,4)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(2,6)
- monitor.write(" OFF ")
- monitor.setCursorPos(2,8)
- monitor.setBackgroundColor((colors.cyan))
- monitor.setTextColor((colors.black))
- monitor.write("SHEEP")
- monitor.setCursorPos(2,10)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(2,12)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(2,14)
- monitor.setBackgroundColor((colors.cyan))
- monitor.setTextColor((colors.black))
- monitor.write(" PIG ")
- monitor.setCursorPos(2,16)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(2,18)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(2,20)
- monitor.setBackgroundColor((colors.cyan))
- monitor.setTextColor((colors.black))
- monitor.write("CHICK")
- monitor.setCursorPos(2,22)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(2,24)
- monitor.write(" OFF ")
- --Row 2
- monitor.setBackgroundColor((colors.orange))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(12,2)
- monitor.write("MAGMA")
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(12,4)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(12,6)
- monitor.write(" OFF ")
- monitor.setCursorPos(12,8)
- monitor.setBackgroundColor((colors.orange))
- monitor.setTextColor((colors.black))
- monitor.write("SLIME")
- monitor.setCursorPos(12,10)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(12,12)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(12,14)
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.write("ANGRY")
- monitor.setCursorPos(12,16)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(12,18)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(12,20)
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.write("SKELE")
- monitor.setCursorPos(12,22)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(12,24)
- monitor.write(" OFF ")
- --Row 3
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(22,2)
- monitor.write("WITCH")
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(22,4)
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(22,6)
- monitor.write(" OFF ")
- monitor.setCursorPos(22,8)
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.write("ZOMBP")
- monitor.setCursorPos(22,10)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(22,12)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(22,14)
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.write("CREEP")
- monitor.setCursorPos(22,16)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setCursorPos(22,18)
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.write(" OFF ")
- monitor.setCursorPos(22,20)
- monitor.setBackgroundColor((colors.yellow))
- monitor.setTextColor((colors.black))
- monitor.write("ENDER")
- monitor.setCursorPos(22,22)
- monitor.setBackgroundColor((colors.lime))
- monitor.setTextColor((colors.black))
- monitor.write(" ON ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(22,24)
- monitor.write(" OFF ")
- monitor.setBackgroundColor((colors.red))
- monitor.setTextColor((colors.black))
- monitor.setCursorPos(11,26)
- monitor.write("ALL OFF")
- --Function to Run
- function checkClickPosition()
- --Cow
- if mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 4 then
- rednet.broadcast("CowBeginCycle")
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 6 then
- rednet.broadcast("CowEndCycle")
- --Sheep
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 10 then
- rednet.broadcast("WhiteSheepBeginCycle")
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 12 then
- rednet.broadcast("WhiteSheepEndCycle")
- --Pig
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 16 then
- rednet.broadcast("PigBeginCycle")
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 18 then
- rednet.broadcast("PigEndCycle")
- --Chicken
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 22 then
- rednet.broadcast("ChickenBeginCycle")
- elseif mouseWidth > 1 and mouseWidth < 8 and mouseHeight == 24 then
- rednet.broadcast("ChickenEndCycle")
- --MagmaCube
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 4 then
- rednet.broadcast("MagmaCubeBeginCycle")
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 6 then
- rednet.broadcast("MagmaCubeEndCycle")
- --SlimeThingy
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 10 then
- rednet.broadcast("SlimeBeginCycle")
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 12 then
- rednet.broadcast("SlimeEndCycle")
- --Angry Zombie
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 16 then
- rednet.broadcast("AngryZombieBeginCycle")
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 18 then
- rednet.broadcast("AngryZombieEndCycle")
- --Skeleton
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 22 then
- rednet.broadcast("RegSkeletonBeginCycle")
- elseif mouseWidth > 11 and mouseWidth < 18 and mouseHeight == 24 then
- rednet.broadcast("RegSkeletonEndCycle")
- --Witch
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 4 then
- rednet.broadcast("WitchBeginCycle")
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 6 then
- rednet.broadcast("WitchEndCycle")
- --ZombiePigmen
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 10 then
- rednet.broadcast("ZombiePigmenBeginCycle")
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 12 then
- rednet.broadcast("ZombiePigmenEndCycle")
- --Creeper
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 16 then
- rednet.broadcast("CreeperBeginCycle")
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 18 then
- rednet.broadcast("CreeperEndCycle")
- --Endermen
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 22 then
- rednet.broadcast("EndermenBeginCycle")
- elseif mouseWidth > 21 and mouseWidth < 28 and mouseHeight == 24 then
- rednet.broadcast("EndermenEndCycle")
- elseif mouseWidth > 10 and mouseWidth < 17 and mouseHeight == 26 then
- rednet.broadcast("EndermenEndCycle")
- rednet.broadcast("CreeperEndCycle")
- rednet.broadcast("ZombiePigmenEndCycle")
- rednet.broadcast("WitchEndCycle")
- rednet.broadcast("RegSkeletonEndCycle")
- rednet.broadcast("AngryZombieEndCycle")
- rednet.broadcast("SlimeEndCycle")
- rednet.broadcast("MagmaCubeEndCycle")
- rednet.broadcast("ChickenEndCycle")
- rednet.broadcast("WhiteSheepEndCycle")
- rednet.broadcast("PigEndCycle")
- rednet.broadcast("CowEndCycle")
- end
- end
- --The Work
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2
- mouseHeight = p3
- checkClickPosition()
- end
- until event=="char" and p1==("x")
- monitor.setBackgroundColor((colors.white))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement