Finally, it's been completed! Everything is in the readme. Enjoy!
Download from Github
Last update:
Added "Edit" to context menu.
ScriptUp - Many scripts, One process
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
I have tested it. Well done
I made a list:
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.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
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.
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.
Re: ScriptUp - Many scripts, One process
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.
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.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
Ah, that makes much more sense! I will certainly add the ability to pause and such (and display the status) soon.Helgef wrote:For suggestion 1...
Yes, I highly suggest this! And it's exactly what I do, for anything that doesn't have a custom menu, anyway.Helgef wrote:#NoTrayIcon for scripts running through ScriptUp.
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).
I'll try to get the other stuff put in soon.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
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.guest3456 wrote:why not also include the AHK_H.dll in the repository?
I suppose I could put the latest ones up/the version I'm working with now (just updated) for compatibility purposes.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
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.
If anyone else encounters this, or has an idea as to why, please let me know.
Re: ScriptUp - Many scripts, One process
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?
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
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.
I have several identical hotkeys, separated by context.. It's quite a large script, but I'll try to reproduce it in an example.
Re: ScriptUp - Many scripts, One process
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!
Re: ScriptUp - Many scripts, One process
How can i download it?, i always struggle downloading things on GitHub
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
I never got any exceptions, it would just say it's stopped responding and my cursor position wouldn't update faster than once a second, so I have to hit "Close unresponsive process" button on the popup with they keyboard. Sorry I didn't respond sooner.HotKeyIt wrote: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!
Between being busy and lazy, I've finally bothered to see why this was occurring: #IfWinActive. I've deprecated this in favor of #if winActive() everywhere, including in that script, except for one instance. I replaced it and now there's no more crashing.
So, HotKeyIt, I assume you deprecated this as well in AHK_H? Why is it allowed to run in the first place, though?
Re: ScriptUp - Many scripts, One process
Thanks, Masonjar13, that's good stuff.
I cloned the GitHub repository, and ran into a couple of errors (not yours) that I thought I'd share in case anyone else does what I did and ran it from the src folder.
1) I already had _Struct in my LIB folder in the program directory, so that threw an error at Line 42 of C:\Program Files\AutoHotkey\LIB\_Struct.ahk. I removed _Struct from the LIB folder in the cloned repository structure and that error went away.
2) You mention readResource and even give the link to it, but it isn't in the LIB folder in the repository for some reason, though all the rest of the requirements are. That of course threw an error, but I just added readResource to the LIB folder in the cloned repo structure and everything fired up.
Cool script indeed!
Regards,
burque505
I cloned the GitHub repository, and ran into a couple of errors (not yours) that I thought I'd share in case anyone else does what I did and ran it from the src folder.
1) I already had _Struct in my LIB folder in the program directory, so that threw an error at Line 42 of C:\Program Files\AutoHotkey\LIB\_Struct.ahk. I removed _Struct from the LIB folder in the cloned repository structure and that error went away.
2) You mention readResource and even give the link to it, but it isn't in the LIB folder in the repository for some reason, though all the rest of the requirements are. That of course threw an error, but I just added readResource to the LIB folder in the cloned repo structure and everything fired up.
Cool script indeed!
Regards,
burque505
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
Update!
I replaced the face buttons with a context (right-click) menu, which now also allows to invoke ListLines on the selected script. You may only click-and-drag scripts to the window now to add them. More to come in the near future (looks at Helgef)
Note: the mini DLL doesn't have the ListLines command, therefore you may not use it with scripts that use the mini DLL.
I replaced the face buttons with a context (right-click) menu, which now also allows to invoke ListLines on the selected script. You may only click-and-drag scripts to the window now to add them. More to come in the near future (looks at Helgef)
True, it's something I forgot to add. However, it doesn't work, so I'll probably just remove it anyway. It did at one point, but for some reason, I can no longer pull resources from a compiled script. If anyone has a fix for that, please let me know!burque505 wrote:You mention readResource
Note: the mini DLL doesn't have the ListLines command, therefore you may not use it with scripts that use the mini DLL.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
Update! Again
Added readResource to the included lib folder, added pause/suspend function to threads, added new column to show the current state of the script.
New limitation: the only way I know how to suspend a thread is by executing Suspend as code, which won't work if the thread is paused. So to do both via the GUI, you must suspend then pause.
Added readResource to the included lib folder, added pause/suspend function to threads, added new column to show the current state of the script.
New limitation: the only way I know how to suspend a thread is by executing Suspend as code, which won't work if the thread is paused. So to do both via the GUI, you must suspend then pause.
Re: ScriptUp - Many scripts, One process
Great updates .
For suspending while paused, as per the documentation,
Also, very nice with one download including everything .
Cheers.
For suspending while paused, as per the documentation,
Code: Select all
; fileList.ahk
suspend(scriptName){
; Not tested on mini
static WM_COMMAND := 0x111
static ID_FILE_SUSPEND := 65404
DetectHiddenWindows, On
PostMessage, WM_COMMAND, ID_FILE_SUSPEND,,, % "ahk_id " this.scripts[scriptName].thread.varGet("a_scripthwnd")
}
Cheers.
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
Helgef, my hero! I didn't consider to look at the Suspend docs for some reason. It doesn't need to work with mini anyways, since it can't have hotkeys. This works perfectly! Added a check to maintain previous DetectHiddenWindows setting and for the Mini, I'll have it posted to the repository momentarily.Helgef wrote:For suspending while paused, as per the documentation
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: ScriptUp - Many scripts, One process
I was considering adding an interface to execute code on a thread directly. Does anyone think this would be useful? Or does anyone have any other feature suggestions for it? As it is, it's very stable (on my end) and contains pretty much everything I could think of needing.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: yxldh and 51 guests