Ejemplo n.º 1
0
import os
os.environ['OMP_NUM_THREADS'] = '1'

from doom.game import play
# from doom.runners import run_basic, run_deadly_corridor
from utils.args import parse_arguments
import argparse

if __name__ == '__main__':
    # parser = argparse.ArgumentParser(description='AI runner')
    # parser.add_argument("--scenario", type=str, help="Scenario")
    # args, remaining = parser.parse_known_args()
    #
    # if args.scenario is not None:
    #     run_scenario(args.scenario)

    game_args = parse_arguments()
    play(game_args)
Ejemplo n.º 2
0
from utils.args import parse_arguments

params = parse_arguments()
print(params)

import numpy as np

if params.scenario == 'deadly_corridor':
    resize = (100, 181)
    crop = (30, -35, 1, -1)

    if params.actions == 'all':
        action_size = 10
    elif params.actions == 'single':
        action_size = 6

    state_size = np.prod(resize)

elif params.scenario == 'basic':
    resize = (84, 84)
    crop = (10, -10, 30, -30)

    if params.actions == 'all':
        action_size = 6
    elif params.actions == 'single':
        action_size = 3

    state_size = np.prod(resize)

elif params.scenario == 'defend_the_center':
    resize = (84, 159)
Ejemplo n.º 3
0
def main():
    banner("0.1")
    hr = "------------------------------------"
    # counter below needs to be added as part of the Sheepl Object
    # this should get automatically incremented either based on the
    # length of the task list or a counter tracker
    id = 1
    # Main Parser Setup
    args = parse_arguments()
#>> DEBUG
#    print(args)

    # assign colour output
    colour_output = args.colour
    print("[!] Colour output is set to : {}".format(str(colour_output).upper()))
    cl = ColourText(colour_output)

    # gets global header declarations for autoIT script
    # >> Global Calls

    # manual check for Name
    if not args.name and args.interactive:
        interactive = True
        console = SheeplConsole(cl)
    elif not args.name:
        print(cl.red("[!] You need to give this Sherson a name (--name <NAME>) - bah"))
        sys.exit(0)


    ## TODO: this needs to be pushed into a class from below to make S
    # Sheepl
    print("[:] - Creating the person called > {}".format(cl.green(args.name)))

    # first check for spaces
    file_name = args.name.replace(' ', '_').lower() + '.au3'
    # ------->
    # Parse time
    # goes through supplied arguments and creates tasks
    csh = Sheepl(args.name, args.total_time, args.type, cl, args.loop)
    csh.say_hello()

    # add the tea break task
    csh.add_task("tea_break", csh.tea_break_task())


    #############################################
    ##  Word
    #############################################

    if args.wordfile:
        from actions.office.word import WordDocument
        id += 1
        print("[!] - Word Interaction")
        print('[-] - Word output file is "{}" and user will type contents of "{}"'.format(args.wordfile, args.inputtext))
        word_file = WordDocument(args.inputtext , args.wordfile, str(id))
        csh.add_task('Word_' + str(id), word_file.create())


    #############################################
    ##  Excel
    #############################################

    # if args.wordfile:
    #     print("[!] - Excel Interaction")
    #     print("[!] - Adding Excel Header")
    #     print('[-] - Excel output file is "{}" and user will type contents of "{}"'.format(args.excelfile, args.inputcsv))
    #     # import word module
    #     from actions.office import excel
    #     # # TODO: get this from Headers
    #     # header = add_header('word', headers)
    #     # of.write(header + '\n')
    #     of.write('#include <Excel.au3>\n')
    #     of.write(excel.create_new_document())
    #     with open(args.inputtext) as st:
    #         poem = st.read()
    #         of.write(word.typing_block(poem) + '\n')
    #         of.write(word.save_file(args.wordfile))
    #     # # TODO: this will come from time variable based on some counting of some args
    #     # this will determine the wait time until the next the command
    #     # # TODO: break this out into a master function that decrements some cound and randomly
    #     # distributest the remaining time in milliseconds
    #     of.write('sleep(3000)' + '\n')


    #############################################
    ##  PowerShell
    #############################################

    if args.powershell:
        from actions.shell.powershell import PowerShell
        id += 1
        print(cl.green("[!] - Powershell Interaction"))
        print("[^] - Issuing the following powershell commands")
        ps_shell = PowerShell(args.pc, str(id))
        csh.add_task('Powershell_' + str(id), ps_shell.create())
        for command in args.pc:
            print('[-] - They will type "{}" into the PowerShell prompt'.format(command))


    #############################################
    ##  CMD
    #############################################

    if args.cmd:
        from actions.shell.cmd import CMDShell
        id += 1
        print(cl.green("[!] - Command Shell Interaction"))
        print("[!] - Issuing the following cmd commands")
        cmd_shell = CMDShell(args.cc, str(id))
        csh.add_task('CMD_' + str(id), cmd_shell.create())
        for command in args.cc:
            print('[-] - They will type "{}" into the CMD Shell'.format(command))


    #############################################
    ##  Internet Explorer
    #############################################

    if args.ie:
        from actions.browsing.ie import IEBrowser
        id += 1
        print(cl.green("[!] - Internet Explorer Interaction"))
        ie = IEBrowser(args.url, str(id))
        csh.add_task('IE_' + str(id), ie.create())
        print('[-] - They will browse to "{}" using Internet Explorer'.format(args.url))


    #############################################
    ##  RDP
    #############################################

    if args.rdp:
        from actions.network.remotedesktop import RDPConnection
        id += 1
        print(cl.green("[!] - Remote Desktop Interaction"))
        print(hr)
        print('[-] - The user "{}" will create a Remote Desktop Connection to "{}"'.format(args.rdp_user, args.rdp))
        if args.rdp_command:
            for command in args.rdp_command:
                print('[-] - They will type "{}" into the remote session'.format(command))
        rdp_conn = RDPConnection(args.rdp , args.rdp_user , args.rdp_password, str(id))
        csh.add_task('RDP_' + str(id), rdp_conn.create())


    #############################################
    ##  WRITE FILE
    #############################################

    print("[*] - Writing output file > {}\n".format(file_name))
    print(hr)
    csh.write_file(file_name)
Ejemplo n.º 4
0
def main():
    game_args = parse_arguments()
    play(game_args)