Jump to content

USMCGalloway

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by USMCGalloway

  1. Thanks for the reply, but that was covered in the post
  2. Seems very basic, but I am having trouble getting a window to maximize. WinActivate("Title") WinSetState ( "Title", "", @SW_MAXIMIZE ) WinMove("Title", "", 0, 0, 1024, 768) Both of these will not work, actually none of the window manipulation functions seem to work with the window I am trying to deal with. "Citirx" ControlClick("Title", "", "","") ControlClick will not work because there is no information to work with, below is an image of the Window Info Tool with the cursor over the button. Is there any way to use the window size, Say: Get Window Position(x, y) $coordX = WindowSize( X) - 30 + WindowPosition(x) ; 30 is the amount of pixels from the right boarder to the maximize screen $coordY = 12 + WindowPosition(y) ; 12 is the amount of pixels from the top boarder to the maximize screen mouseClick( $coordX, $coordY) Would appreciate at nudge in the right direction. EDIT: Just had to work through it , this also might help someone down the road if they have the same problem .. WinActivate("Title") Local $size = WinGetPos("Title") $coordX = $size[2] - 50 + $size[0] ; 50 is the amount of pixels from the right boarder to the maximize screen $coordY = 12 + $size[1] ; 12 is the amount of pixels from the top boarder to the maximize screen MouseMove($coordX,$coordY) MouseClick("left")
  3. I have the UDF function _OCR working with the example .bmp file loaded by PingPong, but I am having trouble getting my font into the program. I think it has something to do with the way I am grabbing the image. At this point I am using "Snipping Tool" but have also used print screen to try to capture the image of the numbers I am trying to grab. Before X800 Capture.bmp After X800 Capture1.bmp I am not sure how to go about coding for the variation in color between the row/columns since they are not a flat black(0x000000), rather they range from 763336-000000 ish. I know with pixelsearch you can have a buffer zone to include shades within a percentage of a color you are really looking for, is this something that would apply here as well? I have tried a few other locations within the citrix app, but I have the same problem with the image being to pix-elated, and the other alternative takes to long to navigate too. Any help is much appreciated.
  4. someFunc() Func someFunc() Local $var1, $var2, $var3 , $string While 1 Sleep(1000) If ControlClick("Program", "", "[CLASS:Button;INSTANCE:4]", "IsEnabled", "") = 1 Then ExitLoop WEnd ControlClick("Program", "", "[CLASS:Button;INSTANCE:6]") $fName = ControlGetText("ID Data", "", "Edit3") $lName = ControlGetText("ID Data", "", "Edit29") $dob = ControlGetText("ID Data", "", "Edit10") $string = "foo===" & $var1 & "&&&" & "fooFoo===" & $var2 & "&&&" & "fooBar" & $var3 WinClose("Program1.1") WinClose("Program") ConsoleWrite($string) EndFunc Here is some of the code I have, is there any way to get the tasks done without the windows being pulled to the front. I have not tried it with the Kiosk yet, but is there any way for the actions above to happen without being set behind a Kiosk, or off screen , yeah tried the off screen approach, and though it was a fix, it was not the answer. Or is the browser Kiosk mode going to fix all of these problems ? As always thanks for future help !
  5. Thanks! Time to get coding, I am sure I will be back with some help on this, so far the past few weeks have only been clicking, sending, and array configuration stuff, time to get down and dirty or do a lot of this ...
  6. I am wondering if I set up a Kiosk on a machine, most likely Chrome and restrict a user to a specific web app, can auto it still work, such as DirCopy() and FileOpen(). Also would it be able to access .exe files and run the program in the background behind the kiosk window without them being in focus? Right now everything is on Ubuntu, but I could remove some rest calls to the windows VM if any of this can work, and just use a windows environment for the front end as well. Thank you again for any help .
  7. Yea, it would be, but with what I am dealing with there are rules against it, all I have the ability to do is to access, and edit some of the data, yet we can not save any of the data to the local machines. I'm sure I will have more dumb questions down the road, as I think I am going to be using Autoit for a long time.
  8. I am clicking though a database that is running off of Citrix, when I get to the correct screen, I am running though assigning fields to specific variables. The above function is being used in a getFunction. Once it makes one run through the selected data, I form it into a large string, with two sets of delimiters, one to separate key words from data, and then another to separate the pairs from one another, and in some cases I have another delimiter to separate the data sets, which will be sent away to a program that is calling the scripts. And see above for the rest. Its doing what I want it to do, by if someone has a better, more stable way to do this I am all ears. The main problem I am having is with server lag spikes from Citrix, my code is filled with pixelSerches to makes sure screens are loaded, and fields are updating ....
  9. I am just creating an array that I know is to large for the data I need to add to it. First I am checking if the string is the same value as the last time (meaning I am at the bottom of the list) it ran the loop, if it is then I ReDim the large array, and turn the array into a string which will at some point be passed to Java. If it does not match( I am not at the bottom of the list) it takes the string that it just created of the data it collected, puts it in the array , and updates lastString. I think it does what I want it to do, You were right FireFox, I was just going off an example I seen posted on some where else on here. Wont do that again .
  10. I have the following code sitting in a While loop, is there a reason that it is not seeing $i on in the ReDim Func getPhoneList(ByRef $s) Local $type, $primary, $int, $areaCode, $first3, $last4 , $ext, $finialArray[100], $localArray[100],$i = 0 , $lastString while 1 ;Lots of work and clicking and fun cool stuff If $phoneString == $lastString Then; Redim $finialArray($i + 1) $s = _ArrayToString($finialArray, "|||") Send("{ESC}") Send("{RIGHT}") Send("{ENTER}") return $s else $lastString = $phoneString $finialArray[$i] = $phoneString $i = $i + 1 Send("{DOWN}") Send("{SPACE}") Send("{TAB}") Send("{TAB}") Send("{ENTER}") EndIf ;==> Go back to top of while loop The Error it is giving ​(512) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.: ReDim $finialArray($i + 1) ReDim $finialArray^ ERROR
  11. Local $k = 0 , $v = 1, $d = "|||", $us , $emotion, $what Local $info = "We|||Love|||autoit|||" $pairs = StringSplit($info, $d ,2) Alright my whole thread is changing, because no matter how long you look at something until you post it you will never get it. At this point I have what I wanted working to an extent. But String Split leaving weird spaces in the in the array. Any way to prevent this ? [0]|data=foo [1]| [2]| [3]|data2=bar [4]| [5]| [6]|data3=hippie [7]| [8]| [9]|
  12. That toggles the task bar, but doesnt do anything for the top of the screen.
  13. Nope, wont work
  14. Thanks again, I used a function Bowmore had posted a few year back '?do=embed' frameborder='0' data-embedContent>> to delete the empty elements but yet again yours is a lot cleaner.
  15. Not sure what I did, but my screen is locked in a full screen mode. Between Google, and looking around here I have no idea what I did. I have even uninstalled Autoit just to see if it would fix it. I have went to properties and changed the anything I could think of there, mostly just the mode the program opens, and it still comes up maxed out without the min/max and close button. It is not a huge problem, but switching between programs while you are trying to write a walk through gets slightly old. I posted a full screen jpeg so you can see what I am talking about.
  16. Thank you that is much cleaner that what I had worked up.
  17. I have looked around, and have found a lot of examples for looking through a file and looking for specific strings. I have not seen anything for getting the next line after a specific string is found. Example: Yada Yada Yada Yada STRING What I want, but do not know what the string is going to be Yada Yada #include <File.au3> #include<Array.au3> $file = "C:\Users\Me\Documents\Test.txt" FileOpen($file, 0) For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) $knownString = "Current" If $knownString == StringLeft($line, 7) Then $e=0 $c = $i + 1 $array[$e] = FileReadLine($file, $c) $e = $e + 1 EndIf Next FileClose($file) _ArrayDisplay($array) The Error I am getting is: (14) : ==> Expected a "=" operator in assignment statement.: $array[$e] = FileReadLine($file, $c) $array^ ERROR Am I trying to use something as it is not suppose to be used? As always any help is greatly appreciated.
  18. Honestly , I haven't even seen anything about that. Do you think I would be able to use that with a program running in Cirtix? Looking over it I do not think so, but I could be wrong, also that code is easier .
  19. I am trying to see if a box has a check mark in it or not. From that point I need to check a variable, to see if it needs to be check or not. For some reason PixelSearch does not seem to want to work with Switch Statements. $Var = "" Switch $Var Case $Var = "Primary" $coord = PixelSearch(404,248,404,248,0x000000) If @Error Then Send("{Space}") ​ WinActivate("Untitled - Notepad") Sleep(500) Send("1") EndIf Case $Var = "" $coord = PixelSearch(404,248,404,248,0x000000) If NOT @error Then Send("{SPACE}") WinActivate("Untitled - Notepad") Sleep(500) Send("2") EndIf EndSwitch The notepads are in there because I was curious to which case statement it was stepping into. In this case it is always going into the first one. This is checking $Var and doing the pixelsearch for the checkmark, if an error comes up, hit space to put a check mark in the box. The next case statement is the same, only if it is not an @error, it will remove the check mark. $coord = PixelSearch(404,248,404,249,0x000000) If not @error Then Switch $CmdLine[1] Case $CmdLine[1] = "Primary" Case $CmdLine[1] = "" Send("{SPACE}") EndSwitch EndIf $coord = PixelSearch(404,248,404,249,0x000000) If @error Then switch $CmdLine[1] Case $CmdLine[1] = "" ;do nothing Case $CmdLine[1] = "Primary" Send("{SPACE}") EndSwitch endif Here is another variation I tried, as well, which goes in my head like, If no error( meaning there is a black check mark) Then test to see if it needs to be there( Primary needs a check mark, "' does not") , then a space will toggle the check mark. The second one will be skipped if the box is black, or will step into it and do the same as the previous one .
  20. In this project we do not have direct access to the data base, only a "guest" access at this point so we don't have access to their tables directly. I'm going to be making a user friendly web app on the front end, and then autoit scripts will be called and doing a bulk of the grunt work on the back end.
  21. Using Autoit Window Info I do not get any info for any of the fields in the >Control< section, so I just went with the basic keyboard inputs. I am not using Firefox or IE, I am accessing a test DB through Cirtix, From reading the descriptions for the functions above, I would have to have the files localized on my machine. I am using notepad so at some point we can integrate the list into a web app allowing users the ability to select/add the needed information to a profile. I do have another issue, not sure if I should post it here, or in a new thread. Ill do it here unless the mod says other wise " He seems on top of everything!! Keep it up! " I am still in Citrix, and I need to see if a box is "checked" or not. My approach is going to be use the PixelSearch again and test the area for the black check mark, and just use a if() statement. Does this seem as the most logical way, or am I over looking something. local $p = PixelSearch(402,246,406,251,0x000000); Looking for black pixel Switch $p case IsArray($p) = True ;if true then there is a check in the box Switch $CmdLine[1] Case $CmdLine[1] = "Primary" ;the user wants there to be a check in the box so leave it as is ;do nothing Case Else Send("{SPACE}"); anything else from the command line removes the check mark EndSwitch Case Else ; other than true, means no check mark in the box Switch $CmdLine[1] Case $CmdLine[1] = "Primary" , checks to see if the user wanted a check mark Send("{SPACE}") ;puts a check mark in the box Case Else ;do nothing ; User didnt want a check mark do nothing EndSwitch EndSwitch Well this is what I threw together. or . After some testing, unmarking the box every time. I guess it has something to do with how I am using pixel search.
  22. I have to copy a list from a database off Citrix, that is 100,000 ish different names. I have access to the last string in the table, so knowing that I can test against that until that is true. At this point the code above is hitting a the space bar of the field, bring up their auto complete, (and because the space is at the end of the word, it just brings up where I left off in the list, so the down key strokes moves me to the next one). From there I just copy the text field, (it wont let me copy from the auto complete menu, or this would be much easier) then paste, onto note pad. The checksums are just looking for screens to open/close, with citrix sometimes server lag messes up the whole process without them. Its working as intended, but it pretty slow 3-4 seconds per word, I am open to any way to speed this up. I will look into what you posted Kidney.
  23. Hey there. I have been lurking for a while, and have normally been able to come up with the solution after some trial and error. Looked around for a while, with the search tool, and in the UDF ( thought the Excel portion might have something I could use), and I am stumped. I have a function that is going to run through a data base, and I need it to stop once it hits the last item out of the list I am coping. $t = "" While $t <> "Last Value" Send("{SPACE}") Local $checksum = PixelChecksum(316,303,437,368);) While $checksum = PixelChecksum(316,303,437,368);)loop to wait for the page to load WEnd Send("{DOWN}") Send("{DOWN}") Send("{DOWN}") Send("{ENTER}") Send("^c") WinActivate("Untitled-Notepad") Send("^v") Send("{ENTER}") Mousemove(641,449) MouseClick("Left") Local $checksum = PixelChecksum(316,303,437,368);) While $checksum = PixelChecksum(316,303,437,368);)loop to wait for the page to load WEnd $t = Send("^v") WEnd EndFunc $t = Send("^v") is something I tried, just to see if it would work, and it did not. The route I am trying to use right now it to get the string that I have copied, and set it to $t, then the while loop will continue until it hits the last string. Open to new ideas.
×
×
  • Create New...