It is very simple to use a wire in your condition:
Code: Select all
"condition":{"type":"building","id":"$on"}
There's no need to worry about detecting frames. Checking for the ID will be enough.
Here's an example of its usage:
Code: Select all
[
{
"frames":[
{
"steal":"$res00"
}
],
"fun":[
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"x":1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"x":-1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"y":1
}
},
{
"actions":[
{
"type":"remove"
}
],
"condition":{
"id":"$on",
"type":"building",
"y":-1
}
}
],
"height":1,
"id":"wire_sensor.kt101",
"needsroad":false,
"power":0,
"price":0,
"text":"Wiresensor",
"title":"Wiresensor",
"type":"terrain",
"water":0,
"width":1
}
]
You can download the example file here: