Restarting iMacro automatically when it freezes?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Restarting iMacro automatically when it freezes?

Post by Legalien » Tue Sep 24, 2019 8:22 am

I use Windows 10 | Firefox Portable v55 | iMacros 8.9.7

So I bought a PC last month and I run 57 Firefox browsers on it 24/7. Sometimes a script will freeze, I think always on a "FRAME" command. And when a script freezes the world stops for that browser until I check and restart the script.

However, restarting is as simple as clicking stop, and then clicking play... This can be automated!

So I'm thinking of solutions. One would be to make the script somehow to never get stuck, but I don't think this is possible.

Another is perhaps a different Firefox extension which would monitor a browser, and for example after 10 minutes of inactivity it would click stop, and then click play. But I'm not sure if an extension would be able to click buttons on the iMacro window on the left. I'm not sure if that's possible.

Another is maybe an AutoIT script. But again, I'm not sure if AutoIT would have the power to "interact" with a browser to such a level to where it would be ableto click the buttons on the iMacro window.

How can I make this happen?

Thanks :)
Buy Social Media Services - https://Socialesale.com
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Restarting iMacro automatically when it freezes?

Post by rstancuna » Tue Sep 24, 2019 8:53 pm

Both AutoIT and AHK support clicking on XY coordinates so they can click stop and play. Could set them to either check window title (in case your macro will visit different page/websites) then focus the window and click stop then play again.
Another option is to set a main script as homepage url in each browser (have set to show homepage when browser starts) and have the browser restart via external program (AHK, AutoIT, batch script, etc) every X minutes, this is actually very simple and fastest.
Waterfox 56.2, iMacros V8.9.7 on Windows
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Tue Sep 24, 2019 11:02 pm

Good ideas. But they won't work.

The first one won't work because the script doesn't always freeze on the same page. If it did I would probably try to figure out why or do something differently. It freezes on a page once every 1000 visits or something. So I can't have the script restart based on the page it visits, but it must restart (stop/play) based on getting frozen, because it got frozen.

The second one won't work because, well, for one I'm sure it would be prone to errors, like a browser trying to restart and not actually reStarting, and god knows what else. But even if it wasn't, I don't want to set iMacro address as homepage url because I often need the browsers to open without auto-starting, so that I can change proxies or whatever it may be. And lastly, I run 57 Firefoxes on my PC. Usually it's a struggle to open them all and run iMacros without blackouts and crashed browsers and things. And when I manage to turn them all on, it works like a charm for 2-3 days. But putting browser restarts in the mix is a recipe for disaster :D

The solution I want is something that will monitor each browser, and if a browser hasn't opened/closed any tabs or reloaded any pages in over 10 minutes, then click stop, and then click play. I'd love a Firefox extension to do it, but I would pretty much accept any solution as long as it works.

I guess if I don't manage to get that (of course I could probably throw a ton of money at it and get it taken care of, but let's keep it real I'm not gonna spend a lot of money on this), then I may get a Firefox extension made that will replace the iMacro clicks that have "FRAME" in front of them. I figure, if "FRAME" is where it always gets stuck, remove the FRAME thing from the script. So completely remove that specific click and have a different extension only for doing that click.

Of course, I'm unsure how iMacros would feel about a different extension doing the click. Maybe that would also cause the iMacro to freeze, as something else is clicking on the screen while iMacro is running.

Anyway, do you see any other solution?
Buy Social Media Services - https://Socialesale.com
User avatar
thecoder2012
Posts: 358
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by thecoder2012 » Tue Sep 24, 2019 11:57 pm

Legalien wrote:
Tue Sep 24, 2019 11:02 pm
Anyway, do you see any other solution?
Yes but no time and it's easier with your example. And with stable browsers (e.g. Basilisk, Waterfox, Pale Moon). Good luck! :wink:
Legalien wrote:
Tue Sep 24, 2019 8:22 am
Another is perhaps a different Firefox extension which would monitor a browser, and for example after 10 minutes of inactivity it would click stop, and then click play. But I'm not sure if an extension would be able to click buttons on the iMacro window on the left. I'm not sure if that's possible.
Is it possible to stop iMacros through Greasemonkey?, How to Click play Button on Flash typed Content and more.
Legalien wrote:
Tue Sep 24, 2019 8:22 am
How can I make this happen?
Use a little more javascript. (e.g. eval or url goto with javascript)
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Restarting iMacro automatically when it freezes?

Post by rstancuna » Wed Sep 25, 2019 12:04 am

Legalien wrote:
Tue Sep 24, 2019 11:02 pm
The solution I want is something that will monitor each browser, and if a browser hasn't opened/closed any tabs or reloaded any pages in over 10 minutes, then click stop, and then click play. I'd love a Firefox extension to do it, but I would pretty much accept any solution as long as it works.
Maybe others may have some better ideas but here are 2 ugly ways:
1. Have AHK (maybe it works with AutoIT as well) monitor the changes in window titles and if the title of a window hasn't changed in 10min then focus window > click stop > click play . This is probably the best of the two.
2. Have each iMacros write to a separate file after each tab close (maybe?) and make AHK (maybe it works with AutoIT as well) loop through a folder containing those files and if a file date is older than 10min then focus the window of that respective file > click stop > click play .
Waterfox 56.2, iMacros V8.9.7 on Windows
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Fri Sep 27, 2019 4:32 pm

rstancuna wrote:
Wed Sep 25, 2019 12:04 am
Legalien wrote:
Tue Sep 24, 2019 11:02 pm
The solution I want is something that will monitor each browser, and if a browser hasn't opened/closed any tabs or reloaded any pages in over 10 minutes, then click stop, and then click play. I'd love a Firefox extension to do it, but I would pretty much accept any solution as long as it works.
Maybe others may have some better ideas but here are 2 ugly ways:
1. Have AHK (maybe it works with AutoIT as well) monitor the changes in window titles and if the title of a window hasn't changed in 10min then focus window > click stop > click play . This is probably the best of the two.
2. Have each iMacros write to a separate file after each tab close (maybe?) and make AHK (maybe it works with AutoIT as well) loop through a folder containing those files and if a file date is older than 10min then focus the window of that respective file > click stop > click play .
I'm happy to report that I paid someone to create an AHK script which monitors for window title changes every X seconds (For example 60 seconds), and it does it 10 times. And if after 60 sec X 10 times = 600 seconds = 10 minutes there are no changes in window title on any of the checks, then it centers that window and clicks stop, and then play.

I'm still testing, but seems to work.

The problem I have now is the iMacro interface sidebar panel window. On some of my browsers it's one size, on others it's a different size :cry:

I use iMacros 8.9.7 on all browsers, and all browsers are Firefox Portable 55, and everything is on the same lap top. How can some browsers have a different size iMacro interface panel than others? :shock:

In any case, how can I fix this other than checking all the browsers and then re-creating the ones that have a different size than the one I want?
Buy Social Media Services - https://Socialesale.com
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Fri Sep 27, 2019 4:36 pm

I tried reinstalling the extension on a browser with one size iMacro panel window, and on a browser with a different size.

After installing and restarting, both browsers still have a different size.
Buy Social Media Services - https://Socialesale.com
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Fri Sep 27, 2019 4:53 pm

Well that's weird.

So I ran a script on both browsers that have different iMacro window size, and then I clicked the iMacro icon on both of them to see if when iMacros is running minimized there is any difference in size. And there was no difference. But then after clicking the iMacro icon again, both sidebar windows were opened at the same size :)

So I'm going through the painful process of opening and closing about 80 Firefox browsers one by one, to see if any others have a different size than they should. I found one more. So I ran a script on it, and while the script was running I clicked the iMacro icon to minimize it, and then I clicked the icon again, and the sidebar window got restored to the proper size. Then I closed that browser and opened it again, and when it opened it had the correct size to it. Very nice :)

I'll test all browsers, hopefully this "fix" works on all of them. Also if it works, hopefully it persists as time goes by and I shut down and restart my computer etc.

Found a bunch more problematic ones, and the "fix" fixed it for all. I hope it persists.
Buy Social Media Services - https://Socialesale.com
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Fri Sep 27, 2019 6:02 pm

Okay, so that didn't fix it. But I did figure out what causes it.

It's the ad in the lower left of the window :|

When the ad shows "Ipswitch iMacros" then the position of the buttons in the window changes a little bit because that add had an increased height to it.

When the ad shows "More Ipswitch products" (and it usually shows this one) then the position of the buttons is where it should be (or where it usually is anyway because this ad is usually the one that appears). This ad has a smaller height to it than the other one.

So... ohhh... any solutions?
Buy Social Media Services - https://Socialesale.com
Legalien
Posts: 66
Joined: Mon Feb 15, 2016 6:47 pm
Contact:

Re: Restarting iMacro automatically when it freezes?

Post by Legalien » Fri Sep 27, 2019 6:17 pm

Okay so I fixed it. I hope you're won't hate on a brother :mrgreen:

I downloaded the iMacro extension and went inside the files and folders, located the 1 photo that is larger than the rest, and replaced it with one of the other ones. So now all 4 photos are the same size.

I installed it and tested, and now all ads are the same size, and now my AHK solution can work perfectly...

...I just have to install my edited iMacro extension .xpi on all my Firefoxes. Ugh that's gonna take some time, I have a lot of browsers here :evil:
Buy Social Media Services - https://Socialesale.com
Post Reply