initialize
This commit is contained in:
commit
5b23ea99fd
43 changed files with 2336 additions and 0 deletions
12
apricot/scripts/receiver.lua
Normal file
12
apricot/scripts/receiver.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
local modem = peripheral.find("modem") or error("No modem attached", 0)
|
||||
local logger = require('logger').init()
|
||||
|
||||
for i = 1,125 do
|
||||
modem.open(i)
|
||||
end
|
||||
|
||||
local event, side, channel, replyChannel, message, distance
|
||||
while true do
|
||||
event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
|
||||
logger.info(channel .. " " .. replyChannel .. " " .. tostring(message) .. " " .. distance )
|
||||
end
|
6
apricot/scripts/sender.lua
Normal file
6
apricot/scripts/sender.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
local modem = peripheral.find("modem") or error("No modem attached", 0)
|
||||
|
||||
modem.transmit(15, 43, "Hello, world!")
|
||||
modem.transmit(25, 2, {message=1})
|
||||
modem.transmit(1, 1, "What if I put you in an infinite loop?")
|
Loading…
Add table
Add a link
Reference in a new issue