Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- einfacher Code für den Portal Control Computer mit Touchscreen
- -- hier mit meiner Testanordnung mit 3 Linking Books
- -- die "435" beim rednet.send ist die ID der angesprochenen Turtle und muss entsprechend auch angepasst werden
- term.clear()
- m = peripheral.wrap("top") --sollte durch entsprechendes startup nicht gebraucht werden
- m.setTextScale(1)
- rednet.open("right")
- term.setCursorPos(1,1)
- print("[X] Links")
- term.setCursorPos(1,2)
- print("[X] Mitte")
- term.setCursorPos(15,2)
- print("[X] Rechts")
- while true do
- event,side,x,y = os.pullEvent()
- if event == "monitor_touch" then
- if x >=1 and x <= 4 and y == 1 then
- term.setCursorPos(4,4)
- term.clearLine()
- rednet.send(435, "TestLinks")
- print("Links geklickt")
- sleep(2)
- elseif x >=1 and x <= 4 and y == 2 then
- term.setCursorPos(4,4)
- term.clearLine()
- rednet.send(435, "TestMitte")
- print("Mitte geklickt")
- sleep(2)
- elseif x >=15 and x <= 18 and y == 2 then
- term.setCursorPos(4,4)
- term.clearLine()
- rednet.send(435, "TestRechts")
- print("Rechts geklickt")
- sleep(2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement