Sound Movement icon Sound Movement — Stereo mic sound localization triggers left/right scripts to control robot movement, enabling directional responses (turn/move) to audio. Try it →
Asked — Edited
Resolved Resolved by Dunning-Kruger!

Can Someone Tell Me Whats Wrong With Script

Can someone look at this script and tell me what is missing? Ive tried several elseif, endif, combinations and can not make work? Thanks

:MonitorDistances $leftsensor = getadc(adc5) $topsensor = getadc(adc7) $rightsensor = getadc(adc6)

if ($leftsensor 60) ControlCommand("Script Manager ", ScriptStop, "forward_3_Seconds") ElseIf goto(MonitorDistances)


ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

#9  

one other piece of advice.


if(x-1=2)
#dosomething
endif
#dosomething

if you put this into the script, notice that there is a + sign next to the if statement. there is a line down to the end if there is a little line going right to the end if.

This lets you know which endif is going with which if. This will let you see that this is a complete block. if the line just keeps going, it isnt a complete block of code.

This will let you know that the endif is where you expect it to be.