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

Where to start with OpenPeripheral's Sensors

Started by hdt80bro, 23 February 2015 - 05:06 AM
hdt80bro #1
Posted 23 February 2015 - 06:06 AM
I recently got back into ComputerCraft, and rediscovered my favorite add-on, OpenPeripheral's sensors. However, since I last used it, about a year ago, it seems like a lot has changed. All of the information I can find is outdated, and I can't find any documentation. I was trying to make a really simple program that found all the nearby players, and printed their info, but I can't even seem to do that. This is the closest I've gotten.


s = peripheral.wrap("right")
for k, v in pairs(s.getPlayers()) do
	print(k .. " " .. v)
end

And that gives me the not so helpful output


1 table: 69573933

And even then, that number at the end changed ever time and I have no clue what that number is.
I'm very frustrated at this point, and would like a bit of help. A working program you've made, some update to date tutorial or wiki page, anything that tells points me in the right direction would very much appreciated.
Bomb Bloke #2
Posted 23 February 2015 - 06:11 AM
There's a documentation script, but since its own existence isn't very well documented… heh.

Run:

openp/docs <side>

This'll give you the functions. Then run:

openp/docs <side> <function>

This'll usually give you a decent idea how to call them.
hdt80bro #3
Posted 23 February 2015 - 06:17 AM
Oh my god, that's exactly what I'm looking for, thank you very much <3

One more thing, it seems like if I use that command on a peripheral with a lot of methods, like a Terminal Glass Bridge, the text goes off the screen. Is there a way to scroll up in a terminal?
Bomb Bloke #4
Posted 23 February 2015 - 07:14 AM
No, sorry. I suppose you could build a large monitor above your computer, then run:

monitor top openp/docs <etc>