Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Test script for working with rednet
- -- wriiten by craftersanonmoose
- -- want to try sending messages from one computer to another and then display those messages
- -- using button to send a predefined message
- ----------------------------------
- os.loadAPI("button")
- mon = peripheral.find("monitor")
- --wmod = peripheral.wrap("right")
- mon.clear()
- rednet.open("right")
- function fillTable()
- button.setTable("Send", sendMessage, 10,20,3,5)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function sendMessage()
- rednet.send(10, "Hello from another computer!")
- mon.setCursorPos(12,7)
- mon.write("Message Sent")
- end
- fillTable()
- button.heading("Instant Messanger")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement