-
Notifications
You must be signed in to change notification settings - Fork 0
/
kombat-lt.py
executable file
·39 lines (29 loc) · 929 Bytes
/
kombat-lt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python3
import sys
from clipboard import Clipboard
from handset.kstars import KStars as Handset
from virtualoperator import Operator
import time
config = {}
def my_input(label: str, default: float):
r = input(f"{label} (default: {default})")
if r == '':
r = default
return r
config['desired_dt'] = int(my_input("Desired guiding precision in pixels", 10))
config['press_delay'] = float(my_input("Wait time in seconds after pressing button", 2))
clipboard = Clipboard()
handset = Handset()
if handset.is_valid():
print(f"{handset.name} has been found.")
else:
print("Handset not found...")
sys.exit(1)
operator = Operator(handset, clipboard.as_grayscale(), config)
dt = config['desired_dt']+1
while True:
while dt>config['desired_dt']:
dt = operator.guide_once()
print("\rdelta={:.1f} ".format(dt), end='')
time.sleep(3)
dt = config['desired_dt']+1