Bluestacks - Start & Exit application using Macro - macros

I have recorded a Bluestacks macro to perform menial tasks in the ZDay : Hearts for heros game. However, because there are so many unpredictable popups in the application I would like the macro to start the app, run the menial activity I recorded and then exit the application.
The application doesn't have a specific way to exit (file/exit doesn't exist) except on the phone is to force it closed using the OS. Is there a command I can put at the beginning of the macro to start the application and another to close the application at the end of the macro?

Bluestacks has controls that allow perform a generic exit command. So, I didn't need to know how to exit the program from inside the application. I just used the built in functionality to accomplish what I need.

Related

What is the difference between start debugging and Run without debugging

I'm building a flutter app in VsCode
When am ready to lunch my app
I use Run -> start debugging in vsCose
But alternatively I can use Run -> Run without debugging
So what the difference between the two?
In Debug mode, you can pause your application at so called break points. This can help you to find bugs in your code. You can also figure out, which values your variables consist at a speficic part in your application.
You can set a break point by double clicking on the left of a line number where you want to pause your code from running (see here: debug break point example)
Debug mode is for development. As such, the binaries are larger and slower, because they have e.g. the names of all your functions stored alongside line number information for debug tracing to work. Hot reloading is also an important feature of development or debug mode.
When you run in production mode, all the debug information is stripped away, the app loads much faster, and all debug information is elided from the binary that is produced. It is for end-use.
start debugging mean's in debug mode, it is best when you want to debug your app. you can set multiple break points and check what is value of that variable at particular point of time.
Run without debugging mean simple run where your break points doesn’t matter.
Moreinfo: https://flutter.dev/docs/development/tools/vs-code

Start an application at system start without login

We have a new server running and we got some new programs doing import routines. So far so good... But there is one program that is put into autostart folder. So it doesn't run until admin logs in and it stops if we logout.
I'd like to put this one into a seperate session so it may work without any interaction by simply starting it with the task scheduler at startup. Is this the right way to do this? Is it safe if I log in later and log out?
Many thanks!
Edit: The applications shows as a symbol in the task bar if running, it can be configured by this. Anything I must know about this if I change?
Edit: It is not my application, I cannot rewrite it as a service.
I successfully added the application by using task schelduler on startup. Login and logout will not quit the application but no symbol is shown. Please add details to my side questions and I'll mark your answer as the accepted one.
Edit: Ended up using this one. If I have to configure, I stop the application in task manager and start it again by link. After that I quit the application and restart it by task scheduler manual start.
You need to run your program as a Windows Service. One way of doing it is using the sc.exe program:
> sc create <new_service_name> binPath= "c:\myapp\myapp.exe"
You can read about it here.
You need to separate your application in two.
To allow it to run without a user session, you need a windows service. That should handle all the background stuff. You can then register the service and set it to start when the system starts.
To allow it to have a UI, and show up in the notification area, you need a windows application. This will be in autostart as usual, and will communicate with the service - for example, over named pipes.
While it is still (barely) possible to run an UI application without a user session, it's only maintained for backwards compatibility, and already shows a lot of problems. It will likely be removed altogether in the future, because it breaks quite a few contracts. Do not rely on hacks like this.
I also used the task scheduler to create the application at system startup. It should be noted that if you want to use for mining, you have to disable an option in "settings" where it says that if the application lasts more than three days in a row it will end.
It really works wonderfully!
it is a old question but I recently solved in another way...
(before I was using a scheduled-task for startup but this gave me diverse problems with lots software...)
Some programs also for diverse reasons must be run at a user level... or even inside a specific user session...
So the best way I found was to use a tool like Sysinternal/Autoruns to program the auto-logon to a specific user (it is a registry setting)... and in the startup-folder of that user (or any other "autorun/autolaunch" task)... run a script that first locks the screen... and next runs the other intended programs... that will run under that user profile...
so you can choose a standard user or a administrator... or even launch programs from a standard user in adminsitrator mode...
I hope will help...
This "hack" solved me many problems with startup apps...
I could not get the "sc create" command to work. Instead I manually edited the registry using regedit. I added a new key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services.
I used the following page to figure out required parameters and their values. Note that the names do not map.
https://learn.microsoft.com/en-us/windows-hardware/drivers/install/inf-addservice-directive
Old question, but for anyone that stumbles here. Use srvany to set the program as a custom service.
Note that when you do this with for example dropbox, googledrive, etc., you will need stop the service, then open the program normally to make changes like password, updates, etc.
below is a well enough intro.
https://www.iceflatline.com/2015/12/run-a-windows-application-as-a-service-with-srvany/
Download the tool kit here
https://www.microsoft.com/en-us/download/details.aspx?id=17657
Convert user application to Service and Register it using Regsvr32 or installutil.exe. It will start the service using SYSTEM user account. Which is a high privilege account.
Note : You can`t run any Window based application. Even a Message only window.

Run a program while another program is active (Autohotkey)

I was wondering if i could get AHK-script to automatically launch a program in the background when i start another.
Example:
Execute C:\any.exe.
AHK launches: C:\monitor.exe
When any.exe is closed, ahk should kill monitor.exe
Awsome if you guys could help me.
Edit: Note that i am a complete newcomer to programming or scripting in every way you can think of
Check out timer in the autohotkey docs.
You could set a timer that checks every 5 seconds to run winexist to test for the existence of c:\any.exe - and when it returns true then your code could run c:\monitor.exe
Now that your code knows that c:\any.exe is running, your code could launch a second timer that checks for when its process is closed (check out process in the ahk docs). When it is closed, then use winkill to close the c:\monitor.exe process.
So, look up these commands:
winexist
timer
process

Lua and os.execute return

I am writing a lua script and I have to execute two shell commands that both keep echo-ing information until terminated with ^C.
This means os.execute is useless since it waits for the return code, which never comes, and freezes the entire script. Do you have any idea on how to make this work? A good solution is not to require os.execute to return any value so it will send the command and move on but I think this is not possible. Another is multithreading that I haven't been able to make it work whatsoever.
I also must have the ability to somehow stop both infinite-loops by either using ^C or a lua method. The script is running on iPhone (iOS 5.0.1 / root) using Lua 5.1.4.
os.execute('yourcommand&')
That should run the command in the background and return to your Lua script immediately.
If you want more sophisticated process control, you're probably going to want to write that in native code.

Changing window focus on OS X

As part of an InstallationCheck script on OS X I need to use finder dialogs to let the user browse for files. When I'm done I want to move the installer application up front again so that the user can easily continue with the installation.
I have already tried the simple:
tell application "Installer" to activate
This does not work because as long as I am inside the script the Installer application is unresponsive and when i try to activate it the applescript will try to wait until Installer responds, effectively locking the program until the InstallationCheck script times out.
So basically I need a way to focus an application that works even if it is currently unresponsive. Is there any way to do this either from an applescript or directly from the perl script?
try
ignoring application responses
tell application "Installer" to activate
end ignoring
you could also try something like this
tell application "System Events"
set installer to application file of application processes whose name is "Installer"
end tell
tell application "Finder" to open installer