Reactivation of tethering software on disconnect

Discuss RoboTask here
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Reactivation of tethering software on disconnect

Post by xyberz »

New to this program and forum. This was recommended by a website from Google search on program automation. I'm hoping this program can do what it looks like it can do for my needs.

So basically I use a tethering program that randomly disconnects without any notification and I'm hoping that Robotask can help me accomplish what sounds incredibly simple to do and normally is when I have to do it manually.

The program I'm using is called PDANet and it runs in the systray. When it disconnects and I catch it, all I have to do is click the icon on the systray and then the popup menu comes up and I just select "Connect" again and it connects with no issues until it disconnects randomly later on.

I'm not sure what commands in the program that I need to use to monitor the internet connection when it disconnects, clicks the icon on the systray, and then selects "Connect" for me to reconnect the service. Since it's not a dial up connection, it doesn't show my app there as I'm sure you guys already know that it wouldn't.

Really need help on getting this task done. Any help is greatly appreciated and thanks ahead of time.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Reactivation of tethering software on disconnect

Post by Oleg »

How do you want to monitor of your application connection?
maybe you can use mouse actions and send keystrokes but you have to create your task yourself.
I don't know your environment and usage conditions of applicatiion...
Oleg Yershov
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Re: Reactivation of tethering software on disconnect

Post by xyberz »

The software itself doesn't need to be monitored in order to trigger any reactions from your program. The internet connection is what needs to be monitored for disconnection. Once the program detects that the internet connection has been severed, I need this program to click on the PDANet icon on the SYSTRAY to pull up the menu. I've attached screenshots of the icon and the menu with the option to be selected in the event of internet disconnection.
Icon.png
Icon.png (45.15 KiB) Viewed 11336 times
Connect USB.png
Connect USB.png (99.26 KiB) Viewed 11336 times
I hope I've given enough information and the screenshots help. Please let me know if there's any other info I can provide in order to help everyone understand more what I'm hoping to accomplish. Thank you
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Reactivation of tethering software on disconnect

Post by Oleg »

You can do this by Mouse actions and (maybe) Send keystrokes

For example find tray icon with action Find an Element by Image
Next you can do mouse click (left or right button - I don't know your application)
Next you can use keyboard simulation to select necessary menu Item and press enter. Or you can move mouse pointer and do mouse click

I repeat again: you have to make the task yourself. RoboTask is the tool only.
Oleg Yershov
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Re: Reactivation of tethering software on disconnect

Post by xyberz »

Oleg wrote:You can do this by Mouse actions and (maybe) Send keystrokes

For example find tray icon with action Find an Element by Image
Next you can do mouse click (left or right button - I don't know your application)
Next you can use keyboard simulation to select necessary menu Item and press enter. Or you can move mouse pointer and do mouse click

I repeat again: you have to make the task yourself. RoboTask is the tool only.
I understand the physical part of creating the task myself now, I need help with how to monitor the internet connection with the program so it can trigger the assigned task I need to create please.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Reactivation of tethering software on disconnect

Post by Oleg »

you can ping some web server. For example the Web server of your provider or GOOGLE.com
If you get invalid reply time the maybe the connection doesn't work.

If Ping service is disabled on server (in most cases) you can use Check HTTP address action to check the response of HTTP server
You will get an error if connection is lost.
read here how to handle errors: https://robotask.com/help/index.php?err ... essing.htm

You can check the connection for example every 30 sec (look at the Cyclic trigger). If the task determine the disconnection run the task to re-connect.

And and one final note: system ignores keyboard and mouse simulation in locked session. This is the property of system security. You can't fix it.
Oleg Yershov
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Re: Reactivation of tethering software on disconnect

Post by xyberz »

Ok, I've figured out almost all of it except the last couple of steps. So I have the software check http://www.google.com and if it returns an error, it triggers the "Click PDANet" task which goes to the specific location on the Systray and left clicks on the icon. The trouble I'm having left is after the menu pops up like that in the attached screenshot, getting the mouse to then move up the menu and to click "Connect USB". I've tried adding another move and click command in the "Click PDANet" task but the menu doesn't pull up at the location like in the attached screenshot. It opens up somewhere else on the screen thus nullifying the 2nd set of commands to move to a specific location and clicking on "Connect USB". So I removed those 2 extra commands and it works fine up to that point.

How do I get it to finish the last 2 steps which is to move the mouse up the menu after the icon is clicked and then left mouse click on "Connect USB"? I've tried adding another task as you can see under "Activate PDANet" which basically goes to the specific spot on the screen and then is supposed to click the selection "Connect USB" but it doesn't work. The menu just stays open and the program just repeats the cycle of checking the website and then on error completing the "Click PDANet" task. The cyclic cycle to check is every 10 seconds.

Hopefully I haven't confused anyone with what I said. It's always easier to see it for yourself rather than have it explained via words.
PDANet Menu.jpg
PDANet Menu.jpg (484.15 KiB) Viewed 11320 times
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Reactivation of tethering software on disconnect

Post by Oleg »

I don't see where you try to do something with PDANet...
The task checks the connection ... but does nothing else...
Oleg Yershov
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Re: Reactivation of tethering software on disconnect

Post by xyberz »

I've attached screenshots of the program and the tasks and their settings for you to see so far it looks good and I just need it to do 2 more steps which I can't get to work. The next step I need is for the mouse to move up the menu after the icon in the Systray is clicked and then select "Connect USB".

Hopefully these will help you see what I've done so far and hope it's correct.
1.jpg
1.jpg (326.63 KiB) Viewed 11315 times
2.jpg
2.jpg (118.82 KiB) Viewed 11315 times
3.jpg
3.jpg (163.15 KiB) Viewed 11315 times
Can only attach 3 files, need to add another response for the last attachment.
xyberz
Posts: 7
Joined: Mon Jun 01, 2020 5:54 am

Re: Reactivation of tethering software on disconnect

Post by xyberz »

Here's the last pic. As you can see for the "Click PDANet" task, it only has 2 functions which is to move the mouse specifically to the icon on the the Systray and then to left mouse click it. I have tried to add another "move mouse" and then "left click mouse" action but the menu that pops up shows on some other part of the screen instead of down by the Systray where it normally does without those 2 extra functions. So I took them off and then it works perfect up to that point.
4.jpg
4.jpg (190.57 KiB) Viewed 11315 times
Post Reply