Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.42 KB | None | 0 0
  1. #RequireAdmin
  2. #include <MsgBoxConstants.au3>
  3.  
  4. if not RunWait('C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "Mount-DiskImage ""' & @ScriptDir & '\FF7DISC1.ISO"""', @ScriptDir, @SW_HIDE) == 0 then ; mount iso
  5.    MsgBox($MB_ICONERROR, "Error", "Failed to mount ISO: " & @error & @CRLF & @extended) ; error if mounting ISO fails
  6. else
  7.  
  8. if not WinExists("7thHeaven Version") then ; only run 7th Heaven if it's not already open
  9.    if not Run(@ScriptDir & "\7thHeaven\7thHeaven.exe", @ScriptDir & "\7thHeaven\") then ; run 7th Heaven
  10.       MsgBox($MB_ICONERROR, "Error", "Failed to launch 7th Heaven: " & @error & @CRLF & @extended) ; error if launching fails
  11.    endif
  12. else
  13.  
  14. WinWaitActive("7thHeaven Version")
  15.  
  16. Sleep(10000) ; some extra delay to make sure the window has loaded
  17.  
  18. if not ControlClick("7thHeaven Version", "", "[TEXT:Launch Game]") then ; launch game
  19.    MsgBox($MB_ICONERROR, "Error", "Failed to launch game: " & @error & @CRLF & @extended) ; error if clicking "Launch Game" fails
  20. else
  21.  
  22. Sleep(15000) ; sleep 10 seconds
  23.  
  24. WinClose("7thHeaven Version") ; finally, close 7th Heaven
  25.  
  26. endif
  27. endif
  28.  
  29. if not RunWait('C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "Dismount-DiskImage ""' & @ScriptDir & '\FF7DISC1.ISO"""', @ScriptDir, @SW_HIDE) == 0 then ; mount iso
  30.    MsgBox($MB_ICONERROR, "Error", "Failed to unmount ISO:  " & @error & @CRLF & @extended) ; error if mounting ISO fails
  31. endif
  32.  
  33. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement