Author Topic: New Winkawaks AutoIT  (Read 190 times)

Gtamax

  • Newbie
  • *
  • Posts: 2
New Winkawaks AutoIT
« on: September 01, 2017, 08:19:37 AM »
Hi!
I'm using Winkawaks 1.65 and I had problems with the mGalaxy default script, I got freeze when I exit the emulator.
So I maked experimentations and I have made this script, it reduce the window before any operations, that was the cause of the freeze.
Code: AutoIt
  1. ;----------========== Parsing (common to every scripts) ==========----------
  2. ;
  3. ; There has been a call from mGalaxy to AutoIt and a commandline has been passed to it:
  4. ; Structure:/AutoIt3ExecuteScript "Path_to_script(between quotes)" Path_to_emu Emu_parameters(including a "Path_to_rom"(between quotes))
  5. ; Example:/AutoIt3ExecuteScript "C:\...\MESS [Script].au3" C:\...\mess64.exe a800 -flop1 "C:\...\Boulder_Dash.zip" -skip_gameinfo -nowindow
  6. ;
  7. ; 1. We don't need the part related to AutoiIt anymore [/AutoIt3ExecuteScript "Path to script (between quotes)"], the rest is assigned to '$commandline'
  8. ; 2. '$commandline' is then split in two: [Path_to_emu] goes to '$app', [parameters(including a "Path to rom" (between quotes))] goes to '$command'
  9. ; 3. Some apps (MESS for instance, when it searchs for a system Bios) need to know the path to their 'Working Directory'. We do 'extract' it from the full app path
  10. ;
  11. ; 1
  12. Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
  13. Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )
  14. ; 2
  15. Local $count2 = StringInStr($commandline, '.exe', 0 , 1, 1)
  16. local $app = StringLeft ($commandline, $count2 + 3 )
  17. local $command = StringTrimLeft($commandline, $count2 + 4 )
  18. if not $command then exit 0
  19. ; 3
  20. Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
  21. FileChangeDir($workingDir)
  22. ;---------------------------------------------------------------------------
  23.  
  24. hotkeyset("{esc}", "Terminate")
  25.  
  26. ;load application
  27. Runwait ( '"' & $app & '" ' & $command )
  28.  
  29. ;exit
  30.  
  31. ;*************************************
  32. ;functions
  33. Func Terminate()
  34.    Sleep(250)
  35.    Send("!{Enter}")
  36.    Sleep(250)
  37.    Send("{Enter}")
  38.    Sleep(250)
  39.    Send("!{F4}")
  40.    Exit 0
Enjoy  ;)
« Last Edit: September 06, 2017, 10:03:53 AM by mgalaxy »

Aeliss

  • Hero Member
  • *****
  • Posts: 676
Re: New Winkawaks AutoIT
« Reply #1 on: September 02, 2017, 04:17:39 PM »
I don't use Winkawaks so I can't check for the bugs, but rly useful to know, thx.

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 828
    • Email
Re: New Winkawaks AutoIT
« Reply #2 on: September 06, 2017, 10:10:50 AM »
Thank you, I will adapt the official script accordingly! :)
Is ' Send("!{Enter}")' (the one with the exclamation mark) needed? This is to switch on/off full-screen isn't it? Is this necessary here? (just asking cause I can't test it right now)
« Last Edit: September 07, 2017, 03:07:17 AM by mgalaxy »

Gtamax

  • Newbie
  • *
  • Posts: 2
Re: New Winkawaks AutoIT
« Reply #3 on: September 08, 2017, 11:14:16 AM »
Thank you, I will adapt the official script accordingly! :)
Is ' Send("!{Enter}")' (the one with the exclamation mark) needed? This is to switch on/off full-screen isn't it? Is this necessary here? (just asking cause I can't test it right now)


Yes! I can't close the emulator in fullscreen mode, this line switch the emulator to window mode (ALT + ENTER = !{Enter}).