Where are my script files

I really hate to ask this simple question but where are my script files? I set SCR_Enable to 1 in config,so when I click on MAVFtp I see a “logs, scripts, and terrain” directories. I thought I have read that when SCR_ENABLE is set to1, the script directory is created and so it has. So I go to Documents>Mission Planner and I see " logs, scripts, stil". So I put a script in the script directory and of course it does not show up under MAVFtp. What is going on??

The documentation says the script directory is in the same directory that mission planner starts from. There is a script directory that has a bunch of ***.py fifles but no lua files??

The short answer is that they are wherever you put them. Lua scripts don’t just appear. You specifically load the script(s) you want to run onto the autopilot.

In the case of actual hardware, it’s probably easiest to use MAVFTP to upload a script (which is a text file with a .lua extension) into the APM/scripts directory per the wiki instructions. Once uploaded, the script file lives on the SD card on the autopilot (not on your GCS computer).

You can do exactly the same within SITL, but it’s often easier to access the directory directly within your file manager. In Windows, a SITL instance can be found in the Mission Planner sitl folder. Each vehicle type that you’ve used will have a subfolder there. The default Copter instance will be inside the + folder. To load a Lua script to it, you would save it to Mission Planner\sitl\+\scripts. To be as clear as possible, this paragraph referencing SITL is specific to simulation inside Mission Planner, so if you are connecting to a vehicle over a telemetry link or USB, this entire paragraph does not apply.

1 Like