All Activity

This stream auto-updates   

  1. Yesterday
  2. Had you thought about it, or searched the forum, you would have found the answer to both questions - discussed multiple times. Will it? If Jon deems it worth adding. When? When Jon deems it worth adding. Locking this thread as it has been discussed ad nauseam.
  3. Map feature would be really a nice thing in AutoIt as seen in the beta version. Will this functionality be taken up in a stable future release ? I do not ask when. I know the response ;-).
  4. Out of curiosity no real issue to fix. Can I do recursion with the ?: operators? in combination with eval, assign, execute functions Example 3 breaks whereas 1 and 2 are fine Global $j=3 ;~ Example 1 Global $trick="$j<10 ? 4 : 5" Global $j=execute($trick) consolewrite($j & @crlf) ;~ Example 2 Global $a="$j+2" Global $trick="eval(""j"")<10 ? execute(eval(""a"")) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) consolewrite($trick & @crlf) ;~ Example 3 Global $a="$j+2" Global $trick="eval(""j"")<10 ? (execute(eval(""a"")) + (execute(eval(""trick""))*0) ) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) ;~ consolewrite($x & @crlf) consolewrite($trick & @crlf) Exit Wondering if you can do something like this (pseudocode) $trick="($j=<10) ? $j=j+1 + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF)) I can imagine then I have to use more functions like assign, execute, eval etc. $trick="($j=<10) ? assign(""j"",execute(""j+1"")) + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF))
  5. Hello, Community. My goal is to create a script that will repeatedly hit the "scan" button in thinkorwim scanner (in case anyone's familiar with it). I will work on looping it later, because now it just doesn't work. The cursor is moving, the window becomes activated, but no clicks come through. I can't use ControlClick because I can't get control ID or anything from this button. If you have any advice at all, please do share - maybe it can be done via entirely different approach. Screenshot attached. $pos=MouseGetPos() MouseClick("left",690,310,1,0) MouseMove($pos[0],$pos[1],0) WinActivate ( "Stock Hacker Main@thinkorswim [build 1922]" )
  6. "And they say I'm just a grumpy old man..... " If so then you are a very kind old man Thank you for this, it makes so much more sense now if i read the construct of the code TBH i understand this forum has his own rules, because many guys ask questions like i did and also many guys ask questions before reading the forum rules and get punished more or less for this. I tried to learn about AutoIT but for someone who is not familiar with programming it is hard. With your help and look into your changes it was like turning a litght on Many thanks for this!
  7. @NguyenLe Try making the following change to _WD_WaitElement -- If $iErr Then SetError(__WD_Error($sFuncName, $iErr)) EndIf Basically, by adding the If...EndIf, it stops __WD_Error for being called unless an error was previously detected.
  8. Good catch, Miliardsto. I was aware of some issues in the latest AutoIt version, but not having upgraded yet myself, I was unaware that some of these might affect CodeScanner's proper functioning. Let's hope the devs get on top of it soon. Glad you found a way forward regardless though.
  9. This is super! I normally do this through a message box or the like. Its kind of ironic that this type of error checking is almost always required, yet I had never thought to write a function to be used as the goto, instead opting to use Consolewrite and message boxes written at the time of error to figure out what value is being passed when something unexpected is being returned. This will go into my standard includes. Thank you.
  10. Beated my own expectation down to 3 lines and shortened in bytes (using the $fcBtn makes it shorter could have made it $f offcourse but goal was not to obfuscate) local $fcBtn=GUICtrlCreateButton, $j=0, $2=0, $amsg[]=[0,0,0,0,0], $BA[] = ["7", "8", "9", "+", "C", "4", "5", "6", "-", "SqRt", "1", "2", "3", "*", ".", "0", "(", ")", "/", "="], $hGui = GUICreate("Calc", 360, 330, 229, 118), $f=GUISetFont(18, 400, 0, "MS Sans Serif"), $D = GUICtrlCreateInput("", 8, 8, 344, 31, BitOR(0x00000080, 2)), $1 = GUISetState(@SW_SHOW),$2 = $fcBtn($BA[0],7,50,65, 63) , $2 = $fcBtn($BA[1],77,50,65, 63) ,$2 = $fcBtn($BA[2],147,50,65, 63) ,$2 = $fcBtn($BA[3],217,50,65, 63) ,$2 = $fcBtn($BA[4],287,50,65, 63) ,$2 = $fcBtn($BA[5],7,120,65, 63) ,$2 = $fcBtn($BA[6],77,120,65, 63) ,$2 = $fcBtn($BA[7],147,120,65, 63) ,$2 = $fcBtn($BA[8],217,120,65, 63) ,$2 = $fcBtn($BA[9],287,120,65, 63) ,$2 = $fcBtn($BA[10],7,190,65, 63) ,$2 = $fcBtn($BA[11],77,190,65, 63) ,$2 = $fcBtn($BA[12],147,190,65, 63) ,$2 = $fcBtn($BA[13],217,190,65, 63) ,$2 = $fcBtn($BA[14],287,190,65, 63) ,$2 = $fcBtn($BA[15],7,260,65, 63) ,$2 = $fcBtn($BA[16],77,260,65, 63) ,$2 = $fcBtn($BA[17],147,260,65, 63) ,$2 = $fcBtn($BA[18],217,260,65, 63) ,$2 = $fcBtn($BA[19],287,260,65, 63) Do Until ((assign("aMsg",GUIGetMsg(1))=1) and ($aMsg[2]=0 ? $2=0 : (GUICtrlRead($aMsg[0]) = "C" ? GUICtrlSetData($D, "") : GUICtrlRead($aMsg[0]) = "SqRt" ? GUICtrlSetData($D, Sqrt(Execute(GUICtrlRead($D)))) : GUICtrlRead($aMsg[0]) = "=" ? GUICtrlSetData($D, Execute(GUICtrlRead($D))) : GUICtrlSetData($D, GUICtrlRead($D) & GUICtrlRead($aMsg[0]))) and ($aMsg[0]=-3))=true) or ($aMsg[0] = -3) ; $GUI_EVENT_CLOSE I think I am out of tricks but maybe an MVP knows how to get it into a one liner
  11. With more tinkering this seems to be the issue. These errors aren't present on external sites. Thank You.
  12. And they say I'm just a grumpy old man..... #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() HotKeySet("{ESC}", "_Exit") While 1 Capture_Window() Sleep(5000) WEnd Func _Exit() _GDIPlus_Shutdown() Exit EndFunc Func Capture_Window() Local $hWnd = WinGetHandle("[CLASS:Notepad]") Local $w = _WinAPI_GetWindowWidth($hWnd) Local $h = _WinAPI_GetWindowHeight($hWnd) Local Const $hDC_Capture = _WinAPI_GetDC(HWnd($hWnd)) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $w, $h) Local Const $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) DllCall("gdi32.dll", "int", "SetStretchBltMode", "hwnd", $hDC_Capture, "uint", 4) DllCall("user32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) _WinAPI_DeleteDC($hMemDC) _WinAPI_SelectObject($hMemDC, $hObjectOld) _WinAPI_ReleaseDC($hWnd, $hDC_Capture) Local Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hFullScreen) Local Const $c1 = $aFullScreen[2] - @DesktopWidth, $c2 = $aFullScreen[3] - @DesktopHeight Local Const $wc1 = $w - $c1, $hc2 = $h - $c2 If (($wc1 > 1 And $wc1 < $w) Or ($w - @DesktopWidth > 1) Or ($hc2 > 7 And $hc2 < $h) Or ($h - @DesktopHeight > 1)) And (BitAND(WinGetState(HWnd($hWnd)), 32) = 32) Then Local $hBmp_t = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) $hBmp = _GDIPlus_BitmapCloneArea($hBmp_t, 8, 8, $w - 16, $h - 16) _GDIPlus_BitmapDispose($hBmp_t) Else $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) EndIf _WinAPI_DeleteObject($hHBitmap) Local $sSaveFileName = @ScriptDir & "\screenshot - " & @MDAY & @MON & @YEAR & '-' & @HOUR &@MIN& @SEC & ".png" _GDIPlus_ImageSaveToFile($hBmp, $sSaveFileName) EndFunc I've made some essential changes and some just to make it more portable for me... I'm sure you'll figure out what is what (note the save path change).
  13. Hi. I have a program that have a control axWindowsMediaPlayer1, classname ATL:000007FED88B80D01. I need to get the information about the current position of the video. I know that the UDF "wmp.au3" have this function, but i dont know how to define the axWindowsMediaPlayer1 as objet to use the UDF. Regards.
  14. I downgraded autoit from newest version from february to ver autoit-v3.3.14.2-setup and it works good like before
  15. That's more useful than setting the entire column/control text direction. Thanks jchd.
  16. Hi. made some changes. Maybe you will agree: $INP_FieldValue1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Value", "") ; #552 reverted back to old one $INP_FieldValue2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Value", "") ; #554 reverted back to old one If $INP_FieldValue1 = "" Then $INP_FieldValue1 = IniRead($AutoIt3WapperIni, "Res", "Field1Value", "") ; #595 reverted back to old one If $INP_FieldValue2 = "" Then $INP_FieldValue2 = IniRead($AutoIt3WapperIni, "Res", "Field2Value", "") ; #597 reverted back to old one ; #1649ff For $U = 1 To $INP_Res_FieldCount ; changed order with $INP_FieldName1 & $INP_FieldValue1 & $INP_FieldName2 & $INP_FieldValue2 If $INP_FieldName[$U] <> "" And $INP_FieldValue[$U] <> "" Then $INP_FieldValue[$U] = Convert_Variables($INP_FieldValue[$U]) $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName[$U], $INP_FieldValue[$U]) EndIf Next If $INP_FieldName1 & $INP_FieldValue1 <> "" Then $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName1, Convert_Variables($INP_FieldValue1)) ; converting here If $INP_FieldName2 & $INP_FieldValue2 <> "" Then $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName2, Convert_Variables($INP_FieldValue2)) ; converting here ; about #4060ff If $INP_FieldName1 <> "" Then If Not StringInStr($INP_FieldNameEdit, $INP_FieldName1) Then ; excluding if field name is equal $INP_FieldNameEdit &= $INP_FieldName1 & " = " & $INP_FieldValue1 & @CRLF EndIf EndIf If $INP_FieldName2 <> "" Then If Not StringInStr($INP_FieldNameEdit, $INP_FieldName2) Then ; excluding if field name is equal $INP_FieldNameEdit &= $INP_FieldName2 & " = " & $INP_FieldValue2 & @CRLF EndIf EndIf Now no duplicates are written to current au3 script and macros like %date% and %time% in wrapper.ini will be written in current au3 script as macros. That's important for me as to see what is inside wrapper.ini. This I changed too: ; about #4580ff If $Changes > 0 Then __ConsoleWrite('-> ' & $Changes & ' Change(s) made.' & @CRLF) ; the whole update routine deleted here and putted after the EndIf Else __ConsoleWrite('-> No changes made..' & @CRLF) EndIf ... because I think "Save Only" should update source with wrapper.ini directives - otherwise I have "Cancel" to cancel. Fixed a missing AU3Check parameter: ' -w 7 : warn when passing Const or expression on ByRef param(s) (on)' & @CRLF & _ ; ~#4190ff ' -v 3 : show unreferenced UDFs and global variables (off)' Conrad
  17. Use the <> in the menubar to post code. I highly doubt that line 21 is the issue. This piece of code is is wrong logic and can create a recursion level error as well: Func Install() ;~ Install Program Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") If $CCHandle = 0x00000000 Then Sleep(1500) Install() EndIf Should be something like: (But still could be waiting forever so might want to put a limit to the wait time there) Func Install() ;~ Install Program Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") While $CCHandle = 0x00000000 Then Sleep(1500) $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") WEnd This code could be blocking as well as it is an endless wait: WinActivate($CCHandle, '') WinWaitActive($CCHandle, '') Just add a timer in the last line and test for that to trigger an error. Your other Func's have the same issue with the recursion and need to be changed as well. Jos
  18. i added the code in the hidden content on the 3rd post. Not sure how to post the code to make it colorful? As soon as the finish button is visible autoit thinks the script is finished too and quits. 21 was the top line in my post you replied to.
  19. .uiMode = "invisible" - hides the WMP window. $ - plays music $oMP.controls.pause() - pause music you can create custom buttons.
  20. Open to change proposals when you feel it can work better. Just send me the modification back and I will have a look and merge them back into my version in case I agree. Thanks, Jos
  21. Ok. A good reason to merge my "add both script sources" with your beta. But F7 is not enough. I had once to use the GUI with CTRL+F7 for updating current script. But there maybe is a little "confusion". Inside current script I get now returned: #AutoIt3Wrapper_Res_Field=Compile Date|20.02.2018 16:51:28 I thought it is better to have: #AutoIt3Wrapper_Res_Field=Compile Date|%date% %time% But then I realized that the Compile Date field inside th PE header is updated, but not inside current au3. But if I do one little change inside wrapper GUI it will add all existing Res_Fields again. The Compile Date with the actual timestamp. Now I do have two of them. So Res_Fields are not updated but added inside current script. (But again: only when running wrapper gui and making some little change.) I know how to handle that and satisfied. Thanks and regards, Conrad
  22. Is there a change in security zones, such as from the original http to https? If so, that could be the issue. Try reattaching to the browser with _IEAttach before continuing your script. If you search the forum for this error ($_IESTATUS_ClientDisconnected) you will likely find other discussions on this issue.
  23. @NguyenLe Ok, I see it now. I'll have to dig into it to see why this is occurring. As a temporary fix, you can set $_WD_ERROR_MSGBOX = False to prevent the message box from being displayed in the compiled app.
  24. Try current Beta changes: Added lines 4059-4064. Jos
  1. Load more activity