An open API service indexing awesome lists of open source software.

https://github.com/alancunningham/krpc-scripts

Scripts for the kRPC mod for Kerbal Space Program
https://github.com/alancunningham/krpc-scripts

kerbal-space-program krpc krpc-mod krpc-scripts python

Last synced: 10 days ago
JSON representation

Scripts for the kRPC mod for Kerbal Space Program

Awesome Lists containing this project

README

        

# kRPC Scripts for Kerbal Space Program

Scripts for the [kRPC mod](https://krpc.github.io/krpc/).

# Installation
- Follow the ["Getting started" guide for kRPC](https://krpc.github.io/krpc/getting-started.html)
```
# Clone the repository
git clone [email protected]:AlanCunningham/krpc-scripts.git

# Create a python virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate

# Install the python dependencies using the requirements.txt file provided
pip install -r requirements.txt
```

# Running the scripts
Running the orbit.py script directly will launch your rocket into orbit.
```
(venv) $ python orbit.py
```

You can also import orbit.py and set the direction of the orbit and target altitude in meters:
```
import krpc
import orbit

connection = krpc.connect(address=ip_address)
vessel = connection.space_center.active_vessel
orbit.launch(connection, vessel, orbit.HEADING_EAST, 80000)
```

Running the mun.py script will maneuver a rocket already in Kerbin-orbit to an orbit around the Mun:
```
(venv) $ python mun.py
```