Posted 13 October 2012 - 10:46 PM
Hi
I'm linking the sensorcontroller and sensors to my monitors. So faar I've had GREAT success (can post screenshots if wanted :)/>/> )
Allthough, my problem is I'm too new with Lua to understand how to filter out certain targetsentances.
In my case I've successfully targeted (in order off appearence) these things:
1. Sensorcontroller
2. Sensor (probe)
3. Sensortarget
4. Values from sensortarget
My problem comes in on 3, though on 2 as well but I can manage with only one probe. Problem is, the way I've targeted the target is to target the data spesifically by counting. Though as some of you may know, if I am to target, say, a quarry, the quarry will need to be powered by entities similar to the quarry itself, making the quarry move up or down the list of targets, making the program loose lock on the quarry block, and end up going haywire.
What I need is a way to filter out so data becomes only the targets I'm looking for, like filter all the quarries out of the targetlist and make this the list it goes for, so even if I put up another block, worst thing that can happen is that I make a quarry that will replace the first one on the list, making the program keep running. Understand?
Problem here is as soon as I place a block like a energy link or a cable, the script I made crashes and burns and I got to modify it with the changes made..
And this would create a DMZ (Demilitarized Zone) where I couldn't be able to build anything in risk of fucking up one or more parts of my code to the place it cannot be salvaged anymore..
Suggestions?
I'm linking the sensorcontroller and sensors to my monitors. So faar I've had GREAT success (can post screenshots if wanted :)/>/> )
Allthough, my problem is I'm too new with Lua to understand how to filter out certain targetsentances.
In my case I've successfully targeted (in order off appearence) these things:
1. Sensorcontroller
2. Sensor (probe)
3. Sensortarget
4. Values from sensortarget
My problem comes in on 3, though on 2 as well but I can manage with only one probe. Problem is, the way I've targeted the target is to target the data spesifically by counting. Though as some of you may know, if I am to target, say, a quarry, the quarry will need to be powered by entities similar to the quarry itself, making the quarry move up or down the list of targets, making the program loose lock on the quarry block, and end up going haywire.
What I need is a way to filter out so data becomes only the targets I'm looking for, like filter all the quarries out of the targetlist and make this the list it goes for, so even if I put up another block, worst thing that can happen is that I make a quarry that will replace the first one on the list, making the program keep running. Understand?
Problem here is as soon as I place a block like a energy link or a cable, the script I made crashes and burns and I got to modify it with the changes made..
And this would create a DMZ (Demilitarized Zone) where I couldn't be able to build anything in risk of fucking up one or more parts of my code to the place it cannot be salvaged anymore..
Suggestions?
targets = sensors.getAvailableTargetsforProbe(ctrl,mainSensor,QuarryProbe)
QuarryTarget = targets[4]
data = sensors.getSensorReadingAsDict(ctrl,mainSensor,QuarryTarget,QuarryProbe)