Author Topic: XM6g  (Read 3113 times)

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 773
    • Email
XM6g
« on: July 15, 2014, 03:02:41 PM »
Source code

Code: AutoIt
  1. Opt("WinTitleMatchMode", 1)
  2.  
  3. ;Parsing
  4. Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
  5. local $app = StringLeft ( $CmdLineRaw, $count + 4 )
  6. local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
  7. if not $command then exit 0
  8.  
  9. hotkeyset("{esc}", "Terminate")
  10.  
  11. ;Remove "" from game name
  12. $disk1 = StringTrimLeft ( $command, 1 )
  13. $disk1 = StringTrimRight ( $disk1, 1 )
  14.  
  15. ;try to find a second disk
  16. $disk2 = StringReplace($disk1,"Disk 1", "Disk 2")
  17. $disk2 = StringReplace($disk2,"Disk1", "Disk2")
  18. $disk2 = StringReplace($disk2,"Disc 1", "Disc 2")
  19. $disk2 = StringReplace($disk2,"Disc1", "Disc2")
  20.  
  21. ;find correct ini name
  22. local $inifile = "xm6g.ini"
  23. If not FileExists($inifile) then $inifile = "xm6.ini"
  24.  
  25.    Iniwrite($inifile,"MRU0","File0", $disk1)
  26.    Iniwrite($inifile,"MRU1","File0", $disk2)
  27.    Iniwrite($inifile,"Resume","FD", "1")
  28.    Iniwrite($inifile,"Resume","FDI0", "1")
  29.    Iniwrite($inifile,"Resume","FDI1", "1")
  30.    $command = ""
  31.  
  32. ;load application
  33. local $PID = Run ( '"' & $app & '" ' & $command )
  34.  
  35. ;set fullscreen
  36. Sleep(500)
  37. Send("!{Enter}")
  38.  
  39. ;waiting loop
  40.    Sleep(500)
  41.  
  42. ;exit
  43.  
  44.  
  45.  
  46. ;*************************************
  47. ;functions
  48. Func Terminate()
  49.    Winclose("XM6")
  50.    Exit 0

Executable

http://www.mgalaxy.com/forum/index.php?action=downloads;sa=view;down=62
« Last Edit: July 15, 2014, 03:19:19 PM by mgalaxy »