All Activity

This stream auto-updates   

  1. Past hour
  2. This isn't working on 64-bit Windows 10. For example, when I call _SysTrayIconCount( 2 ) [2 = Win 7+], I always get zero, whereas there are 10 of them showing. I also tried using the functions provided in this thread: Manipulate system tray program? from 2014, but it was hardly better. It reported only 1 icon. What I want to do is to bring up the GUI window for something running in the system tray that doesn't have a GUI until the tray icon is clicked. Curiously, a call to WinExists() always reports the GUI window does exist, even though it actually doesn't. Thus when I try to activate that window with WinActivate(), the GUI never appears! How can this be done under 64-bit Windows 10, please? Thanks!
  3. Drat! The third-party GUI I wish to control (Comodo Firewall 10) is - gasp! - non-standard! I'm not aware of any alternative but brute-force, horrifically ugly MouseClick() calls after using the AutoIt Info tool to manually determine the mouse coordinates of the two dozen pseudo-controls in six different windows (kill me now!) I don't suppose anyone's come up with a better alternative, like a magical UDF that finds the correct mouse coordinates of all those pseudo-controls based on it's text or something? Anything? Please let me know... Thanks!
  4. Today
  5. Hello AutoIt Community! I have no where else to go so I have came here for some hope! Haha. I am trying to validate this form to I can upload an image to a website. For some reason, every time I dynamically add a value to the URL input box, it does not allow me to upload. I need some type of work around. Here is my code. I feel like I have tried everything. // ;: INCLUDES :; #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> // ;: IE DOCUMENT :; Local $oIE = _IECreate(" YOUR BLOG HERE") Local $oDoc = _IEDocGetObj($oIE) Sleep(3000) $oDoc.querySelector("button.editor-drawer-well__placeholder").click() Sleep(1000) $oDoc.querySelector("").click() Sleep(1000) $oDoc.querySelector(" .popover__inner .popover__menu .popover__menu-item").click() Sleep(2000) $oDoc.querySelector(" .form-text-input").focus() Local $oInput = $oDoc.querySelector(" .form-text-input") _IEFormElementSetValue($oInput, "") // I have also tried // $oInput.value = "" $oEvt1 = $oIE.document.createEvent("Event1") $oEvt1.initEvent("change", True, False) $oInput.dispatchEvent($oEvt1) $oEvt2 = $oIE.document.createEvent("Event2") $oEvt2.initEvent("input", True, False) $oInput.dispatchEvent($oEvt2) $oEvt3 = $oIE.document.createEvent("Event3") $oEvt3.initEvent("keydown", True, False) $oInput.dispatchEvent($oEvt3) $oEvt4 = $oIE.document.createEvent("Event4") $oEvt4.initEvent("keypress", True, False) $oInput.dispatchEvent($oEvt4) Sleep(3000) $oDoc.querySelector(" .button").focus() $oDoc.querySelector(" .button").click() For some reason, the console always outputs this and this Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help e.extension is undefined What else could I try? I am lost at this point. Been trying for 3 days...
  6. I'll try it when I get the computer to test it. Thanks a lot
  7. and inserting that code in the place of the existing loop does exactly that. The only question really was whether you still needed 1 to exist.
  8. I want to get the random number starting from number 2 to my variable
  9. I use psexec a LOT in my Autoit programs. But it is a pain dealing with as far as getting feedback. One can get feedback from the cmd line but it's clunky, and, AFAIK it's very difficult (impossible?) to get cmd line feedback running interactively (-i). Yeah, an Autoit exe can write data to a file (or even by sending back over the network) which can be read by a parent script, but that's clunky as well. So is there any kind of native functionality available in Autoit for doing what PSEXEC does? I found this old thread which asked the same question (which went unanswered), so wanted to throw this out there again. I have found out about a few other utilities like remcom (old and Sourceforge says it contains malware) and PSAEXEC (open source non-MS implementation of PSEXEC). But it would sure be nice if there was some way of doing this natively in Autoit. Thanks
  10. Do you want the array to start at 2 (with the value 1 not existing), or to return every item from the array except 1? The former would be done in the loop that populates the array, if $i + 1 starts at 1 then... For $i = 0 To $MaxValue - 1 $a[$i] = $i + 2 Next
  11. Just one thing, If I want to start from the number 2, how can avoid a "1" return?
  12. Thanks now works fine, I'll use this one
  13. Hmm How about this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> #include <Array.au3> Global $aFiles[1] = [0] $hGUI = GUICreate("Accept only files in this window, no folders", 500, 400, Default, Default, Default, $WS_EX_ACCEPTFILES) $hEdit = GUICtrlCreateEdit("", 10, 10, 480, 380) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $hEdit_Handle = GUICtrlGetHandle(-1) GUISetState(@SW_SHOW) GUICtrlSetData($hEdit, "") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED For $i = 0 To _GUICtrlEdit_GetLineCount($hEdit_Handle) $file = _GUICtrlEdit_GetLine($hEdit_Handle, $i) ConsoleWrite($file & @CRLF) If FileGetAttrib($file) = "D" Then ConsoleWrite($file & " is a Directory" & @CRLF) ElseIf $file <> "" Then _ArrayAdd($aFiles, $file) EndIf Next $aFiles[0] = UBound($aFiles) - 1 _ArrayDisplay($aFiles) Sleep(2000) ; This only here you you can see the drop has taken place _GUICtrlEdit_ReplaceSel($hEdit_Handle, "") EndSwitch WEnd
  14. orly, thats the only edge case you could find or just the edgiest? I believe delimiters would be unnecessary with any smoosh of strings that are both unique, and have uniform length; just accurate parameters for split and mid (thus the PoC). And not terribly hairier. This works chunking via 1,2, or 3...because remainder math can suck it, sanitize your input. $numbers = "123456" $chunk = 2 For $i = 1 to StringLen($numbers) / $chunk $chr = stringmid($numbers , (stringlen($numbers) = $chunk ? 1 : random(1 , StringLen($numbers) - ($chunk - 1), 1)) , $chunk) $xTest = $chr = "" ? "" : msgbox(0, '' , $chr) $numbers = (stringlen($numbers) > $chunk) ? stringsplit($numbers , $chr , 3)[0] & stringsplit($numbers , $chr , 3)[1] : msgbox(0, '' , 'None Remaining') Next
  15. Yesterday
  16. How about this? Func UniqRandNum($iMin, $iMax) Static Local $sNum, $iT = -1 Local $iRnd = "N" If $iT < 0 Then $iT = ($iMax - $iMin) + 1 $sNum = ",N," EndIf While ($iT > 0 And StringInStr($sNum, "," & $iRnd & ",") <> 0) $iRnd = Random($iMin, $iMax, 1) WEnd $sNum &= $iRnd & "," $iT -= 1 Return $iRnd EndFunc $iTest = UniqRandNum(-10, 12) While True MsgBox(0, "Unique Rand", $iTest == "" ? "No Numbers Remain" : $iTest) If $iTest == "" Then ExitLoop $iTest = UniqRandNum(-10, 12) WEnd I added range to it as well Updated to make it bit more robust
  17. Nice Idea, but you'll need delimiters in there as well otherwise its only good up to 9 and its going to make your lookup function way hairer
  18. Im finding a fun string rabbit hole...not that the array UDF isnt lovely $numbers = "12345" For $i = 1 to stringlen($numbers) + 3 $chr = stringmid($numbers , random(1 , StringLen($numbers) , 1) , 1) $numbers = stringsplit($numbers , $chr , 2)[0] & stringsplit($numbers , $chr , 2)[1] msgbox(0, $numbers & " -" , $numbers = "" ? "No Numbers Remain" : $chr) Next
  19. Hi, I have a test interface that I'd like to use as the basis for a GUI I'm starting work on. **Credit to Melba23 for the starting framework below: How would I take this interface and modify it so that only files are accepted in the Drag and Drop edit box, not folders. In other words, if I drag the Windows folder on top of the edit box, nothing is displayed, but if I take the contents of the Windows directory and drop it in the edit box, all the files (including their paths) are listed, but none of the folders. Make sense? Here is "my" sample GUI: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiEdit.au3> $hGUI = GUICreate("Accept only files in this window, no folders", 500, 400, Default, Default, Default, $WS_EX_ACCEPTFILES) $hEdit = GUICtrlCreateEdit("", 10, 10, 480, 380) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $hEdit_Handle = GUICtrlGetHandle(-1) GUISetState(@SW_SHOW) GUICtrlSetData($hEdit, "") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $file = @GUI_DragFile ConsoleWrite($file & @CRLF) Sleep(2000) ; This only here you you can see the drop has taken place _GUICtrlEdit_ReplaceSel($hEdit_Handle, "") EndSwitch WEnd Thanks for your time and suggestions, -Mike
  20. Here's a non-fixed version: just change the $MaxValue global constant. Global Const $MaxValue = 17 For $i = 1 To $MaxValue + 3 ; + 3 is just to go beyond $MaxValue ans see what happens MsgBox(0, "Button hit", "Number is " & _Surprise()) Next Func _Surprise() Local Static $a[$MaxValue], $n If $n = 0 Then For $i = 0 To $MaxValue - 1 $a[$i] = $i + 1 Next _ArrayShuffle($a) EndIf $n += 1 Return ($n > $MaxValue ? "no more available!" : $a[$n - 1]) EndFunc
  21. Strange that you can't access the document object. Can you duplicate the issue on another site that runs Angular? If so, can you provide the URL for that site so that we can observe the issue?
  22. a moot point now but please consider refraining from posting. Jos
  23. @Rxit, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) 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. See you soon with a legitimate question I hope. Jos
  24. Hello, im not sure if here is the right place to wirte this topic, but if its not please redirect me. So I've been using anti-afk script for WoW and I wanted to kinda "level it up", because in my server there are 500+ people waiting in queue and thats a solid 1hour of waiting and often I can't wait a whole hour. So basically I want an idea how to make a script which checks if I passed the queue and If I did (in other words if I am at the character choosing screen(maybe watching if a picture has changed or something)) to press enter and log me in my character, then I can add the anti afk script so I wont get kicked and yea you get it. Any help would be appreciated. Thanks in advance. GG.
  25. Thanks it helped me a lot now just I need to change $a by my variable and don't know how to do it I tried but was unsuccesful
  26. we almost get it. Just What I need at this point is to change $a by the result of $LastCell. instead of: Local Static $a = [1, 2, 3, 4, 5],$n I need something like this:     Local Static $a = [1 to $LastCell],$n And this is the code that I have #include <Excel.au3> #include <GUIConstantsEx.au3> Global $oAppl = _Excel_Open(@SW_HIDE) ;Abre excel y lo oculta Global $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\Example.xlsx") ; your workbook here Global $xlUp = -4162 With $oWorkbook.Sheets(1)       Global $LastCell = .Cells(.Rows.Count, "A").End($xlUp).row        ;Es la ultima celda donde se escribio en el documento    EndWith _Excel_BookClose($oWorkBook) MsgBox(0, "", $LastCell) Example() Func Example()     ; Create a GUI with various controls.     Local $hGUI = GUICreate("Example")     $Button = GUICtrlCreateButton("Button", 20, 20, 50, 20)     ; Display the GUI.     GUISetState(@SW_SHOW, $hGUI)     ; Loop until the user exits.     While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE, $idOK                 ExitLoop             Case $Button                MsgBox(0, "Button hit", "Number is " & _Random())         EndSwitch     WEnd     ; Delete the previous GUI and all controls.     GUIDelete($hGUI) EndFunc   ;==>Example Func _Random()     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 thanks in advance and sorry because I'm new with autoit just use it ocasionally and I'm really new with arrays
  1. Load more activity