Author Topic: Autoit Error  (Read 603 times)

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Autoit Error
« 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...
« Last Edit: May 17, 2018, 04:13:02 AM by qqplayer »

hermine.potter

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: Autoit Error
« Reply #1 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
sleep command autohotkey
AM Version : 2.4.0
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Autoit Error
« Reply #2 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?
« Last Edit: May 24, 2018, 02:39:58 PM by qqplayer »

hermine.potter

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: Autoit Error
« Reply #3 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).


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}")
AM Version : 2.4.0
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Autoit Error
« Reply #4 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]
« Last Edit: May 24, 2018, 02:39:35 PM by qqplayer »

hermine.potter

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
Re: Autoit Error
« Reply #5 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
AM Version : 2.4.0
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy