Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("right")
- monitor.clear()
- monitor.setCursorPos(1,1)
- w,h=monitor.getSize()
- print(w)
- print(h)
- monitor.setBackgroundColour((colours.lime))
- --Draw Buttons
- monitor.setCursorPos(1,2)
- monitor.write(" Seeds ")
- monitor.setCursorPos(1,4)
- monitor.write(" Water ")
- monitor.setBackgroundColour((colours.black))
- function checkClickPosition()
- if mouseWidth > 0 and mouseWidth < 9 and mouseHeight == 2 then
- turtle.select(1)
- turtle.suckUp(1)
- turtle.drop(1)
- sleep(0.5)
- turtle.select(16)
- turtle.placeDown()
- turtle.drop()
- turtle.suck()
- elseif mouseWidth > 0 and mouseWidth < 9 and mouseHeight == 4 then
- turtle.select(16)
- turtle.placeDown()
- turtle.drop()
- turtle.suck()
- end
- end
- repeat
- event,p1,p2,p3 = os.pullEvent()
- if event=="monitor_touch" then
- mouseWidth = p2 -- sets mouseWidth
- mouseHeight = p3 -- and mouseHeight
- checkClickPosition() -- this runs our function
- end
- until event=="char" and p1==("x")
- --XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- --while true do
- --os.pullEvent("redstone") -- wait for a "redstone" event
- --if rs.getInput("right") then
- --turtle.placeDown()
- --turtle.drop()
- --turtle.suck()
- --end
- --sleep(2)
- --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement