Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mouseWidth = 0
- mouseHeight = 0
- -- change the ("top") to ("[the side where the monitor is]")
- monitor = peripheral.wrap("top")
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setBackgroundColour((colours.lime))
- -- first add monitor.setCursorPos(1,[number 2 higer than the last one])
- -- then add monitor.write("[text 7 long]")
- monitor.setCursorPos(1,1)
- monitor.write(" blaze ")
- monitor.setCursorPos(1,3)
- monitor.write(" ender ")
- monitor.setCursorPos(1,5)
- monitor.write(" uit ")
- monitor.setBackgroundColour((colours.black))
- -- first add if mouseWidth > 0 and mouseWidth < 12 and mouseHeight == [same nuber as above (second number)] then
- -- rs.setOutput("[side]",true)
- -- end
- -- then add to the one with the mouseHeight of 5 rs.setOutput("[side you used]",false)
- function checkClickPosition()
- if mouseWidth > 0 and mouseWidth < 12 and mouseHeight == 1 then
- rs.setOutput("left",true)
- end
- if mouseWidth > 0 and mouseWidth < 12 and mouseHeight == 3 then
- rs.setOutput("back",true)
- end
- if mouseWidth > 0 and mouseWidth < 12 and mouseHeight == 5 then
- rs.setOutput("left",false)
- rs.setOutput("back",false)
- end
- end
- -- nothing to add/change here
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2
- mouseHeight = p3
- checkClickPosition()
- end
- until event=="char"and p1==("x")
Advertisement
Add Comment
Please, Sign In to add comment