60 posts
Location
The Nethelands
Posted 26 November 2012 - 06:31 AM
This is my rednetrepeater.
Sorry for my bad english.
If you want to send a message to a specific id use this.
Spoiler
term.clear()
term.setCursorPos(1,1)
local function connect()
for _,s in ipairs(rs.getSides()) do
if peripheral.isPresent(s) and peripheral.getType(s) == "modem" then
rednet.open(s)
return true
end
end
term.clear()
print("ERROR")
print("No modem found")
print("Aborting")
sleep(3)
os.shutdown()
return false
end
connect()
i = 0
while true do
term.clear()
term.setCursorPos(1,1)
print (i.." messages passed")
senderId, message, distance = rednet.receive()
rednet.send(21,""..message)
i = i+1
end
edit line 25 to
rednet.send(your id,""..message)
If you want to broadcast a message use this
Spoiler
term.clear()
term.setCursorPos(1,1)
local function connect()
for _,s in ipairs(rs.getSides()) do
if peripheral.isPresent(s) and peripheral.getType(s) == "modem" then
rednet.open(s)
return true
end
end
term.clear()
print("ERROR")
print("No modem found")
print("Aborting")
sleep(3)
os.shutdown()
return false
end
connect()
i = 0
while true do
term.clear()
term.setCursorPos(1,1)
print (i.." messages passed")
senderId, message, distance = rednet.receive()
rednet.broadcast(""..message)
i = i+1
end
1619 posts
Posted 26 November 2012 - 07:32 AM
Use code tags and proper formatting.
EDIT: Thanks. Pretty neat!
1243 posts
Location
Indiana, United States
Posted 26 November 2012 - 03:50 PM
Nope
Be quiet, small child.
On topic: Good first release, OP. Well done.
222 posts
Location
Canada
Posted 26 November 2012 - 05:47 PM
Nope
Be quiet, small child. On topic: Good first release, OP. Well done.
LOL
On Topic:
Good first program (Or Post)
My first was a very crappy PC lock i had made on Immibis' server. Your pretty good for starting.
2005 posts
Posted 26 November 2012 - 06:39 PM
hehe, mine was a super-simple bonemeal wheat farmer. I still use it when I want wheat from bonemeal. I think that someone eventually commented on that post about it needing a chest, but I couldn't see the point. I mean, I'm the only part of the setup that eats bread, and just how much bread am I going to need?
60 posts
Location
The Nethelands
Posted 27 November 2012 - 06:46 AM
2217 posts
Location
3232235883
Posted 27 November 2012 - 06:53 AM
i dont even remember my first computer was used for :s
probably a stupid door lock
60 posts
Location
The Nethelands
Posted 27 November 2012 - 08:25 AM
My first computer is for roaming profile