ScriptUp - Many scripts, One process

Post your working scripts, libraries and tools
User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

ScriptUp - Many scripts, One process

04 Sep 2017, 04:07

Finally, it's been completed! :) Everything is in the readme. Enjoy!

Download from Github


Last update:

Fixed to allow soft-closure of script threads.
Helgef
Posts: 2394
Joined: 17 Jul 2016, 01:02
Contact:

Re: ScriptUp - Many scripts, One process

05 Sep 2017, 13:20

I have tested it. Well done :thumbup:
I made a list:
  • Suggestion, If possible, it would be nice to have the default tray menu options for the running scripts, via ScriptUp. That is, Pause, Suspend etc..
  • Suggestion, maybe collect all relevant files and make a release on github, for easy access. (Most people (me included) are lazy you know)
  • Comment, for others, it is nice to put a copy of autohokey.exe in the script folder, renaming to ScriptUp.exe, then you get the ScriptUp.exe name in the taskmanager.
  • Problem, I needed to restart ScriptUp when I added a new script, it didn't run on add. I tried refresh and refresh all. Only tested with std. My ahk_h version is 1.1.25.02 64bit on win7. AHK_h is not my default AHK.
  • Problem, exiting ScriptUp seems to invoke a TerminateThread or similar forceful exiting for each script, rather than invoking ExitApp. AHK_H V2 documentation suggest you can do thread.ExitApp() I do not know if this is possible in v1. I tried to invoke a.thread.exec(...) (if I understand correctly, it is threadManObject.exec(str)) in fileList.__Delete() but it didn't seem to work.

Cheers, and thanks for sharing.
User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: ScriptUp - Many scripts, One process

05 Sep 2017, 17:17

Hey Helgef, glad you like it!

First 2, good ideas and I'll act on both of them. But for the tray, do you mean to have a global pause and suspend? If you mean to list all the scripts and have those options for them, that's much too messy for my liking.
Problem 1, I had this issue as well, and I believe I know where it is. Portion of code I had to re-write several times already, bit tricky for me. I'll get to this when I can.
Problem 2, yes, this was on purpose. I didn't see a need for soft-closing threads, but it's pretty important if they're required to run an onExit sub. And exec should probably be in threadMan.quit(), to replace the ahkTerminate.

Good suggestions, thanks! I'll implement them when I get a minute to work on it.

Note: I do not use AHK_H except for multi-threading, and I only use v1.1. The script itself was written in/for AHK v1.1 [Unicode x64], my standard.
Helgef
Posts: 2394
Joined: 17 Jul 2016, 01:02
Contact:

Re: ScriptUp - Many scripts, One process

06 Sep 2017, 02:25

Hello!
For suggestion 1, I meant something like having button controls in the main gui, [Pause] [Supspend] ... Which would do the action for the selected script. Or instead of buttons, maybe a menu item, [Script actions]->[Pause]... In effect, one could clean up the tray notification area by using #NoTrayIcon for scripts running through ScriptUp. (Ofc, for scripts without custom tray menu items)
Problem 2, onExit subs and object __delete and such would be the issue indeed.

Cheers.
User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: ScriptUp - Many scripts, One process

11 Sep 2017, 10:30

Helgef wrote:For suggestion 1...

Ah, that makes much more sense! I will certainly add the ability to pause and such (and display the status) soon.

Helgef wrote:#NoTrayIcon for scripts running through ScriptUp.

Yes, I highly suggest this! And it's exactly what I do, for anything that doesn't have a custom menu, anyway.

I could only muster up enough time to fix the soft-closing. ahkTerminate() is actually a soft-close. The problem was that ScriptUp didn't release the threadMan objects, so it just force terminated everything. It now does so, but it's limited to a set timeout (see the readme on Github). If the timeout is exceeded, ScriptUp will crash. Adding a try-block seems to catch the crash, but it should then fall back to a force-closure. It seems to do so, anyway, which works quite well.

I'll try to get the other stuff put in soon. :thumbup:
guest3456
Posts: 2052
Joined: 09 Oct 2013, 10:31

Re: ScriptUp - Many scripts, One process

11 Sep 2017, 10:47

why not also include the AHK_H.dll in the repository?

User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: ScriptUp - Many scripts, One process

11 Sep 2017, 11:12

guest3456 wrote:why not also include the AHK_H.dll in the repository?

To ensure everyone is getting the most up-to-date version. I'm not going to update the DLL's on ScriptUp's repository every time they're updated. I most likely won't even update mine, unless something truly pertinent is added.

I suppose I could put the latest ones up/the version I'm working with now (just updated) for compatibility purposes.
User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: ScriptUp - Many scripts, One process

15 Sep 2017, 09:38

I have a particular script that crashes ScriptUp every time it tries to close/reload it. It doesn't crash when ran through the AHK or AHK_H executable. I can't post the script, but it's mostly context-sensitive hotkeys, image/pixel searching and key sending. I have several other scripts that use all the same commands and functions, none of which crash ScriptUp. The path is identical to several others in there as well, so it's certainly something to do with the contents, right? It does not have an onExit sub.

If anyone else encounters this, or has an idea as to why, please let me know.
Helgef
Posts: 2394
Joined: 17 Jul 2016, 01:02
Contact:

Re: ScriptUp - Many scripts, One process

17 Sep 2017, 13:11

I cannot reproduce with simple example doing context sensitive hotkey to imagesearch and send keys. Not with std or mini (you didn't specifiy). Can you narrow your script down?
User avatar
Masonjar13
Posts: 1111
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: ScriptUp - Many scripts, One process

17 Sep 2017, 14:09

Unfortunately, not too much. I have it force-install both the mouse and keyboard hooks, it sets the coordmode for tooltip, pixel, and mouse, has setControlDelay -1 and setKeyDelay,25,25, several associative arrays, a simple array, and a single GUI. There are timers and loops, but none are on by default, and the crash occurs regardless of if a hotkey is triggered or not.

I have several identical hotkeys, separated by context.. It's quite a large script, but I'll try to reproduce it in an example.
HotKeyIt
Posts: 1534
Joined: 29 Sep 2013, 18:35
Contact:

Re: ScriptUp - Many scripts, One process

18 Sep 2017, 15:35

Do you get an Exception message on crash, if yes, what is it showing? If not then the error occurs in exe, you can download VC and try to run debug version to see what causes the error!
Dboeeee
Posts: 1
Joined: 30 Oct 2017, 01:53

Re: ScriptUp - Many scripts, One process

30 Oct 2017, 01:57

How can i download it?, i always struggle downloading things on GitHub

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Bing [Bot] and 18 guests