Beispiel #1
0
def loop(scenario, iterations, debug, simulate):
    MainWindow = None
    results = []

    if (simulate is True):
        MainWindow = Window()

    for i in range(1, iterations + 1):
        result = setupNew(scenario, MainWindow, debug)
        bisect.insort_left(results, result)
        print('Iteration ', i, ' Time:\t', result)

        if (simulate is True):
            MainWindow.MainLoop()

    print('-------------------')
    print('Performed', iterations, 'iterations of scenario', scenario)
    print('Average time:\t', sum(results) / iterations)
    print('Worst time:\t', results[-1])
    print('-------------------')
Beispiel #2
0
        u.buy()
        #        print("Buy!")

        tracker.adjustxp()


#    print("Going into Sleep till 30 mins up?")
#    print(str(f.rt_to_seconds()) + " < end")

    if rt > end:
        f.do_rebirth()
        time.sleep(1)
        rt = f.rt_to_seconds()
    return

w = Window()
i = Inputs()
nav = Navigation()
feature = Features()
#ngui = NGUI(nav)

Window.x, Window.y = i.pixel_search(coords.TOP_LEFT_COLOR, 0, 0, 400, 600)
nav.menu("inventory")

u = UpgradeEM(37500, 37500, 1, 1, 3)
r3unlocked = False

print(f"Top left found at: {w.x}, {w.y}")

tracker = Tracker(30)
Beispiel #3
0
from classes.window import Window
import classes.shapes2D as shapes2D

if __name__ == '__main__':
    window = Window(1300, 768, 'House 2D simulation')

    window.addElement(shapes2D.Roof1, [-1, 0.8, 1])
    window.addElement(shapes2D.Roof2, [0, 0.8, 1])
    window.addElement(shapes2D.Wall1, [-1, -0.2, 1])
    window.addElement(shapes2D.Wall2, [0, -0.2, 1])
    window.addElement(shapes2D.Door, [-1.2, -0.2, 1.01])
    window.addElement(shapes2D.DoorHandle, [-1.3, -0.35, 1.011])
    window.addElement(shapes2D.Path, [-1.2, -0.9, 1.011])
    window.addElement(shapes2D.WindowObj, [-0.1, -0.2, 1.01])
    window.addElement(shapes2D.WindowObj, [1.3, -0.2, 1.01])

    window.addElement(shapes2D.Garden, [-1.2, -0.3, 1.0])

    # Stars
    window.addElement(shapes2D.Star, [1, 2, -3])
    window.addElement(shapes2D.Star, [2, 2, -4])
    window.addElement(shapes2D.Star, [3, 2, -3])
    window.addElement(shapes2D.Star, [3.1, 2, -4])
    window.addElement(shapes2D.Star, [-1, 2.2, -5])
    window.addElement(shapes2D.Star, [-3, 2, -3])
    window.addElement(shapes2D.Star, [-4, 2, -4])
    window.addElement(shapes2D.Star, [3, 2, 0])
    window.addElement(shapes2D.Moon, [2.9, 1.5, -1])
    window.addElement(shapes2D.Cloud, [1, 1.5, -1])
    window.addElement(shapes2D.Cloud, [-2.2, 1.0, -1])
    window.addElement(shapes2D.Sun, [3, 1.7, -1])
Beispiel #4
0
import win32api
import win32gui
import time
import cv2
import numpy

from classes.window import Window
from classes.inputs import Inputs

import ngucon as ncon


w = "derp"
try:
	w = Window(debug=True)
except:
	print("Could not find debug game window")
	a = input("Do you want me to use main window? (Y/N)")
	if a.lower() == "y":
		w = Window()
	else:
		print("closing script")
		quit()
i = Inputs()
Window.x, Window.y = i.pixel_search(ncon.TOP_LEFT_COLOR, 10, 10, 400, 600)

def find_multi_image_search(scanImagePath, matchImagePath):
	img_rgb = cv2.imread(scanImagePath)
	img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
	template = cv2.imread(matchImagePath, 0)
	w, h = template.shape[::-1]
Beispiel #5
0
from classes.window import Window
from classes.grid import Grid
from constants import settings
from constants.enums import Locations
import pygame

play_area_resolution = tuple(dimension * settings.BLOCK_SIZE
                             for dimension in settings.PLAY_AREA_DIMENSIONS)

main_display = Window(resolution=settings.RESOLUTION,
                      surface=pygame.display.set_mode(settings.RESOLUTION),
                      color=settings.BACKGROUND_MAIN)

play_area = Grid(rel_location=Locations.TOP_LEFT,
                 visible=True,
                 parent=main_display)
score_board = Window(resolution=settings.SCORE_BOARD_RESOLUTION,
                     visible=True,
                     rel_location=settings.SCORE_BOARD_LOCATION,
                     color=settings.BACKGROUND_SCORE,
                     parent=main_display)
main_menu = Window(resolution=settings.MAIN_MENU_RESOLUTION,
                   color=settings.BACKGROUND_MAIN_MENU,
                   rel_location=settings.MAIN_MENU_LOCATION,
                   parent=main_display)
pause_menu = Window(resolution=settings.PAUSE_MENU_RESOLUTION,
                    color=settings.BACKGROUND_PAUSE_MENU,
                    rel_location=settings.PAUSE_MENU_LOCATION,
                    parent=main_display)
game_settings = Window(resolution=settings.GAME_SETTINGS_RESOLUTION,
                       color=settings.BACKGROUND_GAME_SETTINGS,
Beispiel #6
0
from classes.window import Window
import classes.shapes3D as shapes3D
import classes.shapes2D as shapes2D
from OpenGL.GL import glClearColor


def setBackground(parameter):
    glClearColor(0, 0.1, 0.1, 1)


if __name__ == '__main__':
    window = Window(1300, 768, 'House 3D simulation', True)
    window.setSky = setBackground

    window.addElement(shapes3D.House, [-1, 0, 0])
    window.addElement(shapes3D.Roof, [-1, 3, 0])
    window.addElement(shapes3D.Floor, [0, 0, 0])
    window.addElement(shapes2D.Door, [-1, 0.51, 2.01])
    window.addElement(shapes2D.DoorHandle, [-1.1, 0.3, 2.011])
    window.addElement(shapes3D.Window, [0.81, 0.5, 1])
    window.addElement(shapes3D.Window, [0.81, 0.5, -1])
    window.addElement(shapes3D.Window, [-2.81, 0.5, 1])
    window.addElement(shapes3D.Window, [-2.81, 0.5, -1])

    window.execute()