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
- Host: GitHub
- URL: https://github.com/alancunningham/krpc-scripts
- Owner: AlanCunningham
- Created: 2020-08-06T20:01:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-10T17:59:26.000Z (2 months ago)
- Last Synced: 2025-03-27T02:21:16.780Z (27 days ago)
- Topics: kerbal-space-program, krpc, krpc-mod, krpc-scripts, python
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 orbitconnection = 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
```