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

[Question/Help Request] ccSensor Alarm System

Started by Manusmalus, 20 September 2012 - 09:25 AM
Manusmalus #1
Posted 20 September 2012 - 11:25 AM
Hello everybody,
I am new to Computercraft and therefore also new to the forum and i could really use some help. Not really surprising i guess.
I am using the current Version of Tekkit and I am playing on a MP-Server. I am trying to create an Alarm System that monitors multiple Sensors and sends out an Redstonesignal if a Player comes close. It would be great if the System would ignore me but i am really not a great Programmer and I am quite far from getting that to work.
Atm I am using Proximity Sensors and this script:

[code]
while true do
for i,val in ipairs(sensors.getAvailableTargetsforProbe("right","Sensor1","Sensor2","LivingEntities")) do
what,x,y,z=string.match(val,"([a-z]+),(-?[0-9]+),(-?[0-9]+),(-?[0-9]+)")
x,y,z=tonumber(x),tonumber(y),tonumber(z)
if (what=="ahv") then
redstone.setOutput("back",true)
os.sleep(8000)
end end
redstone.setOutput("back",false)
os.sleep(.2)
end
[code]

I modified a script from a youtube tutorial ([media]http://www.youtube.com/watch?v=vRUST6dGFqw&list=PL225CE5C9D5BAA8CD&index=1&feature=plpp_video[/media]). I am not really sure if the command is able to use multiple Sensors so i alaready tried using just one of the two example Sensors. (I am looking toward around 5 Sensors i would need).
Help would be really awesome because i tried to get this to work for two nights now and i am not getting any results…. HELP!! :)/>/>
KaoS #2
Posted 20 September 2012 - 11:40 AM
take a look at this thread