New Winkawaks AutoIT

Post Reply
Gtamax
Newbie
Newbie
Posts: 2
Joined: Fri Sep 01, 2017 12:06 pm

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: Select all

;----------========== Parsing (common to every scripts) ==========----------
;
; There has been a call from mGalaxy to AutoIt and a commandline has been passed to it:
; Structure:/AutoIt3ExecuteScript "Path_to_script(between quotes)" Path_to_emu Emu_parameters(including a "Path_to_rom"(between quotes))
; Example:/AutoIt3ExecuteScript "C:\...\MESS [Script].au3" C:\...\mess64.exe a800 -flop1 "C:\...\Boulder_Dash.zip" -skip_gameinfo -nowindow
;
; 1. We don't need the part related to AutoiIt anymore [/AutoIt3ExecuteScript "Path to script (between quotes)"], the rest is assigned to '$commandline'
; 2. '$commandline' is then split in two: [Path_to_emu] goes to '$app', [parameters(including a "Path to rom" (between quotes))] goes to '$command'
; 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
;
; 1
Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )
; 2
Local $count2 = StringInStr($commandline, '.exe', 0 , 1, 1)
local $app = StringLeft ($commandline, $count2 + 3 )
local $command = StringTrimLeft($commandline, $count2 + 4 )
if not $command then exit 0
; 3
Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
FileChangeDir($workingDir)
;---------------------------------------------------------------------------

hotkeyset("{esc}", "Terminate")

;load application
Runwait ( '"' & $app & '" ' & $command )

;exit
exit 0

;*************************************
;functions
Func Terminate()
   Sleep(250)
   Send("!{Enter}")
   Sleep(250)
   Send("{Enter}")
   Sleep(250)
   Send("!{F4}")
   Exit 0
EndFunc
Enjoy  ;)
Attachments

[The extension has been deactivated and can no longer be displayed.]

Last edited by Gtamax on Wed Sep 06, 2017 2:03 pm, edited 1 time in total.
Aeliss
Hero Member
Hero Member
Posts: 900
Joined: Thu Apr 04, 2013 5:55 pm

I don't use Winkawaks so I can't check for the bugs, but rly useful to know, thx.
User avatar
mgalaxy
Administrator
Administrator
Posts: 1189
Joined: Tue Dec 05, 2006 7:46 pm

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 edited by mgalaxy on Thu Sep 07, 2017 7:07 am, edited 1 time in total.
Gtamax
Newbie
Newbie
Posts: 2
Joined: Fri Sep 01, 2017 12:06 pm

mgalaxy wrote: 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}).
Post Reply