Attract-Mode Support Forum

Related Stuff => Emulators => Topic started by: qqplayer on May 17, 2018, 04:11:06 AM

Title: Autoit Error
Post by: qqplayer on May 17, 2018, 04:11:06 AM
Trying to create a simple script for C64 with retroarch.
All my attempts with autoit failed.

Even a basic script is sending me an error:

Code: [Select]
#NoEnv

Sleep, 1000
SetKeyDelay, -1, 110
Send {F11}
Return

Code: [Select]
error: syntax error
Sleep,

Code: [Select]
---------------------------
Aut2Exe Error
---------------------------
Line 5  (File "C:\Users\User\Downloads\AutoIt v3 Script.au3"):

Send {F11}
Send ^ ERROR

Error:
---------------------------
Aceptar   
---------------------------

Any advice?

P.D. Windows 8.1 x64 , and Autoit v3.3.14.5 , tried Admin privileges run , x86 mode...
Title: Re: Autoit Error
Post by: hermine.potter on May 17, 2018, 10:55:29 PM
you mix/mistake autoit with autohotkey.
they're two different languages, with different syntax

sleep command autoit (https://www.autoitscript.com/autoit3/docs/functions/Sleep.htm)
sleep command autohotkey (https://autohotkey.com/docs/commands/Sleep.htm)
Title: Re: Autoit Error
Post by: qqplayer on May 19, 2018, 05:42:47 AM

Yes , you are right , I copied from here

https://forums.launchbox-app.com/topic/39811-auto-hotkey-scripts/

Trying to figure out how to create a script for retroarch with your autoit tutorial

http://forum.attractmode.org/index.php?topic=365.0

Only get "retroarch"

Code: [Select]
;waits for retroarch
winwait("Retroarch")
WinWaitActive("Retroarch")

Is this right?
Title: Re: Autoit Error
Post by: hermine.potter on May 21, 2018, 11:24:06 PM
@qqplayer
I'm not using Retroarch. So I can't help 100%.

After starting retroarch.exe and aut3info.exe of autoit:
retroarch starts a window without any visible text (so cell of visible text of au3info is empty).
(http://fs1.directupload.net/images/180522/m5ohjdlg.gif)

so you need to add a delay (sleep command).
the F11 key disable the mouse cursor, right?

so this should do it:
Code: [Select]
WinWait("RetroArch","")
WinWaitActive("RetroArch","")
sleep(1000)
send("{F11}")
Title: Re: Autoit Error
Post by: qqplayer on May 22, 2018, 09:38:41 AM
Thanks, I´ll try I think I need another key.
What I want is to enable "fast forward" for maybe 20 seconds holding an specific key , and then release after that.
Could be "f" for example.

How can I make this with autoit?

so this should do it:
Code: [Select]
WinWait("RetroArch","")
WinWaitActive("RetroArch","")
sleep(1000)
send("{F11}")
[/quote]
Title: Re: Autoit Error
Post by: hermine.potter on May 22, 2018, 10:23:09 PM
@qqplayer
please do not quote complete posts.

this should do it:
Code: [Select]
#include <Timers.au3>

WinWait("RetroArch","")
WinWaitActive("RetroArch","")

$starttime = _Timer_Init()
While _Timer_Diff($starttime) < 20000; 20 sec => 20 sec * 1000 ms => 20000 ms
    Send("f")
WEnd