0
Wireless Distance
Started by LitCactus, Mar 05 2012 02:13 AM
11 replies to this topic
#1
Posted 05 March 2012 - 02:13 AM
How do distances and computers work? If you are at a computer at x0 z0, and your buddy is at a computer at x2000 z2000, could you send him a message wirelessly? I am confused about wireless connections in general with ComputerCraft...
#2
Posted 05 March 2012 - 03:18 AM
Modems have a range(sphere shaped) of 64 blocks in any direction(17 in thunderstorms). If you want to send something that far away use http api, or build a some wireless repeaters.
#3
Posted 06 March 2012 - 01:13 PM
You can build a simple wireless repeater like so:
Build a computer with a wireless modem, start it running in a loop that waits for a rednet message. Then simply rebroadcast the message.
I'm not on my home PC at the moment so i can't confirm that this code will work but try this:
Its very crude, it uses broadcasting so anyone else can recieve the data aswell (so not very private) and it may be prone to echoing messages around the other wireless repeaters (not actually tested, I don't use this method myself, I have a much more complex system in place that is more secure).
The only major issue is that you are so far away from him. The chunks inbetween you 2 won't be loaded all the time. This means that any wireless repeaters won't be active so messages won't be recieved. The http api is the only reliable method for straight PC to PC connections at this range, although I don't know how to work it. Alternatively you could manually deliver messages to him on floppy disks.
Build a computer with a wireless modem, start it running in a loop that waits for a rednet message. Then simply rebroadcast the message.
I'm not on my home PC at the moment so i can't confirm that this code will work but try this:
rednet.open("back") running = true while running = true do event, sender, message = os.pullEvent() if event = "rednet_message" then rednet.broadcast(message) end end
Its very crude, it uses broadcasting so anyone else can recieve the data aswell (so not very private) and it may be prone to echoing messages around the other wireless repeaters (not actually tested, I don't use this method myself, I have a much more complex system in place that is more secure).
The only major issue is that you are so far away from him. The chunks inbetween you 2 won't be loaded all the time. This means that any wireless repeaters won't be active so messages won't be recieved. The http api is the only reliable method for straight PC to PC connections at this range, although I don't know how to work it. Alternatively you could manually deliver messages to him on floppy disks.
#4
Posted 06 March 2012 - 03:42 PM
If your on a SMP Server and worried about performance having repeaters every 16 blocks you can also try to edit the class files like we had done. We run at 8096 now and it works great. If you want more info on how to do this I will make up instructions.
#5
Posted 06 March 2012 - 06:43 PM
And 1.31 should hopefully have a config for this as well.
#6
Posted 06 March 2012 - 09:24 PM
6677, on 06 March 2012 - 01:13 PM, said:
You can build a simple wireless repeater like so:
CUT
CUT
rednet.open("back") running = true while running = true do event, sender, message = os.pullEvent() if event = "rednet_message" then rednet.broadcast(message) end endCUT
wouldn't that cause 2 repeaters to loop the message between themselves forever and ever?
#7
Posted 06 March 2012 - 09:34 PM
while true do
event, sender, message = os.pullEvent()
if event = "rednet_message" then
turtle.forward()
rednet.broadcast(message)
turtle.back()
end
end
This should work better if you use a turtle and place it at an edge of the range facing outward. I may do something more sophisticated later on.
event, sender, message = os.pullEvent()
if event = "rednet_message" then
turtle.forward()
rednet.broadcast(message)
turtle.back()
end
end
This should work better if you use a turtle and place it at an edge of the range facing outward. I may do something more sophisticated later on.
#8
Posted 06 March 2012 - 10:03 PM
http://www.computerc...ndpost__p__3175
With the Skynet Api the repeaters won't repeat infinitely even if you didn't place it on the edge, as long as they are in range of eachother. So you can build long lines of repeaters and use the api to connect computers that are far away from eachother easily.
With the Skynet Api the repeaters won't repeat infinitely even if you didn't place it on the edge, as long as they are in range of eachother. So you can build long lines of repeaters and use the api to connect computers that are far away from eachother easily.
#9
Posted 07 March 2012 - 09:40 AM
Bard, on 06 March 2012 - 09:24 PM, said:
Spoiler
wouldn't that cause 2 repeaters to loop the message between themselves forever and ever?perhaps if it slept for 0.2 seconds (or maybe 0.1) at the beggining of the loop, it will reduce the bandwidth considerably though (might not be an issue for some users). That would drastically increase the time for a message to be sent at the distance mentioned though.
Skynet looks to be the best solution using modems though. (until the range can be boosted anyhow)
#10
Posted 25 July 2012 - 03:31 PM
Kane Hart, on 06 March 2012 - 03:42 PM, said:
If your on a SMP Server and worried about performance having repeaters every 16 blocks you can also try to edit the class files like we had done. We run at 8096 now and it works great. If you want more info on how to do this I will make up instructions.
#11
Posted 25 July 2012 - 03:41 PM
sorker3, on 25 July 2012 - 03:31 PM, said:
Kane Hart, on 06 March 2012 - 03:42 PM, said:
If your on a SMP Server and worried about performance having repeaters every 16 blocks you can also try to edit the class files like we had done. We run at 8096 now and it works great. If you want more info on how to do this I will make up instructions.
File Name : mod_ComputerCraft.cfg
content :
#diskItemID (int:4000)
#enableAPI_http (int:0)
#terminal_width (int:50)
#terminal_height (int:18)
#terminal_textColour_r (int:255)
#terminal_textColour_g (int:255)
#terminal_textColour_b (int:255)
#modem_range (int:64)
#modem_rangeDuringStorm (int:16)
#
#Wed Jul 25 15:53:22 GMT+08:00 2012
terminal_width=50
terminal_textColour_g=255
modem_rangeDuringStorm=16
computerBlockID=207
diskItemID=4000
diskDriveBlockID=208
enableAPI_http=1
terminal_textColour_b=255
checksum=440
terminal_textColour_r=255
modem_range=64
terminal_height=18
Change that to what distance you would like
#12
Posted 25 July 2012 - 04:44 PM
Yeah thannx alot />, I did't know it was that easy .... />
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users