Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- リモコン側プログラム
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- term.clear()
- print("Remote Contorol Button")
- print(" Order?")
- local win1 = window.create(term.current(), 4, 4, 19, 5, true)
- local win2 = window.create(term.current(), 4, 9, 19, 5, true)
- local win3 = window.create(term.current(), 1, 20, 26, 1, true)
- win1.setBackgroundColor(colors.blue)
- win1.clear()
- win1.setCursorPos(5,3)
- win1.write("Calling Turtles")
- win2.setBackgroundColor(colors.red)
- win2.clear()
- win2.setCursorPos(7,3)
- win2.write("Start building")
- win3.setBackgroundColor(colors.green)
- win3.clear()
- win3.setCursorPos(2, 1)
- win3.write("message...")
- rednet.open("back")
- while true do
- local event, b, x, y = os.pullEvent("mouse_click")
- win3.clear()
- win3.setCursorPos(1,1)
- win3.write(x)
- win3.write(",")
- win3.write(y)
- if (x >= 4 and x <= 22) and (y >= 4 and y <= 8) then
- win3.write(" PUSH: Call")
- -- rednet.broadcast("start_build")
- elseif (x >= 4 and x <= 22) and (y >= 9 and y <= 13) then
- win3.write(" PUSH: Build")
- break
- else
- -- do nothing
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement