Jump to content

A few questions about Image Search


 Share

Recommended Posts

After being gone from the autoit scene for a pretty good while, here I am again lol. These questions pertain to what I can or cannot do using Image search, of which I have searched google using and not using the site: command.

1. Can someone explain to me how This Post (minus the deleting part) actually works I do not understand as the help file is rather vague on many if not most commands such as UBound. I am hoping that this is actually what I am looking for so that I can start working on a script that works across windows platforms as I have many different versions in this house. What I am trying to accomplish is that it search for icons for example My Computer.bmp (xp/vista/7/8/8.1/10) and if the image from the array is found it clicks it or at least moves the mouse to it, where windows loves to make new and "improved" icons :rolleyes:.

 

2. (For when I make this into an exe so I dont need autoit on all the computers in my house)... Will fileinstall work to add in any au3 files and if they have file installs do those get added in as well? For example my script fileinstalls ImageSearch.au3 and it has the dlls to file install will they continue to work and get put into the exe file? Or is there a better way to do this?

 

3. Fileinstall question 2 : Does fileinstall support installing everything from a folder or do i have to add a million lines of code just for the installs or is there a way to do it using arrays for the icon images? So I can keep an organized file and script structure before and after the install.

 

4. How do I include an entire folder and all sub folders of images for Imagesearch to look through I know there used to be a way like #include <Imagefolder/*> or maybe that was a different language. That way I can stay organized (again).

 

5. I know there is a transparency and tolerance setting for ImageSearch and the documentation inside of that post is fairly helpful however I do not fully understand them. For example and for lack of better terms the recycle bin is ethereal (diablo item term) or semi-transparent in some versions of windows or for example my brother's pc in which he did some crazy things to his icons to make it so the desktop shines through them which I don't understand how he did that or if it was something he found online, anyway how do I set these parameters to still be able to get that icon.

 

I think that just about covers all the questions I had concerning ImageSearch which i got from This Post. I have not yet started on the script so I have nothing to show for what I have already done minus hotkeys (which anyone can do that so I see no need to post that tiny bit of code), As I am wanting to make this script compact and easy to follow along with for debugging, there will be more than likely 3 scripts 1 for handling the icons 1 for the main code and 1 is imagesearch. All of which I want in a single exe with the images and dlls so im not looking through hundreds of images to find my start script.

 

If anything is vague please do tell me how to make it a clearer picture for you, to be frank I suck as being very descriptive at least in my own opinion.

Link to comment
Share on other sites

  • Developers
7 minutes ago, xxaviarxx said:

I do not understand as the help file is rather vague on many if not most commands such as UBound.

Seriously?  So you move from sloppy code writing to insulting ? :idiot: 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Just now, Jos said:

Seriously?  So you move from sloppy code writing to insulting ? :idiot: 

Jos

Well it is rather vague but I apologize if it upset anyone by calling it as I saw it. There is hardly any information explaining commands to someone who has never used it before. Granted there is a list of things you can do with it inside the parameter sections but other than that there is nothing worth noting such as a beginners lesson on how it functions what it does etc. I haven't seen the help file change in this manner at all over the years I've played with it.

Link to comment
Share on other sites

  • Developers

Sad you're even trying to justify what you wrote and making that none-apology , but will get out of your hair and wish you all the best with your scripting endeavors.
Please ensure you re familiarize yourself with the forum rules as well as they might be updated since the last time you were here.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Just now, Jos said:

Sad you're even trying to justify what you wrote and making that none-apology , but will get out of your hair and wish you all the best with your scripting endeavors.
Please ensure you re familiarize yourself with the forum rules as well as they might be updated since the last time you were here.

Jos 

Ok I have just finished refreshing myself on the rules, seems as though nothing has changed or at least not from what i remember I think a couple things were updated to add some more "anti-im-getting-around-this-by" but other than that its pretty much the same.

Link to comment
Share on other sites

If you can read and understand the Forum's rules then you should equally well understand what the help on UBound tells you.

Which part of it do you find unclear or vague?

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

9 minutes ago, jchd said:

If you can read and understand the Forum's rules then you should equally well understand what the help on UBound tells you.

Which part of it do you find unclear or vague?

I understand that it takes a $array[$i] which is the array and the row then does some magic to make the code read what is in $i. However I do not understand exactly how this works for example In that post I am confused on why it is coded the way it is, is there a reason for it being that way, and will it not work otherwise, etc? Thus the reasoning behind my choice of words saying the help file is vague. I think I know the reasoning behind the for loop but at the same time why does it have to count down could it also count up instead? While I am on the subject of for loops last time I messed with one I had to change the code to a while loop because it I could not get it to count up no matter what I did.

 

 

Link to comment
Share on other sites

  • Developers

What about you open that Helpfile again and start at the beginning: Language Reference - Variables ?
There is a section on Arrays that explain how they work.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I was saying I understand the array part but not the UBound part except my wording was completely off, and I just now realized this.

Like for example is ubound going ok this array has X amount of variables in the row section lets give each of these a number and then based on that number lets give the code an output of the variable or is array handling the numbering and ubound is just reading and changing the number then the array gives out the variable based on that number?

Edited by xxaviarxx
Link to comment
Share on other sites

Reset yourself after this BSOD and use your debugging mode in slow steps.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Rather than inventing something out of  thin air (nothing of what you wrote is in the help), read again the help on UBound, sentence after sentence and stop where you hit a concrete block, then ask about that precise point which is unclear to you.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

The unclear part is how it is being handled. Does ubound count all the array variables even if $array knows the count already and then gives a number or does $array just give the number of variables inside of the [ ] to ubound, which would seem faster to me? Which is what I was trying just in a more dragged out way now if this summary is not clear enough I don't know what is.

Edited by xxaviarxx
Link to comment
Share on other sites

When you declare an array in AutoIt you need to explicitely declare the number of dimensions it has and the number in entries for each dimension.

You may have to increase the size of an array or shrink it within your code or pass an array reference to a generic function which needs to query about the array dimensions and size(s). The array internally holds the count of dimensions and number of entries. UBound is just a way to query those numbers, according to documentation. UBound doesn't count (enumerate) anything, it just provides read access to the dimension details.

 

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

This is why it had me confused according to the help file about ubound in the remarks section "Remember that for arrays the value returned is one greater than the index of the last element in the dimension as the count starts at [0]."

Thanks for the info.

Anyway now to the other questions i had dealing with the Fileinstall, imagesearch, and includes.

Edited by xxaviarxx
Link to comment
Share on other sites

Maintaining a "count" doesn't imply iterative enumeration. The wording means that AutoIt arrays are 0-based, but this last wording could eventually leave more beginners perplex, as it's known that computer use "base 2". Indeed it's pretty hard to be user-friendly, clear, precise and exhaustive altogether, without using pedantic phrasing or cryptic formulation (e.g. formal presentation).

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

If you're looking to open certain programs from different window versions then I would suggest using writing a script that scans for a program name.exe in the CMD, then saving the path to a .ini file and use a CMD command to open it. I just finished doing this at work for our mapping software distributed on different windows platforms. 

Edited by aa2zz6
Link to comment
Share on other sites

Well partially yes but mainly no. See my family can't keep viruses and such off their computers even with any antivirus you can think of... don't ask me how they can manage that but they do, I'm sure others here have or have had a similar issue... anyway normally i go in and search the registry, the drives, task manager, etc and take out anything and everything that doesn't belong in there like programs named aasfsdad.exe or whatever, once i remove all those i then run the antivirus again (and another program to clean up) to see if it finds anything after I am done, rinse and repeat until nothing is found and the computer is alive once more. Last time I had to do this it took me 12 hours to completely (well almost couldn't find 1 virus/malware/etc) remove the problem children of the computer. So I am doing this to decrease my workload while debugging their computers. Now I am sure there is a much easier way of doing this however I want to learn more about imagesearch for other uses well, and what better way than to use it for something as tedious as this lol.

 

Long story short I am the family's anti-virus.

Another reason I am using image search and not something else is because if i get enough knowledge into the UDF itself I may be able to create an ocr to speed up my searching even further, although I am sure that will take a lot more time to get done.

Edited by xxaviarxx
Link to comment
Share on other sites

Look at InunoTaishou example of scanning all the drives and check if a file exists. If the files return false from the CMD scan then I would look at the second link if you plan to keep the files on a thumb drive. I would have the program detect if the thumb drive exists. If the drive exist then I would run a command like below to run the program. Keep the script inside the folder so the @scriptdir can read programs.

$runfile = @scriptdir & "\bin\runme.exe"

Thumb drive

Edit - If you're getting viruses frequently I would tell them to stop adding bad programs that include junk lol

Maybe a better security program is required  :|

Edited by aa2zz6
Link to comment
Share on other sites

12 minutes ago, aa2zz6 said:

Look at InunoTaishou example of scanning all the drives and check if a file exists. If the files return false from the CMD scan then I would look at the second link if you plan to keep the files on a thumb drive. I would have the program detect if the thumb drive exists. If the drive exist then I would run a command like below to run the program. Keep the script inside the folder so the @scriptdir can read programs.

 

$runfile = @scriptdir & "\bin\runme.exe"

 

Well that would work for a normal program but searching for viruses is a different story especially if it multiplies using different names. See my OCR idea would be scanning the taskmanager with a default .bmp and checking the screenshot that autoit can do against the default then sending me a list of program names that are not in the default.bmp So I will have to make a OCR at some point using and linking images of text to create compound images of words or something I totally don't know how I am going to go about that just yet. Then and only then could filesearch work for finding viruses and unwanted programs, at least that is how I am seeing it atm.

 

Edited by xxaviarxx
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...