How to make another app open in Game Maker? - execute

I'm using Game Maker for Mac by YoYo Games, and I was wondering if it's possible to open another app in a Game Maker game by pressing a button. Sorry if this doesn't seem very clear, tell me if it isn't.
Thanks!

I do not know about the mac-version, but in the windows-version it can be done using the following functions:
execute_program(prog,arg,wait)
execute_shell(prog,arg)

execute_program, execute_shell and execute_file are obsolete. Don't use them, they will be removed.
Why?
These functions cannot be used any more due to changes in the underlying runner that GameMaker:Studio uses to generate the device specific packages making it impossible to generate objects, images or code "on the fly" as was done before.
How to fix this? I'd make a DLL for Windows and some other DLL-like program (I guess .vst or .so? ) for the Mac version, that can run external codes

Related

How to set up node-red on rasbian to get information from a ble-energy-harvesting button?

at first: I'm not a BLE expert so I try to describe my problem as good as I can and I apologize in advance if I don't use the right terms or definitions.
I've bought a BLE-Energy-Harvesting button of type PTM 215B (1).
I've installed node-red on Raspberry-Pi 2b (2)
Locally on node-red the package node-red-contrib-generic-ble was install with npm (3)
when node-red is started I can see the elements of generic-ble-package and so I tried to configure the "Generic Ble In"-Item.
When I scan for devices, I have to push and release the button several times till it is shown in the list - that's no wonder because without these actions the button has no energy.
But then it gets complicated. When I click on "Apply", the item tries to get the GATT(ributes) from the button.The problem is - as far as I understood - the button doesn't have any.
From the CLI I've used bluetoothctl to scan for devices and I've seen that the button is always recognized by the system (on-button-pressed and on-button-released).
I've also tried with different other node-red packaged but they had even more problems ( e.g. noble (4) could not be installed properly and it looks like abandoned )
I assume the problem is sitting in front of the screen but this is the second Saturday I'm trying to "install a button" and I really don't know how to proceed.
I've read (somewhere) that one of the strength of BLE is the possible usage of energy-harvesting -sensors. But does the "general-ble"-package do the job?
-If yes, how?
-If no, which package should I use?
I'd really like to use a node-red-package because I want to expand an already existing flow.
I appreciate any help and/or link.
Thank you in advance.
Regards,
Mr P
Additional info:
Raspbian: VERSION="10 (buster)"
npm --version: 6.14.8
node-red: 1.2.6: Maintenance Release
Ref.
(1) https://www.enocean.com/en/products/enocean_modules_24ghz_ble/ptm-215b/
(2) https://nodered.org/docs/getting-started/raspberrypi
(3) https://flows.nodered.org/node/node-red-contrib-generic-ble
(4) https://flows.nodered.org/node/node-red-contrib-noble
I found the way to do the job:
I installed the ble-beacon-scanner (1) and that works fine for my purpose.
As I understood: Beacons use ble-notifications, which don't share attributes and don't need a continuous connectivity.
The generic library unfortunately doesn't offer this part of the ble-protocol.
Thank you all.
Regards,
Mr P
(1) https://flows.nodered.org/node/node-red-contrib-blebeacon-scanner

KDE Taskbar Progress

I am trying to show a progress in the taskbar of the plasma desktop using the KDE Frameworks. In short, it want to do the same thing as dolphin, when it copies files:
I'm kinda stuck, because I don't even know where to get started. The only thing I found that could be useful is KStatusBarJobTracker, but I don't know how to use it. I could not find any tutorials or examples how to do this.
So, after digging around, and thanks to the help of #leinir, I was able to find out the following:
Since Plasma 5.6 KDE supports the Unitiy DBus Launcher-API, which can be used, for example, to show progress
I found a post on AskUbuntu that explains how to use the API with Qt
The real problem is: This only works, if you have a valid desktop file in one of the standard locations! You need to pass the file as parameter of the DBus message to make it work.
Based on this information, I figured out how to use it and created a GitHub repository, that supports cross platform taskbar progress, and uses this API for the linux implementation.
However, here is how to do it anyways. It should work for KDE Plasma and the Unity desktop, maybe more (haven't tried any others):
Create a .desktop file for your application. For test purpose, this can be a "dummy" file, that could look like this:
[Desktop Entry]
Type=Application
Version=1.1
Name=MyApp
Exec=<path_to>/MyApp
Copy that file to ~/.local/share/applications/ (or wherever user specific desktop files go on your system)
In your code, all you need to do is execute the following code, to update the taskbar state:
auto message = QDBusMessage::createSignal(QStringLiteral("/com/example/MyApp"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
//you don't always have to specify all parameters, just the ones you want to update
QVariantMap properties;
properties.insert(QStringLiteral("progress-visible"), true);// enable the progress
properties.insert(QStringLiteral("progress"), 0.5);// set the progress value (from 0.0 to 1.0)
properties.insert(QStringLiteral("count-visible"), true);// display the "counter badge"
properties.insert(QStringLiteral("count"), 42);// set the counter value
message << QStringLiteral("application://myapp.desktop") //assuming you named the desktop file "myapp.desktop"
<< properties;
QDBusConnection::sessionBus().send(message);
Compile and run your application. You don't have to start it via the desktop file, at least I did not need to. If you want to be sure your application is "connected" to that desktop file, just set a custom icon for the file. Your application should show that icon in the taskbar.
And thats basically it. Note: The system remembers the last state when restarting the application. Thus, you should reset all those parameters once when starting the application.
Right, so as it turns out you are right, there is not currently a tutorial for this. This reviewboard request, however, shows how it was implemented in KDevelop, and it should be possible for you to work it out through that :) https://git.reviewboard.kde.org/r/127050/
ps: that there is no tutorial now might be a nice way for you to hop in and help out, by writing a small, self contained tutorial for it... something i'm sure would be very much welcomed :)

Is there a way to play sound on mobile when task finished

Maybe I didn't search to good, but I wonder is there a way to play a sound on my Apple mobile device when the task is finished, for example call to apply?
Best Regards
(This is one of many possible answers, and happens to work very well for me.)
I use Pushbullet and RPushbullet. After the initial setup (free account and free use), from any R instance (that has connectivity with the internet) I can run pbNote('note', 'title', 'body of note'), and it "instantly" comes up on my computer and mobile.
Because it is an R package/function, it can be easily scripted to meet whatever static/dynamic needs may arise. It can also send images (I'm told), files, addresses (think google maps), and lists.
I'm using the twitteR package and tweet something when a long-lasting task is done. You can then setup a second twitter account to follow the account you tweet to from R and set an alarm for new tweets.
To be able to tweet from R, you have to go through all the authentication steps for Twitter, though.
I use my own github package to send a text. This is wrapping python code I didn't write and don't understand so I maintain it for myself but have not been able to address other people's problems:
https://github.com/trinker/gmailR
So the use may look something like:
gmail(to=cell2email(5555555555, "sprint"), password = "password")
Including this at the end of the script sends me a text when the long task is complete. This really is taking advantage that cell numbers can be turned into email addresses if the cell carrier is known.

Get dimensions of a running instance of a program in AIR

I would like to accomplish 2 tasks in AIR:
Determine, whether a defined program is running (for example firefox.exe)
If its running, then get the current dimensions of its window - i want to make a screenshot of the window, so i'd need other parameters too i guess: Is it minimized? is it behind some other window?
Is this possible to accomplish in AIR? Im using the latest version (2.6)
No it's not possible out of the box. What you're going to need to do is write a native application in something like C# or C++ and then interface with that application using the NativeProcess API. Here is a video tutorial to something close to what you want to do, and should have you well under way.
http://gotoandlearn.com/play.php?id=125
http://gotoandlearn.com/play.php?id=126

Flex: Testing UI components at the click level?

I've been working on a Flex component and I'd like to write some automated tests for it. The trouble is, the UI testing tools I've looked at (FlexMonkey and Selenium Flex API) don't simulate "enough":
Most of the bugs which have come up so far relate to the way Flex deals with dragging and dropping, which these libraries can't simulate accurately enough. For example, I need to test a case where there is a "drop" event which occurs in the bottom half of a component – neither FlexMonkey nor Selenium Flex API can do that (they may simulate a mouse event, but they won't include coordinates).
So, is there any "good" way to automate that sort of testing?
Edit: After much research, it looks like the only piece of software that can do this is iMacros, which is Windows-only and the interface is... Lacking. So I'm going to be writing my own. Basically, it will put an HTTP interface on java.awt.Robot so code (in any language) can simulate mouse/keyboard events. If you're interested, PM me and I'll keep you updated.
Edit 2: I have published the first version of the framework I wrote, Blunderbuss, over at BitBucket: http://bitbucket.org/wolever/blunderbuss/ . You'll need Jython to run it (http://www.jython.org/), but after that the flex-client example should work.
Videos of Blunderbuss live over at Vimeo:
Automating Flex testing with Blunderbuss
Blunderbuss test suite running
At the moment this remains a proof-of-concept, as I haven't had the cycles to clean it up and make it more useable… But maybe enough people bothering me would give me that time :)
I've used Eggplant to test Flash and AIR apps without having to add any hooks into the code. It's a great tool but it's quite expensive. It simulates a real user by VNC-ing into a system and uses image recognition - among other things - to interact with the app.
I am definitely interested in your custom Java class, and (though I am not the best at Java (yet...)), I would be willing to help out if you're thinking of making this collaborative.
As to Flash MouseEvents. Unfortunately, there really isn't an accurate way to simulate the drag/drop experience in Flash. MouseEvents, when generated by the mouse, are handled in a very different way than regular events and while you could simulate actions by passing events into the handling functions, or by making the dispatcher fire a new DragEvent( DragEvent.DRAG_DROP..., it will not be the same as having the user interact with it. And for some functionality (like gaining access to the clipboard), nothing inside Flash will accomplish your goals.
To be honest, you're probably headed in the right direction -- using something which is not written in Flash to drive faked mouse events is probably your best bet.
I've never had to use it in Flex but i recently stumbled across some info on automation packages in the MS Surface SDK... after looking into it those classes automated user behavior which can be used for testing i.e. move a fake mouse to this point, perform this action. As you're using Flex mx.automation packages and classes. My guess (and hope) is that you'd be able to achieve what you want using these classes.
You could also try auto-hotkey - it is similarly a macro-editing program but it has proven to be very efficient and you can write scripts and set it up very easily.

Resources