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

CC Sensor in jail

Started by dexter9, 19 January 2013 - 11:47 PM
dexter9 #1
Posted 20 January 2013 - 12:47 AM
Hi In my tekkit server i have built a jail. In each jail there is a chest. What i wish to do is to have a sensor controller and when the player joins the server and lands in the jail, the sensor controller would detect it and send out a redstone signal.
Each Jail dimensions are 5*5.
Once the signal would be sent a filter would send out food.
Thanks in advance
remiX #2
Posted 20 January 2013 - 12:49 AM
You would have to have the computer for updates from the sensor for when a player joins. And then it fires, send a redstone signal.

I've never used the player sensor card, there is one right?
dexter9 #3
Posted 20 January 2013 - 12:54 AM
Yes a proximity sensor i think. I can get it to detect my co-ordinates but nothing more
remiX #4
Posted 20 January 2013 - 12:59 AM
Well, store the co-ordinates that you will be if you were to be in the jail with the max X and min X etc like:

one corner - 2x, adjacent corner - 10x

etc.. I don't know how to explain that part and then when the 'proximity' sensor sends the co-ords check if the co-ords are between the co-ords within the jail, if it is then do the code
dexter9 #5
Posted 20 January 2013 - 01:01 AM
I understand what you mean but im near useless with LUA coding. Could you explain a bit more
theoriginalbit #6
Posted 20 January 2013 - 01:07 AM
Here is a program I wrote for another kind of sensor. Some things will obviously need changing but it should help point you in the right direction. http://pastebin.com/asSLPyqZ

Sorry I can't help more and/or explain more, but I'm on my phone. I'll try to explain more when I get back to my computer…
dexter9 #7
Posted 20 January 2013 - 01:19 AM
Thanks for all your help
Mikeemoo #8
Posted 20 January 2013 - 01:20 AM
On a tekkit server you'll really struggle to get CCSensors working properly and reliably. I'd really recommend just trying to get the information you need with a very very small setup first before planning anything bigger.
dexter9 #9
Posted 20 January 2013 - 01:21 AM
Yes when you get home could please explain what needs changed, thanks so much by the way!
theoriginalbit #10
Posted 20 January 2013 - 01:21 AM
On a tekkit server you'll really struggle to get CCSensors working properly and reliably. I'd really recommend just trying to get the information you need with a very very small setup first before planning anything bigger.
I've found it quite easy and no big problems… What problems are you having getting it working?
theoriginalbit #11
Posted 20 January 2013 - 01:21 AM
-snip-

Oops damn phone!
theoriginalbit #12
Posted 20 January 2013 - 04:00 AM
Yes when you get home could please explain what needs changed, thanks so much by the way!
Sorry this is taking so long… remiX and I are making up a text tutorial for these forums… we will give you a link to the post when its up :)/>
remiX #13
Posted 20 January 2013 - 04:23 AM
When TheOriginalBit posts the Tutorial, there is a sample code for Proximity which seems to not show the readings of a selected target now and then, other times it will… Don't know why though.
theoriginalbit #14
Posted 20 January 2013 - 04:34 AM
Here you go… :)/>

http://www.computercraft.info/forums2/index.php?/topic/9490-how-to-use-ccsensors/
dexter9 #15
Posted 20 January 2013 - 11:17 AM
Hi thanks. I tried using your program today and it said too many emc things around or something like that what does this mean and how do i fix this
theoriginalbit #16
Posted 20 January 2013 - 11:25 AM
Hi thanks. I tried using your program today and it said too many emc things around or something like that what does this mean and how do i fix this
The program that I wrote was intended for displaying the power levels of BatteryBoxes, MFE's and MFSU's on a computer monitor. However there is only a limited amount that can be displayed on a monitor so when this is the case, I programmed the computer to tell you there are too many to display so that your not like "HEY its not showing them all!"
The ways to fix this are:
  1. Add more height to the monitor thats attached to the computer
  2. Reduce the amount of power storage units the sensor can see by spreading them out
However since you were wanting to detect players I suggest that you read through the tutorial that remiX and I made… ( link in the last reply by me )…