same script, different computers, different results...

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
arathra
Posts: 23
Joined: 29 Aug 2016, 06:22

same script, different computers, different results...

11 Mar 2017, 02:21

This is a very general enquiry as I'm only starting to debug now and there's a lot to go through. Before I get into the nitty-gritty I'm wondering if there's something obvious I should look at first or if someone else has had a similar experience.

The Problem:

Basically I have a script which opens a series of webpages; it opens a page, analyses it, writes the results to a text file, and then closes it, then opens the next page, etc.

When I run it on my Win 10 desktop it takes about 10+ hours to complete with very thorough results. When I run it on a Win 10 laptop it "completes" within about half that time, with very few results, and a number of the pages it opens do not close (leaving the browser with a whole bunch of open tabs, sometimes crashing the laptop). It's obvious the laptop is not running the script properly (or rather, the script does not work properly on the laptop).

The script is about 900 lines long so there's a lot of places where the script could be going wrong but since the script isn't changing, it must be a problem with the configuration of the two computers. But for the life of me I can't imagine what that could be. I'm not even sure where to begin in trying to debug this!

Any hints or ideas welcome!
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: same script, different computers, different results...

11 Mar 2017, 04:52

It could still be the script, if it for instance relies on the speed of the desktop computer, assuming it's faster then the labtop.

Are you using COM or do you rely on some other approach ?
Please excuse my spelling I am dyslexic.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: same script, different computers, different results...

11 Mar 2017, 04:58

The facts that the non-functioning script takes less time to complete could mean it waits insufficiently, or because it doesn't get the data right there's less to analyze.

How do you detect the page is done loading and how do you get the data of it? If you're doing WinWaitActive,Title, it may be the page loads too slow, updating the title but not having the full content yet. In that case you could add some static Sleeps after it, although that still allows for errors.

Without code it's impossible to say. Then again, with a lot of code it's tiresome to look through. So try to isolate parts of your code and run them repeatedly to narrow down the source of the error.
arathra
Posts: 23
Joined: 29 Aug 2016, 06:22

Re: same script, different computers, different results...

11 Mar 2017, 05:23

So far as I can tell the script is dropping out in the middle for some reason. I tested it on a different laptop and it works fine. The laptop where it doesn't work is fairly new, decent spec and so on.

I'm having to go through the script very slowly to isolate the problem but it *appears* that it has something to do with the actual functioning of the laptop. Perhaps SendInput keystrokes are being treated differently?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mstrauss2021, william_ahk and 366 guests