Jump to content
Sign in to follow this  
romkilla

Basic help for a complete noob regarding the creation off a script to .exe

Recommended Posts

romkilla

Hello guys, first i want to apologise for my bad english, i am french.

Normaly i have no problems to follow tutorials guides but this time i need to create a script and to compile it has a .exe file. I so deseperate, i am triyng doing this  since yesterday and its not working.

I am on windows 7 64 and here is the script i have to create:

#include <Misc.au3>
Opt("WinTextMatchMode", 3)
$path = "C:\Users\ROMAN\Documents\Emulateurs\ds\"
$app = "DeSmuME_0.9.10_x86.exe"
$windows = "DeSmuME 0.9.10 x86"

If $CmdLine[0] == 1 Then
    Run('"' & $path & $app & '" "' & $CmdLine[1] & '"')
    WinWait ( $windows )
    WinActivate ( $windows )
    WinWaitActive ( $windows )
    Send("!{ENTER}")
    _MouseTrap(@DesktopWidth, @DesktopHeight, @DesktopWidth, @DesktopHeight) 
    ProcessWaitClose( $app )
EndIf
Exit 0

I have make the script, compiled it has a .exe. When i clic on it, sadlly nothing happen.

 

I have fond this script on the forum(edited to fit my config):

Local Const $sWndTitle = "DeSmuME 0.9.10 x86"

Run("C:\Users\ROMAN\Documents\Emulateurs\ds\DeSmuME_0.9.10_x86.exe")
WinWait($sWndTitle)
WinActivate($sWndTitle)
WinWaitActive($sWndTitle)
Send("!{ENTER}")

HotKeySet("{Esc}", "CloseWindow")

While 1
    Sleep(100)
WEnd

Func CloseWindow()
    ; ... can do stuff here

    If WinActive("Microsoft Excel") = 1 Then
        Send("{Esc}")
    Else
        Send("!{F4}")
    EndIf

    Exit
EndFunc   ;==>CloseWindow

Its almost working, when i clic on the .exe file that i have created with it,  the software start in full screen. But when i drag a file to this .exe the rom don't load.

Maybe someone can help me.

Thanks guys

Edited by romkilla

Share this post


Link to post
Share on other sites
FireFox

Hi,

I have make the script, compiled it has a .exe. When i clic on it, sadlly nothing happen.

You are expecting a parameter in the command line, so the whole script contained in the condition isn't executed.

If $CmdLine[0] == 1 Then

_

Its almost working, when i clic on the .exe file that i have created with it,  the software start in full screen. But when i drag a file to this .exe the rom don't load.

Add some debug to check what's working or not.
 
e.g :

#include <Misc.au3>
#include <Array.au3>

Opt("WinTextMatchMode", 3)

$path = "C:\Users\ROMAN\Documents\Emulateurs\ds\"
$app = "DeSmuME_0.9.10_x86.exe"
$windows = "DeSmuME 0.9.10 x86"

_ArrayDisplay($CmdLine)

If $CmdLine[0] = 1 Then
    Run('"' & $path & $app & '" "' & $CmdLine[1] & '"')

    MsgBox(0, "", "Attente de la fenêtre")
    WinWait($windows)
    MsgBox(0, "", "Fenêtre trouvée")
    WinActivate($windows)
    WinWaitActive($windows)
    Send("!{ENTER}")
    _MouseTrap(@DesktopWidth, @DesktopHeight, @DesktopWidth, @DesktopHeight)
    MsgBox(0, "", "Attente de la fermeture du proc")
    ProcessWaitClose($app)
    MsgBox(0, "", "Proc fermé")
EndIf

Exit 0

I used MsgBox only because you have to debug it in compiled mode, but otherwise use ConsoleWrite.

Btw: Welcome to the autoit forum :)

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
JLogan3o13

@OP - As I see both the word DesMume and Emulators (not to mention your username of Romkilla), have you taken the time to look at the forum rules before you posted this question?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.