All Activity

This stream auto-updates   

  1. Past hour
  2. This way? For $i = 1 To 7 MsgBox(0, "Button hit", "Number is " & _Surprise()) Next Func _Surprise() Local Static $a = [1, 2, 3, 4, 5], $n If $n = 0 Then _ArrayShuffle($a) $n += 1 Return ($n > 5 ? "no more available!" : $a[$n - 1]) EndFunc
  3. [NEW VERSION] - 22 Feb 18 Changed: Added an include file to cater for a rearrangement of the WinAPI functions in v3.3.14.3. New UDF in the first post. M23
  4. @SCHLONGMASTER, Welcome, not sure you notices, but there is no question in your post, merely some statements unless you are expecting a member to read this as your shopping list and do the shopping for you. What have you researched and tried that isn't working? Jos
  5. Hello, well, no - it actually is the x86 version of that libftdi1.dll running under 64bit Windows 10 that crashes AutoIt - the 64bit version seems to work; I haven't really checked that, but at least ftdi_init() and a few more return success and do not crash AutoIt anymore! Now the big question: where do I get the 64bit Version of commg.dll from? - this is at the moment the blocking point that enforces me to use 32 bit DLLs (commg.dll is a dll for serial communication of UART - I need to be in full control of port settings such as baudrate - and have not found any other solution for that yet)
  6. Thomas_1992, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. I appreciate that pokersnowie is a trainer but in my opinion it still falls into the game category - PM me with a counter-argument if you feel you have a strong case. M23
  7. Jeet24, Welcome to the AutoIt forums. You specifically need the WinAPIConv fix, but as mentioned in the post I suggest downloading all 3. M23
  8. BigDaddyO, It got too complicated to add all the WinAPI functions internally, so I will go with the simple added include file that you suggested and hope jpm does not fiddle with the locations again in the near future! Thanks for the report - and delighted you like my UDFs. M23 P.S. I will merge this thread into the main UDF one when I have released the new version later today.
  9. total noob here I used to have a script like this that I found years ago, but now I've lost it.
  10. Today
  11. Welc's...
  12. it worked thanks
  13. I have done something like this, but what I need is that each time that I call the function shows only one number, then when I call the function again show a different number and at the end say that is the end.
  14. Why not use FileFindFirstFile() and FileFindNextFile() functions, check with help file. something like this: $sFilePath = @ScriptDir & "\" $hSearch = FileFindFirstFile($sFilePath & "*.png") $aFileName = FileFindNextFile($hSearch)
  15. I want to save a screenshot of the screen in a particular folder with different names. like img0, img1, img2,... I tried using the while loop first $fileCount = 0 $exists = 1 While $exists = 1 $exists = FileExists(@ScriptDir & "\searches\img" & $fileCount & ".PNG") ConsoleWrite(@ScriptDir & "\searches\img" & $fileCount & ".PNG") $fileCount = $fileCount + 1 Sleep(100) WEnd $fileCount = $fileCount - 1 $screenShot = _ScreenCapture_Capture("") _ScreenCapture_SaveImage(@ScriptDir & "\searches\img" & $fileCount & ".jpg", $screenShot) this function does not search for the next possible file name instead it just overwrites the file with number initialized with $fileCount then I did the same thing using do...Until loop $fileCount = 0 $exists = 1 Do $exists = FileExists(@ScriptDir & "\searches\img" & $fileCount & ".PNG") ConsoleWrite(@ScriptDir & "\searches\img" & $fileCount & ".PNG") $fileCount = $fileCount + 1 Sleep(100) Until $exists = 1 $fileCount = $fileCount - 1 $screenShot = _ScreenCapture_Capture("") _ScreenCapture_SaveImage(@ScriptDir & "\searches\img" & $fileCount & ".jpg", $screenShot) this ends up being an infinite loop I cant see the issue here i am new to autoit
  16. Thank you so much guys. and Ascer that code works perfectly. Exactly what i was looking for. Thank you
  17. #include <String.au3> #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #include <MsgBoxConstants.au3> Global $url='http://buy.mi.com/in/buy/product/mix2' $oIE = _IECreateEmbedded() $hGUI=GUICreate('Embedded', @DesktopWidth-50, @DesktopHeight-100,10,10) $oIEobj=GUICtrlCreateObj($oIE, 10, 10, @DesktopWidth-50, @DesktopHeight-100) GUISetState() add() Func add() _IENavigate($oIE,$url) Sleep(1000) _IELoadWait($oIE) Sleep(2000) $oStartDatePicker = _IEGetObjById($oIE, "J_nextBtn") If StringInStr($oStartDatePicker.innerText,'buy') Then $oStartDatePicker.fireEvent("onclick") ; tried both before and after onclick fireevent but nothing worked $oStartDatePicker.click ;~ $oStartDatePicker.fireEvent("onclick") _IELoadWait($oIE) Sleep(2000) EndIf EndFunc Above is my code right now. I tried with and without fireEvent parameter but nothing seems to work on clicking the button. Events on clicking button are executing JS so maybe something that is related to that is not making it work. any help would be appreciated ! Thanks ANSWER: Sorry guys, I had a typo in code that was the reason it was ".click" instead of ".click()" , I don't seem to be able to find how to delete this question so if any mod want to do it go ahead. Appreciated.
  18. using an array makes it legible, a bit bloated for counting but legible. #include<array.au3> local $aArr = [1,2,3,4,5] for $i = 1 to UBound($aArr) $nValue = random(0, ubound($aArr) - 1 , 1) msgbox(0, '' , $aArr[$nValue]) _ArrayDelete($aArr , $nValue) next
  19. I want to do this but I have no idea how to do it -I will use a button to go to the function -When I click it, the script must generate a random number -each time I click it the number must be different -When I reach the maximum number show a message -Let's say that the minimum number is 1 and the maximum 5 I found a similar function but can't make it work $numbers = 5 Global $r,$str While 1 $r = String(";"&Random(1,$numbers,1)&";") If Not StringInStr($str,$r,1) Then $str = $str&$r $bla = StringSplit($str,";;",1) MsgBox(0,$bla[0]&" "&$str,$r) EndIf If $bla[0] = $numbers Then MsgBox(0,"THE","END") Exit EndIf WEnd And what i have Func _Random() $numbers = 5 Global $r,$str Do $r = String(Random(1,$Numbers,1)) If Not StringInStr($str,$r,1) Then $str = $str&$r $bla = StringSplit($str,1) MsgBox(0,$bla[0]&" "&$str,$r) $i = 1 EndIf If $bla[0] = $Numbers Then MsgBox(0,"THE","END") Exit EndIf Until $i = 1 EndFunc
  20. lol "T:\...\7z.au3" (274) : ==> Variable used without being declared.: Sleep(1) Sleep(1)^ ERROR
  21. I would like to know on how to retrieve cookies on sample 2. Sample 1 $URL = Invoke-WebRequest http://www.google.com $URL.BaseResponse.Cookies Sample 2 $URL = "http://www.google.com" (Invoke-WebRequest -Uri $URL -SessionVariable Y -UseBasicParsing).Content | Out-File -FilePath C:\TEMP.txt $URL.baseresponse.cookies, which show nothing Does anyone have any suggestions? Thanks in advance for any suggestions
  22. Hi there I tried to run one of your examples but I get an undefined function error ): Never mind the answer is on the replies above (:
  23. I agree it's not advisable but I was wanting to do a quick script to do a simple cleanup just annoying. But my doubt is because in win8.1 even using run as adm did not get the text of the current control Switch $sControl         Case "SysTreeView321"             $sText = ControlTreeView($hWnd, "", $sControl, "GetSelected")         Case "SysListView321"             $indice = ControlListView($hWnd, "", $sControl, "GetSelected",1)             $sText = ControlListView($hWnd, "", $sControl, "GetText",$indice,0)     EndSwitch
  24. Yesterday
  25. Create an ActiveSetup Script, that prompts the user to accept the policy, this will only happen once for that user account prior to them getting to the desktop. If you want it to run everytime a user logs in, then delete the ActiveSetup Guid with the script in the HKCU hive afterwards, using Run. For Example: Save your script to: C:\Program Files (x86)\YourScript\YourScript.exe Or \\Domain.com\SYSVOL\Domain.com\Scripts\YourScript.exe Create a Registry Key HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{Your Unique Guid Here} ;~ You can get this from here: https://www.guidgenerator.com/online-guid-generator.aspx I normally append a suffix to make it unique example: {6048702b-1b1e-45b2-8d26-792e02f694cc}_Au3 StubPath="<Path to your Script.exe>" Version="18,2,22,0" Now when a user logs on the script should run prior to them reaching the desktop, when they click OK (assuming MsgBox) it will add the version to: HKCU\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components\{Your Unique Guid Here} Version="18,2,22,0" If you update the HKLM Version it will re-run, however you can also just delete the HKCU version and it will re-run. Anyway I hope that made sense.
  26. Greetings All, I am recent newcomer to the program, and still learning. However, I've encountered a bump that I cannot seem to bypass and would dearly appreciate any insight. The script I've created works fantastically, save at one point that puts the mouse near my desired location and pauses for me to click the first field. The window resizes every time a new request is made, so using coordinates fails hard. I tried using {TAB}, but similarly the cursor goes seemingly to a random selection of any of the 6 fields in the date box (dd/mm/yyyy hh:mm am/pm). I've noted the part ***** where the script could use some assistance. My ideal would be to {TAB} into the box, determine the cursor location, then fill in the desired dates. It's that second step I am in trouble with. Would there be a way to run an if then statement that could determine the cursors location and put it to the leftmost point? Or have it detect whether the value selected by the cursor is AM/PM? If I can make the cursor go to definate starting point I can build from there, but I'm still learning and any guidance would help tremendously. I'll provide any window info needed if I can. #region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00000409) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] <> '00000409' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000409->' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- ; Loop and ask how many repeats $Number = InputBox("", "How many times repeat?", 1) For $i = 1 To $Number ;end loop part minus the next at the very end of script ;Script here ;Get Device ID from notepad. Moves cursor to the top left and copies the line, as the ID's are not uniform. Sleep to allow system to catchup _WinWaitActivate("Thing PID - Notepad","") Send("{UP}{UP}{UP}{UP}{UP}{UP}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{DEL}{DEL}") Sleep(100) ;Goto Ticketing program, paste in Device ID. Sleep allows program to load, as there is a marginal delay _WinWaitActivate("New service work order - [ - ]","") MouseClick("left",188,124,1,0) Send("{CTRLDOWN}v{CTRLUP}{ENTER}") SLEEP(800) ;Wait for Ticketing Prog to load, the extra click, pause, and space are in case a warning appears about existing work orders _WinWaitActivate("New service work order","") MouseClick("left",420,341,1,0) Sleep(800) SEND("{SPACE}") MouseClick("left",420,341,1,0) ;START filling work order. This part grabs the specific description for what the requests will be _WinWaitActivate("CHANGNIG BLAG - Notepad","") MouseClick("left",105,12,1,0) Send("{UP}{LEFT}{HOME}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{DEL}{DEL}") _WinWaitActivate("New service work order ","") MouseClick("left",50,12,1,0) MouseClick("left",153,326,1,0) Send("{CTRLDOWN}v{CTRLUP}") SEND("{END}") ;This copies the generic description for the work request _WinWaitActivate("bLAH - Notepad","") MouseClick("left",70,22,1,0) Send("{HOME}{CTRLDOWN}ac{CTRLUP}{HOME}") _WinWaitActivate("New service work order ","") MouseClick("left",50,12,1,0) MouseClick("left",153,326,1,0) SEND("{END}") Send("{CTRLDOWN}v{CTRLUP}") ;Places caller name in ticket field MouseClick("left",406,307,1,0) Send("{SHIFTDOWN}sarah{SPACE}stephens{SHIFTUP}{TAB}{TAB}loc{TAB}") ;****The part I am having trouble with**** ;The ticketing window itself resizes every time a new ticket is made, based on the location description assoicated with a device. ;The problem is when it gets to the date field, I cannot 100% guarentee where the cursor will land, even using tab doesn't deliver 100% accurate results. ;Sometimes the current mouse click position is to the left of date, sometimes the right. Tab can land on any valid field from the previous box, it's maddening ;(needs to be dd/mm/yyyy hh/mm am/pm ex: 02/21/2018 03/37 PM) ;My current solution is to have AutoIT alert me with a msg window, then move the mouse nearby so I can easily click. ;the window helpfully reminds which field to click. LOL msgbox(0,"First Message!","Click Due By Day.") _WinWaitActivate("New service work order","") MouseClick("left",674,412,1,0) Sleep(1900) Send("2{RIGHT}22{RIGHT}2018{RIGHT}7{RIGHT}00{RIGHT}P") ;****End date part 1 ;Date part 2 ;Same problem, but a solution to the above will address msgbox(0,"Second Message!","Click Start Time Day") _WinWaitActivate("New service work order","") MouseClick("left",674,417,1,0) Sleep(1500) Send("2{RIGHT}22{RIGHT}2018{RIGHT}7{RIGHT}00{RIGHT}P") ;Wrap up. This section creates the call, copies the Ticket number and technician into files to be moved and sent as needed. _WinWaitActivate("New service work order","") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}") ;Copy tech from message _WinWaitActivate("Text message","") Send("{CTRLDOWN}c{CTRLUP}") ;Copy tech to notepad _WinWaitActivate("tech - Notepad","") Send("{CTRLDOWN}v{CTRLUP}{ENTER}") ;Copy ticket number _WinWaitActivate("Text message","") MouseClick("left",297,131,1,0) Send("{CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}") ;Copy number to notepad _WinWaitActivate("ticket numbers - Notepad","") Send("{CTRLDOWN}v{CTRLUP}{ENTER}") ;Send message, start new ticket _WinWaitActivate("Text message","") MouseClick("left",529,18,1,0) Sleep(100) Send("{TAB}{TAB}{TAB}{SPACE}") Sleep(1500) Next #endregion --- Au3Recorder generated code End --- Working Script help needed.au3
  27. Hi guys, I have tried to create "auto-clicker" on software (search in google pokersnowie please) on windows 7/8/10 with autoit and python (pyautogui) but the clicks doesn't work. How is this possibile?
  1. Load more activity