Jump to content




Openperipherals sensor peripheral


  • You cannot reply to this topic
4 replies to this topic

#1 flaghacker

  • Members
  • 655 posts

Posted 21 February 2014 - 03:30 PM

I'm trying to make some kind of a door system using the drawbridges from the mod tConstruct. I want to use the sensor from openperipherals to detect if a player is nearby. I can't get the pripheral to work.

This is my tets build:
https://www.dropbox....21_21.39.47.png
This is what I do:
https://www.dropbox....21_21.43.18.png

As you can see it doens't work! Can you guys hepl me?

#2 CometWolf

  • Members
  • 1,283 posts

Posted 21 February 2014 - 05:20 PM

If that really si an openP sensor, and not an OCS sensor (about 90% seem to make that mistake), then the correct function would be
sensor.getPlayerNames()


#3 flaghacker

  • Members
  • 655 posts

Posted 22 February 2014 - 03:58 AM

Thanks, I found the function getTargets() somewhere on the internet... It is indeed the sensor from openperipherals. And how do you get the distance?

EDIT: I tested your function and it still doens't work...
https://www.dropbox....22_11.31.46.png
(The sensor is at the right side)

Edited by flaghacker, 22 February 2014 - 05:25 AM.


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 February 2014 - 05:28 AM

If the peripheral is placed on the computer's left side, then you need to use peripheral.wrap("right"), and vice versa. Note that the opposite is true for turtles.

#5 plazter

  • Members
  • 134 posts

Posted 24 February 2014 - 03:16 PM

Try the following:
for i,v in pairs(sensor.getPlayerNames()) do
     print(i, ". ", v)
end
Hope it works :) i'm having troubles with makeing a door with it xD





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users