Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --2551 this pc
- print("running spawner")
- local Tid = 2618
- local mon = peripheral.wrap("monitor_19")
- rednet.open("top")
- function ui()
- mon.setCursorPos(1,1)
- mon.write("-------------------------------------------------------------")
- mon.setCursorPos(1,2)
- mon.write("I spawner I")
- for i = 3 ,18 do
- mon.setCursorPos(1,i)
- mon.write("I I")
- end
- mon.setCursorPos(1,19)
- mon.write("-------------------------------------------------------------")
- end
- function tr(clr)
- mon.setTextColor(colors.red)
- end
- function tw()
- mon.setTextColor(colors.white)
- end
- function tg()
- mon.setTextColor(colors.green)
- end
- function ol() -- load screen ui on start
- tr()
- mon.setCursorPos(5,7)
- mon.write("Penguin")
- mon.setCursorPos(16,7)
- mon.write("Enderman")
- mon.setCursorPos(28,7)
- mon.write("Blaze")
- tw()
- end
- local pen = 0
- local ender = 0
- local blaze = 0
- local MOB = "empty"
- function press() --when pressed
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 4 and x < 12 and y == 7 then --penguins
- if pen == 0 and MOB == "empty" then
- tg()
- pen = 1
- --do stuff
- MOB = "penguin"
- elseif pen == 1 and MOB == "penguin"then
- tr()
- pen = 0
- --do stuff
- MOB = "empty"
- end
- mon.setCursorPos(5,7)
- mon.write("Penguin")
- tw()
- rednet.send(Tid,MOB)
- elseif x > 15 and x < 24 and y == 7 then -- enderman
- if ender == 0 and MOB == "empty" then
- tg()
- ender = 1
- MOB = "enderman"
- elseif ender == 1 and MOB == "enderman" then
- tr()
- ender = 0
- MOB = "empty"
- end
- mon.setCursorPos(16,7)
- mon.write("Enderman")
- tw()
- rednet.send(Tid,MOB)
- elseif x > 27 and x < 33 and y == 7 then --blaze
- if blaze == 0 and MOB == "empty" then
- tg()
- blaze = 1
- MOB = "blaze"
- elseif blaze == 1 and MOB == "blaze" then
- tr()
- blaze = 0
- MOB = "empty"
- end
- mon.setCursorPos(28,7)
- mon.write("Blaze")
- tw()
- rednet.send(Tid,MOB)
- else
- end
- --print(Tid .. MOB..ender)
- end
- mon.clear()
- mon.setCursorPos(1,1)
- ui()
- ol()
- while true do
- press()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement