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

[1.3] Redstone distance

Started by OmegaVest, 10 April 2012 - 06:23 PM
OmegaVest #1
Posted 10 April 2012 - 08:23 PM
To keep it short, I suggest adding a way to determine how far away from a redstone source, such as a repeater or torch, the computer is. Or, conversely, to set how far down a line of dust a signal would be sent.



I searched, and did not find this suggestion on the forums, but I may have missed it somewhere along the line.
And, some sample implementation would be


truefalse, pwrlevel = rs.getInput([i]side[/i])
or simply

pwrlevel=rs.getInput([i]side[/i])
.

Redpower cables would always have a maximum power reading, therefore a 0 distance or 16 power level, since they have no falloff.


Although I have no idea how useful this would be. For my part, I had an idea for a self-limiting program, which would read anything less than a redpower cable as a backup battery source, limiting what it can do whilst connected based on how much "power" was reaching the computer. And before anyone gets started on that, there are other uses that I can think of. Some of which are better than others.


And for the love of diamonds, please no "there's a mod for that". There is a reason MCF started banning people for that.







Editted with new information.
louisrocks40 #2
Posted 23 April 2012 - 11:27 PM
Hmm…I can not think of any way of implementing that, but would enjoy seeing other people's implementations. I'm sure Dan will eventually implement more; its only in 1.32 at the moment!
OmegaVest #3
Posted 24 April 2012 - 05:13 PM
Bump 'cause edit. Small change involving the reverse. Instead of just getting the distance/power level, the computer might be able to set said distance.

OH! And if it does, this might make a short-range version of rednet. Though it'd be the 24k to Wireless's 56k. Diamonds for those old enough to remember what those meant. (No diamonds if you extrapolate).