Creating a text based browser game bot that runs in the background - automation

I want to create a bot for a text based browser game that will have:
A separate mouse that will not interfere with my mouse
human like mouse movement with random wait times and clicks buttons like a real person (basically it can't be pixel perfect clicks every time
Pauses and alerts me when a human verification shows up
There is already a program that can do this that doesn't require coding skills called Browser Automation Studio but it costs money and feels somewhat limiting. Here is a video on how it looks when developing a bot https://youtu.be/K-jT-GwjTjg?t=2524
When you compile a bot and run it it will open up a headless chrome (I think that's what you call it) app with a separate mouse, that program can be minimised and will run in the background with no problem. I know I could just use this program but I want to learn how to code this bot on my own.
I have gone to uni for web development (failed final year oof) so I know a bit of how code works and just need some pointers on how I can start this project. From my research it seems python selenium would be good but I can't find anything on making a separate mouse so That when the bot is running I can still use my pc for other stuff.
Thanks in advance.

Related

Can Selenium handle Browser Notifications in the OS?

In the screenshot below, I make a VoIP call from an incognito window to an account logged in in a normal Chrome window that is minimised. Therefore I receive the Chrome notification in the bottom right corner.
I am tasked with creating a front-end test to validate the text in the notification window, that would work for Windows, Linux, and MacOS situations.
Now this may or may not be a silly question, but is there a way that selenium can handle tasks related with this notification, for example validating the text that appears in it? I can't find anything online and I understand it is not a DOM element, so I wonder if it is even possible. Could someone provide a basic start point for finding this non DOM notification element if it is possible / how to go about testing it in the front end if selenium is not the answer? TIA.
Notification example

AppleScript to access system Now Playing, without iTunes

I'd like to have a script that does something every time the current playback changes, i.e. something different is displayed in the Now Playing widget in Notification Centre. All the solutions I found involved telling iTunes to give AppleScript the information, however, my script shouldn't work solely with playback from iTunes, but primarily Safari (SoundCloud web). Any way Now Playing data is accessible using AppleScript, independent of iTunes?

VB.Net automate flash in WebBrowser

I've passed many hours searching the web for a solution to something which seems obvious, but without results.
I need to automate a task in a Flash application running on my intranet.
I can't change the Flash application nor do I have access to the source code.
it's not a Flash movie but an application.
I can't download the swf.
I'm using a WebBrowser in a form. The Flash app is displaying without issues.
So far, I have been able to automate the task (clicking on some buttons, then inputting text and finally saving the results on a server). It works but it's not clean at all because I use hard-coded timers to wait a given action is done and then I click on very specific point at given coordinates in the application.
What I would like to do:
Avoid hard-coded timers. the Flash application takes some time to display all elements on the window (from 20 to 60+ sec). I would like to be able to detect when all elements are loaded. I tried to retrieve the text of the windows handle, but while I can retrieve the Flash hwnd, I can't retrieve the content (through messages).
In brief, instead of waiting 60sec (and not being 100% sure it's enough), if the last element to load in the Flash app has "ABC" written in it, I would like to detect it's displayed so that I can continue the sequence (click on the next button).
I'm using VB.net. Any hints to achieve that would be appreciated.
Lol. I am trying to do the same thing but with no results. You can try to see if there are POST/GET codes that can help you if the application has an online nature. Other than that you can only simulate clicks, because flash can't be easily interacted with. This is why most of the things are going to swap with HTML5 now.

Controlling USB keyboard and mouse

We have a hardware device, with an LCD display. It supports an USB interface to connect keyboard and mose. Using these keyboard and mouse, we can navigate to varios menu items and edit entries.
We have couple of test cases written to verify that mouse click and keyboard input events are working when pressed respective key.
My task is to automate these test cases.
I donot have any control to the hardware device, as I can not access the o/s kernel or any application running there. There is one way to verify what is currently displayed on the UI. So I have to use that and verify whether the mouse/keyboard has performed the appropriate events.
As I have gone through couple of previous posts, it seems like that one of the way to achieve this is through virual HID device driver rather than actual keyboard and mosue. But I am not sure how to achieve it.
Please do help me for it. I am fine with any programming language.
I am more interested to simulate the mouse and keyboard events.
You probably don't need to write your own driver. AutoHotKey does pretty much anything you can think of, and the scripting language is quite easy to learn.
You can get it here:
http://www.autohotkey.com/
Since you're using linux, here's a similar project that will run on linux:
http://sikuli.org/

Sending keystrokes/mouse clicks to a Java program with Autohotkey

Im trying to send keystrokes and mouse movements to a Java program but once the applicaton has focus nothing is sent. It's as if the Java application takes focus of everything because Autohotkey stops responding. Everything works fine in a regular Windows app (e.g. Notepad).
I've tried using various send methods (Send, SendInput, and SendEvent) but nothing works. Does anyone have any suggestions?
The program in particular is ThinkOrSwim's ThinkDesktop.
I was able to get my script running with ThinkOrSwim by running the SciTE editor as Administrator [or running the compiled scripts as Administrator].
The TOS UI had some refresh issues but my scripts went through fine to do what I needed to do.
Some playing around I've discovered that TOS on Mac OSX can be controlled via scripting with Keyboard Maestro. It's a ugly, hacked solution, but it works. You can edit text boxes and click stuff if you know the X,Y position of elements.
Keyboard Maestro can be run via scripts (AppleScript, Python, etc.) so maybe you can build some elaborate rube goldberg.
I suggest you use Easy Macro Recorder
http://download.cnet.com/Easy-Macro-Recorder/3000-2094_4-10414139.html
Its a great tool to automate keystrokes and mouse movements.
Hope this helps :)