
Nick3399
Active Members-
Posts
48 -
Joined
-
Last visited
Everything posted by Nick3399
-
FilePath is: C:\Users\robert\OneDrive\Desktop\TempFile.exe Block of relevant code is below: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save SaveOptions() Case $StartButton ;TAB1 of GUI If WinExists("[CLASS:QT373947473845]") Then $oBlah = WinGetHandle("[CLASS:QT373947473845]") $BSLoc = WinGetPos ("[CLASS:QT373947473845]") If $BSLoc[0] <> 0 or $BSLoc[1] <> 0 or $BSLoc[2] <> 800 or $BSLoc[3] <> 600 Then WinSetState ( $oBlah, "", @SW_MINIMIZE ) sleep(500) WinActivate($oBlah) WinWaitActive($oBlah) WinMove($oBlah, "", 0, 0, 800, 600) sleep(2000) Else WinActivate($oBlah) WinWaitActive($oBlah) sleep(2000) EndIf Endif EndSwitch WEnd The Case $StartButton is the line where I am trying to do an OR if run by TaskManager
-
I have a script that has a GUI and I have been running with a start button using the below code: Case $StartButton I would also like to try scheduling this using Windows TaskScheduler to run every morning at 8 AM EST. What would be the best way to add a condition to either start with the start button OR when TaskScheduler runs at 8 AM EST (or any specific time)? I am hesitant to just do 8 AM condition as it may increase processing a lot always looking at the time. Essentially what I am looking to have happen is for my computer to auto-unlock (login?) using task scheduler and run this script
-
Assigning a Variable to a Variable within a loop
Nick3399 replied to Nick3399's topic in AutoIt General Help and Support
Hi - first off thank you for the reply. I somehow seemed to get my code working without using either of the methods you mentioned. I have only tested so far using Messagebox but I am getting the expected values of 1 for the CXXSelect variables and only getting where value >= 15 and it is selected via GUI. Do you know why or how this is working? $CHN = 14 Global $CArray[10] For $i = 0 to UBound($CArray) -1 $CRR = "CRR" & $CHN $CExtract = StringSplit($CRR, " ") $C14Select = GUICtrlRead(Eval("C"&$CHN&"Select")) If Number($CExtract[2]) >= 15 and number($C14Select) = 1 Then MsgBox($MB_SYSTEMMODAL, "Title", $CRR & ": " & $C14Select, 10) endif $CHN = $CHN + 1 Next -
Hello, I am trying to loop through 15 times and change the variable each time but I do not think it is working even know it is showing the proper variable ($C14Select) in the messagebox popup. Essentially I have 15 iterations of $C14Select, but each one goes up in number, ie. $C15Select, $C16Select, etc. For each loop I am trying to change the variable to the corresponding $C__Select variable. When I change $C14Select in the messagebox portion to eval($C14Select) I do not get anything back so I am not sure if I am using that right either.. Note: all of my variables are already defined prior to this portion of the code. Is there something I am doing wrong or should the below code be working properly? $CHN = 14 Global $CArray[15] For $i = 0 to UBound($CArray) -1 $C14Select = "$C"&$CHN&"Select" IF number(GUICtrlRead($C14Select)) = 1 then MsgBox($MB_SYSTEMMODAL, "Title", GUICtrlRead($C14Select), 10) endif $CHN = $CHN + 1 Next Edit: Looks like this seems to give me the proper results in Messagebox: $CHN = 14 Global $CArray[10] For $i = 0 to UBound($CArray) -1 $CRR = "CRR" & $CHN $CExtract = StringSplit($CRR, " ") $C14Select = GUICtrlRead(Eval("C"&$CHN&"Select")) If Number($CExtract[2]) >= 15 and number($C14Select) = 1 Then MsgBox($MB_SYSTEMMODAL, "Title", $CRR & ": " & $C14Select, 10) endif $CHN = $CHN + 1 Next
-
😮 Oh my gosh! edit so I have just tried modifying the au3 file I’m using and I can’t seem to get it working 😕 My variables are not $aRet — they have a bunch of different variables throughout the script at each imagesearch line This is the imagesearch I am using also - its 2015 version ImageSearch2015.au3
-
I think for this I would have to modify of my mouseclicks referencing imagesearch to use the variable from screen to client which would be quite a bit as I have tons of different variables and variable names 😕 if there’s no single line way such as pixelcoordmode, I am prob going to just make my window location 0,0 so it will match the imagesearch coordinates between client and screen as that is just a 1 line fix
-
I tried looking at differences between pixels from old script and on new monitor but they didn’t seem to to align for everything unfortunately 😕 I decided to just redo everything with client coordinates so I don’t run into this issue again. the one issue I am facing with client coordinates though is imagesearch where it’s searching and returning screen coordinates instead of the client 😕 do you have any idea how to modify that by chance?
-
Hi all, I am having some trouble with imagesearch returning coordinates for client when I have called that out with AutoItSetOption for PixelCoordMode. I have the below set at the top AutoItSetOption("MouseCoordMode", 2)AutoItSetOption("PixelCoordMode", 2)AutoItSetOption("CaretCoordMode", 2) and imagesearch as : $T22= _ImageSearch("Images\T22.png", 0, $x3, $y3, 40) If $T22= 1 Then MouseClick("left", $X3, $y3) my client location is at 100,100 so when I am trying to click, X3 and Y3 are both +100 because it’s returning the screen coordinates
-
okay, I think I was able to fix those but now ImageSearch is clicking on the wrong pixel using the client setting I have the below set at the top AutoItSetOption("MouseCoordMode", 2)AutoItSetOption("PixelCoordMode", 2)AutoItSetOption("CaretCoordMode", 2) and imagesearch as : $T22= _ImageSearch("Images\T22.png", 0, $x3, $y3, 40) If $T22= 1 Then MouseClick("left", $X3 + 10, $y3) I guess I could change the window location to 0,0 instead of 100,100 so imagesearch client and screen match, but I would have to redo what I just did though how can I have imagesearch return coordinates on the client rather than screen? I have checked the documentation but can’t find anything for the normal imagesearch function
-
So you are correct in that the program window is only a 800x600 and not the entire screen… if the old screen is 1680x1050 and new screen is 1600x900, but in both the actual program window is 800x600 and location is 100x100 (using winmove) do you know how I would adjust this? Or would I only need to change the program window location since the actual program window is still the same pixel size (but I don’t think this would work bc I’m using screen pixels)? 😫 I’m trying to think through this… if I do: 1600/1680= .95238095 900/1050= .85714286 if I change the window location to 95.2380952x85.7142857 would that fix the pixel locations? 😳 or would I do it opposite 1680/1600 1050/900 105x116.6667 as new window location edit: the above didn’t seem to work as things are still misaligned
-
I have built a rather long script that involves mouse clicks, pixel search etc that all reference the screen coordinates. These coordinates are all over my script. My old computer that I initially built this script on has become super sluggish so I am trying to run it on a new computer and monitor. When I try to run it on new machine, the mouse clicks and pixels are all wrong and I am not sure how to fix any of it without having to repull all of coordinates which would take forever. also wondering about the pixel search color — not sure if the colors would show exactly the same on the new monitor? does anyone know how I can go about resolving this? If I change the screen resolution of the new monitor to the old would that do anything or would it still cause issues bc it’s higher quality and larger? EDIT: I just checked and I can’t make the new monitor the same resolution as the old. the old monitor is 1680x1050 and the new is 1600x900
-
Winmove () is only working sometimes?
Nick3399 replied to Nick3399's topic in AutoIt General Help and Support
Same thing unfortunately. It only moves sometimes. I cannot figure out what it causing it -
Winmove () is only working sometimes?
Nick3399 replied to Nick3399's topic in AutoIt General Help and Support
Tried that as well 😕 the script definitely finds the window because it doesn’t send a message and makes it active -
My code is below. I am trying to move my HD window using the below code however it only does it occasionally. The app always goes active but only sometimes moves the window to the right position I never get a popup that the window is not open either so I know it is able to find it by the title... does anyone know what could be going on?
-
Hello, I am interested in trying this out on my own program however I have a quick question. I will be trying to use this on an application (would prefer not to take screenshots) so I would use the second example from @mLipok. 1) if I am trying to find the location of a given text, ex “hello” and then get those location details to eventually left click center of that word, how would I add that?
-
I have been trying to figure out how to do this with no success. is it at all possible two compare to pixels to find which one is lighter? I know pixelsearch has variant but that doesn’t seem to work properly for me and is giving me too many false positives after fine tuning. I will I’ll always be picking the lighter pixel, but it can be one of various shades of colors..
-
@Subz - I cannot post the codes because it violates the rules but yes you understand what I am trying to do. I want to open and close the 2nd script from within the first one. I just ran your code but it is still not killing the process when I add winkill and processclose Global $iPID HotKeySet("{ESC}", "_Exit") _RunAU3("2ndScript.au3", '"This is a commandline example!"') While 1 Sleep(100) WEnd Func _RunAU3($sFilePath, $sCommandLine = "", $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) $iPID = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '" ' & $sCommandLine, $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3 Func _Exit() sleep(2000) winkill($iPID) If ProcessClose($iPID) Then MsgBox(4096, "Process Closed", "Process id: " & $iPID & " closed successfully.") Exit EndFunc