from desktop_env.envs.desktop_env import DesktopEnv def human_agent(): """ Runs the Gym environment with human input. """ env = DesktopEnv( path_to_vm=r"""C:\Users\tianbaox\Documents\Virtual Machines\Win10\Win10.vmx""", # path_to_vm="/home/yuri/vmware/Ubuntu 64-bit/Ubuntu 64-bit.vmx", # host="192.168.7.128", host="http://192.168.13.128:5000", snapshot_path="base3", ) # reset the environment to certain snapshot observation = env.reset() done = False for i in range(2): # action = get_human_action() # action = { # "action_type": 0, # "click_type": 3, # } action = "pyautogui.moveTo(10, 100)" if i == 0 else "pyautogui.click(button='right')" observation, reward, done, info = env.step(action) print("Observation:", observation) print("Reward:", reward) print("Info:", info) print("================================\n") if done: print("The episode is done.") break env.close() print("Environment closed.") if __name__ == "__main__": human_agent()