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

Realistic Wait With Wireless Peripheral

Started by ds84182, 14 April 2012 - 10:19 PM
ds84182 #1
Posted 15 April 2012 - 12:19 AM
The peripheral would wait, depending on the size of the data and how far it is from the destination.
Cloudy #2
Posted 15 April 2012 - 03:07 AM
Not going to happen. 64 blocks distance isn't that far away. If you really want to do this, you can implement it in Lua yourself. Create your own command which checks for the rednet_message like rednet.receive does, and depending on the result of the distance parameter, start a timer and then return the message when the timer event is found.

Of course it would be a LITTLE more complicated - you would want to store rednet events you receive in the mean time so you don't miss data, but if you want it that badly I'm sure you can work it out.
Wolvan #3
Posted 17 April 2012 - 08:11 AM
Is there a wy to get the distance of a received message?
Luanub #4
Posted 17 April 2012 - 12:17 PM
Is there a wy to get the distance of a received message?
You can pull it off the rednet message.


id, msg, distance = rednet.receive()

Check out the GPS program/API its in part how the host work.
Wolvan #5
Posted 17 April 2012 - 01:41 PM
So i need a gps! Thx for that info
Cloudy #6
Posted 17 April 2012 - 03:10 PM
No, you don't need a GPS. The distance is provided regardless - that is how the GPS works. See above for how to do it using a plain old rednet message.