if GetAsyncKeyState(%VK_P) then sleep 100 PauseFlag = iif(PauseFlag = %TRUE, %FALSE, %TRUE) end if if PauseFlag = %true then doevents iterate while end if