Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: AHK help needed please  (Read 1879 times)

0 Members and 1 Guest are viewing this topic.

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • Last login:May 18, 2024, 04:28:42 pm
  • I want to build my own arcade controls!
AHK help needed please
« on: August 07, 2013, 05:06:19 pm »
I have 8 Ahk.exes loading at startup of windows, each one has a custom loop consisting of:

Code: [Select]
Loop
{
Process, Wait, process.exe
run blah blah
Process,WaitClose, process.exe
run blah blah
}

So Ahk_process1.exe would have:
Code: [Select]
Loop
{
Process, Wait, process1.exe
run blah blah
Process,WaitClose, process1.exe
run blah blah
}

Ahk_process2.exe would have:
Code: [Select]
Loop
{
Process, Wait, process2.exe
run blah blah
Process,WaitClose, process2.exe
run blah blah
}

etc etc etc

How do I combine these into one ahk?
« Last Edit: August 07, 2013, 05:13:16 pm by Connorsdad »
    

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: AHK help needed please
« Reply #1 on: August 10, 2013, 04:27:53 am »
You can combine them, but autohotkey does not support multi-threading. It runs code one line at at time.

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • Last login:May 18, 2024, 04:28:42 pm
  • I want to build my own arcade controls!
Re: AHK help needed please
« Reply #2 on: August 10, 2013, 07:39:48 am »
Only one of the processes will be active at any one time therefore only one loop will be active at any one time. How do I have all the loops in one ahk script?

Sent from Amstrad CPC464

    

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • Last login:May 18, 2024, 04:28:42 pm
  • I want to build my own arcade controls!
Re: AHK help needed please
« Reply #3 on: August 10, 2013, 10:24:06 am »
Sussed it :)

Edit:
No I haven't :(

Sent from Amstrad CPC464
« Last Edit: August 10, 2013, 10:35:51 am by Connorsdad »
    

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: AHK help needed please
« Reply #4 on: August 11, 2013, 12:56:11 am »
Only one of the processes will be active at any one time...

If that's the case, I'm thinking something like this could work:

Code: [Select]
Loop
{

Process, Wait, process1.exe, 0.1
If (ErrorLevel != 0)
{
run blah blah
Process,WaitClose, process1.exe
run blah blah
}

Process, Wait, process2.exe, 0.1
If (ErrorLevel != 0)
{
run blah blah
Process,WaitClose, process2.exe
run blah blah
}

Process, Wait, process3.exe, 0.1
If (ErrorLevel != 0)
{
run blah blah
Process,WaitClose, process3.exe
run blah blah
}

}

Connorsdad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 268
  • Last login:May 18, 2024, 04:28:42 pm
  • I want to build my own arcade controls!
Re: AHK help needed please
« Reply #5 on: August 11, 2013, 09:16:31 am »
Thank you nitz, absolute star :)

Much tidier now.
    

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: AHK help needed please
« Reply #6 on: August 11, 2013, 04:46:38 pm »
 :applaud:

Glad it worked for you.

 :cheers: