Importing python module to mission planner script?

Hello, I am trying to learn scripting. I would like to use the command as seen in examples: script.sendRC(1,1000,True). However, mission planner does not recognize ‘script’. Do I need to import something at the beginning of my script such as a library. The examples I have seen do not import anything, by mission planner seems to recognize it. Also, I would like to use ‘pygame’ to build a user-interface, but mission planner does not recognize that either. Is there a way to import these modules?

Try creating a standalone app using pymavlink rather than tying yourself to Mission Planner…as I mentioned in a previous reply on the same topic.

The root cause of your problem is that the Script object is case sensitive (as is everything in Python).

Here is a Mission Planner compatible script that creates a UI and sends RC commands:

Hello Yuri, since you last helped me I have been attempting to create a standalone application.
This is the script I am running to connect to a drone with px4 autopilot with a USB cable in com4.

from dronekit import connect

vehicle = connect(‘com4’, wait_ready=True)
print(“connection command run”)

This is the error it continually throws:

Traceback (most recent call last):
File “C:/Users/ethan/project/DroneKit Test.py”, line 6, in
vehicle = connect(‘com4’, wait_ready=True)
File “C:\Python27\lib\site-packages\dronekit_init_.py”, line 3159, in connect
handler = MAVConnection(ip, baud=baud, source_system=source_system, source_component=source_component, use_native=use_native)
File “C:\Python27\lib\site-packages\dronekit\mavlink.py”, line 130, in init
self.master = mavutil.mavlink_connection(ip, baud=baud, source_system=source_system, source_component=source_component)
File “C:\Python27\lib\site-packages\pymavlink\mavutil.py”, line 1777, in mavlink_connection
force_connected=force_connected)
File “C:\Python27\lib\site-packages\pymavlink\mavutil.py”, line 935, in init
import serial
ImportError: No module named serial

I would really appreciate your help with this. I have been stuck at trying to connect to my drone for over a month.

pip install pyserial