
--local targetWindowClass = "Aion Client";
local targetWindowName = "FreeCell";
local startTime;
-- Main script
function macro.init()
	win = window.find(targetWindowName);
	if( not win ) then
		error("Could not find Notepad window. You must have the program running to use this script.\n", 0);
	end
	procId = process.findByWindow(win);
	if( not procId  ) then
		error("Could not find Notepad ID. You must have the program running to use this script.\n", 0);
	end
	procHandle = process.open(procId);
	if( not procHandle ) then
		error("Could not find Notepad process. You must have the program running to use this script.\n", 0);
	end
	process.suspend(procHandle);
	startTime = time.getNow()
end

function macro.main(dt)
		
  if( time.diff(time.getNow(),startTime) > 10 ) then
    print("10 secounds have elapsed.");
	
	process.resume(procHandle)
	process.close(procHandle)
	return false;
  end
end