Exemple #1
0
def fruitMachine(session):
    waitTime = 24
    key = "fruit"

    file = open(r'times.pkl', 'rb')
    times = pickle.load(file)
    file.close()

    timeExpiry = times.get(key)

    if timeExpiry == None or time.time() > timeExpiry:
        response = session.get(Constants.NEO_FRUIT, headers=Constants.HEADERS)

        #This one is tough you need to extract a hidden value from the source
        postFields = {"type": "get_jelly"}
        header = POST.getPostHeader(postFields, Constants.NEO_FRUIT)
        source = session.post(Constants.NEO_FRUIT,
                              postFields,
                              headers=Constants.HEADERS,
                              verify=False).text

        times[key] = timestamp.getTimestamp(waitTime)

        file = open(r'times.pkl', 'wb')
        pickle.dump(times, file)
        file.close()

    else:
        print("Already did fruit machine in last 24 hours")
Exemple #2
0
def stereoContainer(video1,
                    video2,
                    show_video=True):  #Takes in Capture object of two videos.
    while (video1.isOpened() and video2.isOpened()):
        _, frame1 = video1.read()
        _, frame2 = video2.read()

        gray1 = cv2.cvtColor(frame1, cv2.COLOR_BGR2GRAY)
        gray2 = cv2.cvtColor(frame2, cv2.COLOR_BGR2GRAY)

        print("left: {} \t\t\tright: {}".format(T.getTimestamp(gray1),
                                                T.getTimestamp(gray2)))

        if (show_video):
            s_left = cv2.resize(gray1, None, fx=FACTOR, fy=FACTOR)
            s_right = cv2.resize(gray2, None, fx=FACTOR, fy=FACTOR)

            stereo = np.concatenate((s_left, s_right), axis=1)

            cv2.imshow("Stereo", stereo)

            if cv2.waitKey(1) & 0xFF == ord('q'):
                video1.release(), video2.release()
                break
Exemple #3
0
def sticky(session):
    global times
    waitTime = 0.5
    key = "sticky"

    timeExpiry = times.get(key)

    if timeExpiry == None or time.time() > timeExpiry:
        response = web.get(session, Constants.NEO_STICKY,
                           Constants.NEO_SPRINGS)

        print("Got Sticky Snowball")

        times[key] = timestamp.getTimestamp(waitTime)

        file = open(r'times.pkl', 'wb')
        pickle.dump(times, file)
        file.close()
Exemple #4
0
def healingSprings(session):
    global times
    waitTime = 0.5
    key = "springs"

    timeExpiry = times.get(key)

    if timeExpiry == None or time.time() > timeExpiry:
        response = web.get(session, Constants.NEO_SPRINGS)
        postFields = {"type": "heal"}

        source = web.post(session, Constants.NEO_SPRINGS, postFields,
                          Constants.NEO_SPRINGS)

        print("Went to healing springs")

        times[key] = timestamp.getTimestamp(waitTime)

        file = open(r'times.pkl', 'wb')
        pickle.dump(times, file)
        file.close()
Exemple #5
0
def fishing(session):
    global times
    waitTime = 13
    key = "fishing"

    timeExpiry = times.get(key)

    if timeExpiry == None or time.time() > timeExpiry:
        response = web.get(session, Constants.NEO_FISHING)
        postFields = {"go_fish": "1"}

        source = web.post(session, Constants.NEO_FISHING, postFields,
                          Constants.NEO_FISHING)

        print("Went Fishing")

        times[key] = timestamp.getTimestamp(waitTime)

        file = open(r'times.pkl', 'wb')
        pickle.dump(times, file)
        file.close()
Exemple #6
0
def shrine(session):
    global times
    waitTime = 12
    key = "shrine"

    timeExpiry = times.get(key)

    if timeExpiry == None or time.time() > timeExpiry:
        response = web.get(session, Constants.NEO_SHRINE)

        #This one is tough you need to extract a hidden value from the source
        postFields = {"type": "approach"}
        source = web.post(session, Constants.NEO_SHRINE, postFields,
                          Constants.NEO_SHRINE)

        print("Went to shrine")

        times[key] = timestamp.getTimestamp(waitTime)

        file = open(r'times.pkl', 'wb')
        pickle.dump(times, file)
        file.close()