Exemplo n.º 1
0
def launch():
    vessel = connect2vessel()
    if img_conn:
        img_path1 = screenshot()
        link1 = upload(img_conn, img_path1)
        print('Uploaded image to {}'.format(link1))       
    if twit_conn and img_conn:
        tweet(twit_conn, 'Vessel {vessel.name} is preparing for launch!\n{link}'.format(vessel=vessel, link=link1))
        print('Tweeted!')

    vessel.control.throttle = 1
    vessel.control.sas = True

    # Launch!
    vessel.control.activate_next_stage()
    vessel.auto_pilot.engage()
    turn(vessel, 0)
    time.sleep(30)
    turn(vessel, 5)
    vessel.control.activate_next_stage()
    vessel.control.activate_next_stage()
    if img_conn:
        img_path2 = screenshot()
        link2 = upload(img_conn, img_path2)
        print('Uploaded image to {}'.format(link2))
    if twit_conn and img_conn:
        tweet(twit_conn, 'Vessel {vessel.name} is staging!\n{link}'.format(vessel=vessel, link=link2))
        print('Tweeted!')

    # if the code exits, it'll just flip over at this point (no autopilot)
    turn(vessel, 20)
    while True:
        time.sleep(10)
Exemplo n.º 2
0
def shot_tweet(msg):
    if img_conn:
        img_path1 = screenshot()
        link1 = upload(img_conn, img_path1)
    if twit_conn and img_conn:
        tweet(twit_conn, msg + '\n' + link1)