Jump to content

xxaviarxx

Active Members
  • Posts

    63
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

xxaviarxx's Achievements

Wayfarer

Wayfarer (2/7)

2

Reputation

  1. 1. You know I make scripts that could be done in better ways using different functions etc it is all part of how I learn about different things that I find. Could I make it all a different way using file searching etc yes and I have before but what i want to learn is image search and things related to image search so I am making it this way. 1a. If I wanted to turn my script into a game bot I would not be posting anything about it in general on AutoIt I would be using another website who allows such a thing. 2. I said to help me find viruses not to make an anti-virus which I do manually because anti-virus software is crap. 3. Your moderator was treating me as a liar and an idiot. Now even excluding the Laws and Rights of my country (which do impose upon websites in general) he still called me an idiot and a liar. Once that is corrected because obviously no one but myself seems to care about that or at least no one has mentioned openly anything concerning it, I will put an amendment into my previous post, but not until then. 4. If I get locked or banned because of this post or my previous post so be it, I really am not all that concerned about it as i stated before there are other websites i can get help on in general. Just know that violating laws and rights of countries who impose the laws and rights of their citizens onto all websites that are allowed to be viewed in their country is grounds for legal action (check into facebook's, as an example, legal problems in the past for more information). I am sure the Owner's team would not want such a thing to happen to the Owner as he/she is directly responsible for the actions taken by the team. 5. #3 holds true for this post as well I will make an amendment once the matter of the moderators (now 2) in question is taken care of. My quarrel is only with the moderators (now 2) who insulted me by saying what I am doing is unbelievable/nonsense, Yes I know that me using image search for something other than a game bot raises flags however those flags should not be present as I have explained what I am using Image search for. And as a side note the only game I have on my computer is Diablo I reworked my script a bit to even see if I could use it for such as the moderators in question are hinting at but where it changes so many parameters in how autoit defines screen resolution in general (yes i tried client modes as well) it does not work, of course I could be missing a simple function which could allow it to happen, but this is not what the script is being made for so I could care less about the function I am missing. Now have a nice day and hopefully the Team's wording on such things and Quoting improves to where this sort of thing does not happen in the future. I never had a problem with you Melba until today you should know out of everyone here I do things weirdly and differently than a lot of people on here.
  2. The fileinstall helpers seem interesting i will have to look those up and see what i can accomplish through them hopefully there is something to add in a image folder if not there might be a way to add a dir that the exe looks through even if its not inside the exe. i have no idea what im trying to say i just woke up after sleeping for right around 15 hours but hopefully i'm making sense ill check back after i fully awake to see if i did.
  3. Well at the current time my code is stuck and in my help post This Post every once in a while I am getting an error after the icon is moved which I am manually moving, I was using the firefox icon just to test if imagesearch will actually find it which it does 9/10 times. Sorry if you cannot believe the truth when someone writes it. How I do things is my own choice if I want to use PixelSearch to speed up my virus searching I will make a script for it. This post is meant for me learning about autoits imagesearch UDF and other things dealing with what was found inside of the UDF. Now as it has been over 4 hours and you obviously have not locked either topic because you can not do it as there is no violation of the rules for using ImageSearch for something other than a game bot. Kindly remove your post as it is potentially halting any and all help I may receive in the future, by it being slanderous and defamation of character as you are quite effectively calling me a bold faced liar, OR kindly rephrase it for aforementioned reasons. Slanderous : A false and malicious statement or report about someone Defamation of character : is a term that is used to describe when false statement is written or spoken about an individual with the intent of harming or slandering their reputation. Both are accurate considering how your post is worded.
  4. This is going to be my personal Help location until I complete my script and here is the first (of more than likely many) topic/question. Hopefully my coding niceties have improved somewhat since I last posted code on this forum. Script :: ; Start of the Script Code ; Stuff that was taken from the ImageSearch.au3 file to make this thing not throw DllCall Error = 1 even when I had included ImageSearch.au3 file Not sure what it all does YET but it fixed my problem so whatever for now. #RequireAdmin #AutoIt3Wrapper_UseX64=y #include <WinAPIFiles.au3> ; for _WinAPI_Wow64EnableWow64FsRedirection #include <Misc.au3> If Not FileExists("ImageSearchDLLx32.dll") Then FileInstall("ImageSearchDLLx32.dll", "ImageSearchDLLx32.dll", 1) ;FileInstall ( "source", "dest" [, flag = 0] ) If Not FileExists("ImageSearchDLLx64.dll") Then FileInstall("ImageSearchDLLx64.dll", "ImageSearchDLLx64.dll", 1) If Not FileExists("msvcr110d.dll") Then FileInstall("msvcr110d.dll", "msvcr110d.dll", 1) ;Microsoft Visual C++ Redistributable dll x64 If Not FileExists("msvcr110.dll") Then FileInstall("msvcr110.dll", "msvcr110.dll", 1) ;Microsoft Visual C++ Redistributable dll x32 Local $h_ImageSearchDLL = -1 ; End Copy and Pasted stuff ; Sets the location of the image files it is a nice workaround for when you do not want your main script area flooded with hundreds of pictures. Global $imgloc = @ScriptDir & "/Search/Images/Default/" ; Sets the variables for the X and Y coords of the icon to blank for use by the Start() function Global $IconX, $IconY ; Sets how the mouse reads coords 1 = absolute coords meaning the entire screen area Opt("MouseCoordMode", 1) ; INI File Settings ; $Variable = Reads From INI file (At where the script is located and then add a \ then add the File Name of the INI, Sets the section name which in the INI file is surrounded by [ ], Sets the Key name in the INI file and then adds a = without spaces, Sets the DEFAULT Key Value to the variable inputed for HotKeys it must be surrounded by { } for Integers just the number will suffice For $Variables I would guess that it takes the $Variable parameter and sends that to the INI file, never tried it) ; [Hotkey Settings] $hkplay = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Play", "{F1}") $hkstop = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Stop", "{F2}") $hkrefresh = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Refresh", "{F3}") ; [Speed Settings] $mSpeed = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Movement Speed", "4") $cDelay = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Click Delay", "100") $mDelay = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Movement Delay", "100") ; [Image Settings] $fImg2 = IniRead(@ScriptDir & "\Settings.ini", "Image Settings", "Icon", "firefox.bmp") ; End INI File Settings ; HotKeySet Settings ; Sets the Hotkey for the Start Function as defined in the INI file by a key surrounded by { } or via the defualt key set by the above " ; INI Settings HotKeySet($hkplay, "Start") ; Sets the Hotkey for the Stop Function as defined in the INI file by a key surrounded by { } or via the defualt key set by the above " ; INI Settings HotKeySet($hkstop, "Stop") ; Sets the Hotkey for the RefreshSettings Function as defined in the INI file by a key surrounded by { } or via the defualt key set by the above " ; INI Settings HotKeySet($hkrefresh, "RefreshSettings") ; End HotKeySet Settings ; While the script is started sleep for 100 ms then restart the while loop too keep the script running While 1 Sleep(100) WEnd ; End of keeping the code running section ; Begin main Functions ; Names the Function Start() to be called upon by anything else in the script Func Start() ; Search for the image from the script directory sub-folders and returns the X and Y value of said image when found $1a = _ImageSearch($imgloc & $fImg2, 1, $IconX, $IconY, 25, 0) ; If image is found then do below code If $1a = 1 Then ; Move the mouse to the X and Y Coords of where the image of the icon was found at the speed which was set in the INI file or If it was not set at the default speed of 4 MouseMove($IconX, $IconY, $mSpeed) ; Random tooltip confirming that it did complete the required code above not really needed but I like visuals to confirm things ToolTip("Found Icon and Moved Mouse to Location", 0, 0) ; If Image was not found then do the below code Else ; My nice little info box that tells me what went wrong helped me to figure out a DllCall Error = 1 when $la returned as such. Now that it does not do that I changed it to the new first line MsgBox(0, "Error", "IconX and/or IconY did not change when you moved the icon!" & @CRLF & "Image Location : " & $imgloc & @CRLF & "Image Name : " & $fImg2 & @CRLF & "X position : " & $IconX & @CRLF & "Y Position : " & $IconY & @CRLF & "Found Image : " & $1a) ; Ends the If $1a statement EndIf ; Ends the Start() function EndFunc ;==>Start ; Names the Function RefreshSettings() to be called upon by anything else in the script Func RefreshSettings() ; $Variable = Reads From INI file (At where the script is located and then add a \ then add the File Name of the INI, Sets the Section name which in the INI file is surrounded by [ ], Sets the Key name in the INI file under the Section name and then adds a = without spaces on either side, Sets the Key Value without spaces on either side to the variable inputed in the INI. For HotKeys it must be surrounded by { } for Integers just the number will suffice For $Variables I would guess that it takes the $Variable parameter and sends that to the INI file, never tried it) ; [Hotkey Settings] $hkplay = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Play", "") $hkstop = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Stop", "") $hkrefresh = IniRead(@ScriptDir = "\Settings.ini", "Hotkey Settings", "Refresh", "") ; [Speed Settings] $mSpeed = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Movement Speed", "") $mDelay = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Movement Delay", "") $cDelay = IniRead(@ScriptDir & "\Settings.ini", "Speed Settings", "Mouse Click Delay", "") ;[Image Settings] $fImg2 = IniRead(@ScriptDir & "\Settings.ini", "Image Settings", "Icon", "") ; Ends the RefreshSettings() Function EndFunc ;==>RefreshSettings ; Names the Function Stop() to be called upon by anything else in the script Func Stop() ; Tells the script its time to shutdown, If a dialog box made by the script is active and you try to close/stop the script the script will close only after the dialog box closes Exit ; Ends the Stop() Function EndFunc ;==>Stop ; End Main Functions ; Start more Copy and Pasted stuff to prevent that DllCall Error = 1 ;-------------------------------------- ; Image Search Stuff (no Documentation) ;-------------------------------------- Func _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency) Return _ImageSearchArea($findImage, $resultPosition, 0, 0, @DesktopWidth, @DesktopHeight, $x, $y, $tolerance, $transparency) EndFunc ;==>_ImageSearch Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance = 0, $transparency = 0) ;Credits to Sven for the Transparency addition If Not FileExists($findImage) Then Return "Image File not found" If $tolerance < 0 Or $tolerance > 255 Then $tolerance = 0 If $h_ImageSearchDLL = -1 Then _ImageSearchStartup() If $transparency <> 0 Then $findImage = "*" & $transparency & " " & $findImage If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage $result = DllCall($h_ImageSearchDLL, "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage) If @error Then Return "DllCall Error=" & @error If $result = "0" Or Not IsArray($result) Or $result[0] = "0" Then Return False $array = StringSplit($result[0], "|") If (UBound($array) >= 4) Then $x = Int(Number($array[2])) ; Get the x, y location of the match $y = Int(Number($array[3])) If $resultPosition = 1 Then $x = $x + Int(Number($array[4]) / 2) ; Account for the size of the image to compute the centre of search $y = $y + Int(Number($array[5]) / 2) EndIf Return True EndIf EndFunc ;==>_ImageSearchArea Func _WaitForImageSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) $waitSecs = $waitSecs * 1000 $startTime = TimerInit() While TimerDiff($startTime) < $waitSecs Sleep(100) If _ImageSearch($findImage, $resultPosition, $x, $y, $tolerance, $transparency) Then Return True EndIf WEnd Return False EndFunc ;==>_WaitForImageSearch Func _WaitForImagesSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) $waitSecs = $waitSecs * 1000 $startTime = TimerInit() While TimerDiff($startTime) < $waitSecs For $i = 1 To $findImage[0] Sleep(100) If _ImageSearch($findImage[$i], $resultPosition, $x, $y, $tolerance, $transparency) Then Return $i EndIf Next WEnd Return False EndFunc ;==>_WaitForImagesSearch Func _ImageSearchStartup() _WinAPI_Wow64EnableWow64FsRedirection(True) $sOSArch = @OSArch ;Check if running on x64 or x32 Windows ;@OSArch Returns one of the following: "X86", "IA64", "X64" - this is the architecture type of the currently running operating system. $sAutoItX64 = @AutoItX64 ;Check if using x64 AutoIt ;@AutoItX64 Returns 1 if the script is running under the native x64 version of AutoIt. If $sOSArch = "X86" Or $sAutoItX64 = 0 Then cr("+>" & "@OSArch=" & $sOSArch & @TAB & "@AutoItX64=" & $sAutoItX64 & @TAB & "therefore using x32 ImageSearch DLL") $h_ImageSearchDLL = DllOpen("ImageSearchDLLx32.dll") If $h_ImageSearchDLL = -1 Then Return "DllOpen failure" ElseIf $sOSArch = "X64" And $sAutoItX64 = 1 Then cr("+>" & "@OSArch=" & $sOSArch & @TAB & "@AutoItX64=" & $sAutoItX64 & @TAB & "therefore using x64 ImageSearch DLL") $h_ImageSearchDLL = DllOpen("ImageSearchDLLx64.dll") If $h_ImageSearchDLL = -1 Then Return "DllOpen failure" Else Return "Inconsistent or incompatible Script/Windows/CPU Architecture" EndIf Return True EndFunc ;==>_ImageSearchStartup Func _ImageSearchShutdown() DllClose($h_ImageSearchDLL) _WinAPI_Wow64EnableWow64FsRedirection(False) cr(">" & "_ImageSearchShutdown() completed") Return True EndFunc ;==>_ImageSearchShutdown Func cr($text = "", $addCR = 1, $printTime = False) ;Print to console Static $sToolTip If Not @Compiled Then If $printTime Then ConsoleWrite(@HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC & " ") ConsoleWrite($text) If $addCR >= 1 Then ConsoleWrite(@CR) If $addCR = 2 Then ConsoleWrite(@CR) Else If $printTime Then $sToolTip &= @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC & " " $sToolTip &= $text If $addCR >= 1 Then $sToolTip &= @CR If $addCR = 2 Then $sToolTip &= @CR ToolTip($sToolTip) EndIf Return $text EndFunc ;==>cr ; End of the last of the Copy and Pasted stuff ; End of the Script INI File :: [Hotkey Settings] Play={F1} Stop={F2} Refresh={F3} [Speed Settings] Mouse Movement Speed=4 Mouse Movement Delay=100 Mouse Click Delay=100 [Image Settings] Icon=firefox.bmp Here is the first problem of more than likely many problems yet to come. Sometimes when I manually move the icon while the script is running (for testing purposes I used firefox) my nice little message box pops up and shows me that the X and Y coords of the icon did not change after the icon was moved and the script started again by pressing F1. Is there a way to reset the X and Y coords every time I call Start() I know the $1a is supposed to do this but apparently it is not 100%, and I do not understand why. Any help is greatly appreciated as always. I will try any suggestions to forcibly make the script forcibly have $1a search again for new coords after finding it once already.
  5. It might not be the complete solution but I like creating things so that is what I am doing. Over the course of the last 5 or so years we have spent hundreds on antiviruses that they keep somehow bypassing so I have given up almost entirely on them actually catching and preventing my family from screwing up their pcs.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. Edited my post, Im trying to understand how these things work to implement them properly and with full understanding for my comment documentation.
  11. 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?
  12. 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.
  13. 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.
  14. 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.
  15. 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 . 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.
×
×
  • Create New...