Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.sleep(1)
- local mon = peripheral.wrap("top")
- mon.clear()
- rednet.open("back")
- mon.setTextColor(colors.purple)
- mon.setCursorPos(3,1)
- mon.write("***TERMINAL***")
- mon.setCursorPos(1,12)
- mon.write("Dotykova obrazovka")
- mon.setTextColor(colors.red)
- ----------------------------------------------------------------------------
- zmacknuto=false
- text="fermenter"
- mon.setCursorPos(5,3)
- mon.write(text)
- function klik(kx,ky)
- if ky==3 and ( kx > 4 and kx < 15) or zmacknut==true then
- print("zmena fermenter")
- zmacknuto = not zmacknuto
- if zmacknuto == true or zmacknut==true then
- mon.setTextColor(colors.lime)
- rednet.send(244, "turtle1on")
- else
- mon.setTextColor(colors.red)
- rednet.send(244, "turtle1off")
- end
- mon.setCursorPos(5,3)
- mon.write(text)
- end
- end
- ----------------------------------------
- zmacknuto1=false
- text1="farma na drevo"
- mon.setCursorPos(3,4)
- mon.write(text1)
- function klik1(kx,ky)
- if ky==4 and ( kx > 2 and kx < 16) then
- print("zmena farma")
- zmacknuto1 = not zmacknuto1
- if zmacknuto1 == true then
- mon.setTextColor(colors.lime)
- rednet.send(203, "turtle2on")
- else
- mon.setTextColor(colors.red)
- rednet.send(203, "turtle2off")
- end
- mon.setCursorPos(3,4)
- mon.write(text1)
- end
- end
- ----------------------------------------
- zmacknuto2=false
- text2="vyroba ethanolu"
- mon.setTextColor(colors.red)
- mon.setCursorPos(3,5)
- mon.write(text2)
- function klik2(kx,ky)
- if ky==5 and ( kx > 2 and kx < 16) then
- print("zmena ethanol")
- zmacknuto2 = not zmacknuto2
- if zmacknuto2 == true then
- mon.setTextColor(colors.lime)
- zmacknut=true
- rednet.send(203, "turtle3on")
- mon.setCursorPos(2,11)
- mon.setTextColor(colors.red)
- mon.write("vynucen fermenter")
- mon.setTextColor(colors.lime)
- else
- mon.setCursorPos(1,11)
- mon.clearLine()
- mon.setTextColor(colors.red)
- rednet.send(203, "turtle3off")
- zmacknut=false
- end
- mon.setCursorPos(3,5)
- mon.write(text2)
- end
- end
- ----------------------------------------
- while true do
- mon.setBackgroundColor(colors.black)
- local e,s,x,y = os.pullEvent("monitor_touch")
- klik1(x,y)
- klik2(x,y)
- klik(x,y)
- print(x..":"..y)
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement