class: name:FlagDef longname:Flag detection neuron description:Outputs signal strength prefinputs:0 prefoutput:1 icon:~ 40,3,3,25,0,25,100,75,50,25,0,1,75,50,100,50,11,30,50,38,50,40,48,42,52,44,47,46,48,48,57,50,42,52,52,54,47,57,50,65,50~ code:~ function init(){ // Neuro.signals.add("Flag"); // Neuro.signals[0].flavor = NeuroProperties.team; // Neuro.signals[0].power = 0; } function go() { //Check own flag if (Neuro.signals.receiveFilter("Flag", 2000, NeuroProperties.my + 100, 0.5) > 0) Neuro.state = Neuro.signals.receiveFilter("Flag", 2000, NeuroProperties.my + 100, 0.5); //Check opponent flag //If flag is taken -> go to own flag else if (Neuro.signals.receiveFilter("Flag", 2000, NeuroProperties.opp + 100, 0.5) > 0) Neuro.state = Neuro.signals.receiveFilter("Flag", 2000, NeuroProperties.my, 0.5); //else -> go to opponent flag else Neuro.state = Neuro.signals.receiveFilter("Flag", 2000, NeuroProperties.opp, 0.5); } ~ property: id:opp name:Opponent team number type:d property: id:my name:My team number type:d