This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
wilcomega's profile picture

Custom Range Limit on wireless modems

Started by wilcomega, 25 March 2014 - 02:46 PM
wilcomega #1
Posted 25 March 2014 - 03:46 PM
so it basicly goes like so:

modem = peripheral.wrap("right")
modem.setRange(5)
range = modem.getRange()

rednet.setRange(5, [side])
range = rednet.getRange([side])

what is this usefull for, only targetting close by computers, turtles and pockte computers( from the public beta )
it could be used for things like bluetooth. and of course you cant set it higher than the maximum range of that altitude.

for example, you are at a store and at the couter buying some food. when you are instucted to pay you just grab your pocket computer and hit confirm. the thing here is that the pocket computer id of the customer is unknown. so you cant just send an ID specific message.

this is already possible by looking at the distance argument from the event. but really, it isnt that hard to implement (i can know) and its just a nice little feature for the update

-wilco
Lyqyd #2
Posted 25 March 2014 - 05:10 PM
This doesn't really make sense, as only one of the two computers needs to be in range of the other for both to be able to communicate. Even if you limited the range on one, all computers that it was in range of would be able to talk to it, and vice-versa.
wilcomega #3
Posted 25 March 2014 - 05:36 PM
its not about being able to talk its about limiting who can talk, for example i only want the person standing next to the couter to pay instead of someone else across the world
Csstform #4
Posted 25 March 2014 - 05:52 PM
Just write a program for the server to send out a encrypted singal, which only the client will pay attention to. IRL, you would need an app on your phone anyways.
CometWolf #5
Posted 25 March 2014 - 06:26 PM
i only want the person standing next to the couter to pay instead of someone else across the world
this is already possible by looking at the distance argument from the event.
/thread
6677 #6
Posted 26 March 2014 - 04:12 PM
I'd use this feature if it was present…. Many real radio devices (including WiFi and bluetooth) feature reduced power transmission (user configurable in theory) for shorter ranges on purpose. Often used industrially.
awsmazinggenius #7
Posted 26 March 2014 - 10:02 PM
Yep, I'd use this too. If someone somehow hijacks the private key you were using to encrypt messages only going a short range, and obtains your symmetric key, they can watch you communicate from a long distance, whereas if this was implemented it would be a shorter and more secure transmission for doing something like tapping your pocket computer on a reader, like you can do in the store with certain credit cards.
Bomb Bloke #8
Posted 26 March 2014 - 10:52 PM
As Lyqyd points out, under the rules followed by ComputerCraft, this simply won't do anything. When determining whether two-way transmissions are possible between two systems, only the range of the system with the longest reach is actually checked.

Granted that way of doing things could be changed, but there are side effects - most builds that use relays would be outright broken, for eg.
Edited on 28 March 2014 - 10:42 PM