Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2019 in all areas

  1. It takes time to understand the "know-how" of most parts of AutoIt, time and experience. But you can always rely to this community when you need help. Or sometimes, just to attest if the code you made is optimal.
    2 points
  2. It has been more than a month since the last post in this thread and I did not manage to start working on the reference script until now... I blame the many things that I am try to balance in my schedule, which includes gaming on my new PS4 and watching a ton of YouTube when I am not working Anyway, I finally made a very basic reference script covering comments and variables, this should be enough to get me started: #cs This is a simple reference script which aims to include every possible combination of AutoIt Syntax As a matter of fact, we are demonstrating multi-line comments now! #ce #Region Comments ; == Single-line ; This is a single line comment ; == Multi-line #comments-start This is a comment spanning multiple lines #comments-end ; NOTE: Technically multi-line comments are directives which are processed by the preprocessor #EndRegion #Region Variables ; == Declaration Local $vLocalVariableDemo Global $g_vGlobalVariableDemo Dim $g_vDimVariableDemo ; Dynamic scope, avoid at all costs! Global Const $g_vGlobalConstantDemo = 3.14 ; You can't change PI! Enum $FOO, $BAR ; $FOO = 0 and $BAR = 1 Enum Step 2 $MAYBE_EVEN, $EVEN, $EVEN_AGAIN ; $MAYBE_EVEN = 0, $EVEN = 2, $EVEN_AGAIN = 4 Enum Step *2 $ONE_BIT, $TWO_BIT, $FOUR_BIT, $ONE_BYTE, $TWO_BYTES, $FOUR_BYTES ; Exponents of 2: 1, 2, 4, 8, 16, 32, ... ; === Array declaration Global $g_aArrayDemo[10] ; == Initialization Global $g_sInitializedString = "Test" Global $g_nInitializedNumber = 42 Global $g_vInitializedVarFromExp = (@SEC / 2) - Floor(@SEC / 2) = 0.5 ? "Even" : 0xDD ; Initialization with an expression whose type is dynamic ; === Array initialization Global $g_aInitializedArray[2] = ["Foo", "bar"] #EndRegion If anyone wants to expand the list, then feel free to do so! I will probably adapt your changes with modifications in my next iteration
    2 points
  3. I quickly post one more thank you to come a little closer to becoming an "Active Member".
    2 points
  4. @abberration You could streamlined your code like this : #include <GUIConstants.au3> GUICreate ("Test") $idCheckBox = GUICtrlCreateLabel (ChrW (0xA3),100, 70, 18, 18) GUICtrlSetFont(-1, 15, 500, -1, "Wingdings 2") $idLabelCheckBox = GUICtrlCreateLabel ("CheckBox", 122, 74, 100, 18) GUISetState () While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idCheckBox, $idLabelCheckBox GUICtrlSetData ($idCheckBox, GUICtrlRead ($idCheckBox) = ChrW (0xA3) ? ChrW (0x51) : ChrW (0xA3)) EndSwitch Wend
    2 points
  5. Version 1.1

    998 downloads

    AutoIt Loader is basically an AutoIt environment loader that allows you to fully use AutoIt as a portable development environment. The idea is to load all the necessary AutoIt resources into the system while you work with it (there is an option to add it to autorun), allowing you to use AutoIt as if it was installed in the system, without conflict with another installed AutoIt version. The main ability is to change AutoIt version in a few clicks, and after changing the version, the whole environment adjusts to work with this version. It is also possible to “download” (update) new versions to the development environment, either from an official source or from another source on your PC. After unloading (exit from loader from system tray), all resources and registry entries are cleared completely, leaving no traces. The loader includes 4 of the most popular and critical versions of AutoIt, which were published by the largest number of changes. Also, the loader has a module called AutoIt Tools (see screenshots), which has a number of tools and utilities that are necessary for development in my opinion. AutoIt Tools loaded with the loader (can be disabled), and appears when the mouse cursor is in the lower left corner of the screen. The menu of this module is dynamic, and it can be very easily changed using built-in editor, which is called from the context menu of the module (RMB). As a base code editor was used SciTE assembly by Yashied, in my opinion the most functional and portable of those that I have seen.
    1 point
  6. Just add _GUICtrlListView_SetCallBackMask( $cListview, 4 ) ; Disable state information about focused item immediately after creation of the listview. This command disables the dotted focus rectangle around the listview item which has the input focus. Untested. But it should work.
    1 point
  7. The lexer takes care of the syntax coloring/highlighting and folding for a specific file extension. Jos
    1 point
  8. Thank you for your interest! This is a good hint! I have named the title DE because I want to see if it can work first. At a later date there may be a PSPad4AutoIt3 EN project if more users are interested. Until then the project name remains with DE, but the next improvement kit I will name it EN. Thanks for the hint! Until then, it has its home in the DE AutoIt forum, and is still basically set to English. You can change this as you like, e.g. in AutoIt, if you have installed the AutoIt help in German, or in French, or Chinese, ... PSPad will use it. Or for PSPad in the menu / Settings / Program Settings / Language / ... you can choose what you want. Please remember that it is at a very early stage! There are only a few features and probably many bugs. At this point there are more improvements that I can (hopefully) make available in 2 or 4 weeks.
    1 point
  9. Yes, I love the help file. It is very useful. I have spent more time reading it than actually programming. The biggest problem with it is more complicated things like regular expressions cannot be fully explained. That could be a book on its own. And functions were explained how parameters are used, but not the underlying concept of what a function does, why we use them or when is the best time to use them. I fully understand them now, but it took a while to get it. Unless I just stumbled upon the section that talked about conditional operators, I would never have known it existed. In other words, until today, I thought the way I wrote the script was the only way to do it. The help file cannot tell you "hey, there's a better way - check out this section...". And looking at the Case section, I now see the comma separating the two variable expressions, but the help file did not make that clear to me or show an example of more than one variable.
    1 point
  10. mmm..... my (wild) guess would be that CallTip.cxx contains the Caltip logic. .. but doubt you can just simply port it to PSPAD.
    1 point
  11. Help file is one of the greatest assets of the language. Most of the functions have a runable example, and many are not that trivial. Reading it and studying the examples is probably the best way to learn AutoIt. Glad you liked my example
    1 point
  12. Nine, that is really cool. I learned a few things from your example. First, I used to try and have a case for two items and used OR and it never worked. Now I know to use a comma. Also, I looked up in the help file and found the conditional operator you used for switching the between the characters. Nice. I have seen some videos on how to program with Autoit, but they were all simple stuff, nothing advanced. I wish there were a better way to learn.
    1 point
  13. Nothing wrong here. ListView is "not focused" so windows change color of selected LV Item. Try to use ControlFocus() function like in this following example: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("ListView Set Item Selected", 300, 110) Local $idButton = GUICtrlCreateButton("Button", 175, 50, 75, 20) Local $idListview = GUICtrlCreateListView("", 4, 4, 125, 100) #forceref $idButton GUISetState(@SW_SHOW) ; Add columns _GUICtrlListView_AddColumn($idListview, "Items", 100) ; Add items _GUICtrlListView_AddItem($idListview, "Item 1") _GUICtrlListView_AddItem($idListview, "Item 2") _GUICtrlListView_AddItem($idListview, "Item 3") ; Select item 2 _GUICtrlListView_SetItemSelected($idListview, 1) ControlFocus('ListView Set Item Selected','',$idListview) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example
    1 point
  14. Version 1.2.0.0 released Changelog can be found on the download page and the history in the ZIP file. For download please see my signature below. Please play with this version and tell me what doesn't work or is missing!
    1 point
  15. 1 point
  16. Guess so as I am the author of the script. I am fine with other using as long as it is credited and people don't expect support from me. Jos
    1 point
  17. Hi Professor Bernd, and welcome! From these threads, we get that it is okay to use code found on the forums, but there are no licenses for any of the code posted without something in their signature. It is general etiquette to give credit by mentioning the author... usually I see it in the function header something like this: ; Author ........: Melba23, Jos, water ; Modified.......: Professor Bernd I am quite sure that Jos maintains AutoIt3Wrapper... you may want to send him a message or '@' him here. I think he doesn't want the AutoIt3Wrapper distributed... I'll edit if I can find that thread
    1 point
  18. Another solution is to have the checkbox be $BS_PUSHLIKE + $BS_BITMAP. You simply need to have 2 .bmp (check and uncheck) of the same size. And you toggle between both .bmp. Easy to make...
    1 point
  19. Nine, great idea with the wingdings. Here's an example how that could work. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 625, 443) $Label1 = GUICtrlCreateLabel("S", 88, 96, 36, 17) GUICtrlSetFont(-1, 12, 400, 0, "Wingdings 2") GUICtrlSetCursor (-1, 0) $Label2 = GUICtrlCreateLabel("Click Me", 104, 98, 70, 17) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Label1 _ReverseSelection() Case $Label2 _ReverseSelection() EndSwitch WEnd Func _ReverseSelection() $current = GUICtrlRead($Label1) If $current = "S" Then GUICtrlSetData($Label1, Chr("163")) Else GUICtrlSetData($Label1, "S") EndIf EndFunc
    1 point
  20. I have written DDNS updaters also, so I knew that some DDNS providers have APIs that allow simple GET requests. Others, allow GET requests but require additional header information like special User-Agent strings. In those cases, InetRead() wouldn't work. Of course some also allow POST & PUT requests, as you stated. I just brought it up in case you may had overlooked that option.
    1 point
  21. c.haslam

    cDebug.au3

    Version 1.15.4

    863 downloads

    cDebug.au3 includes four main debugging UDFs: _GuiDebug(), _ConsDebug(), _ClipDebug() and _FormatValsForDebug(). They all dump the values of all AutoIt subtypes and expressions, in a structured manner, including nested arrays (up to 3 dimensions) and slices of them, and even DLL structs and maps. It is an alternative to a graphical debugger, offering GUI output. The format for calling the UDFs has been designed to make coding a call as convenient and fast as possible, minimizing coding effort and the chances of errors: the $name argument is often the same as the variables arguments, enclosed in quote marks. For DLL structures, if you specify a tag, cDebug checks for differences between it and what it detects. If you only specify a structure variable, it can report the structure it detects, with the values of elements. It does much more than MsgBox(), ConsoleWrite() and _ArrayDisplay(), in a definitely user-friendly manner, and does its best to avoid hiding your code in SciTE. #include cDebug no maps.au3 or cDebug.au3 at the top of your script. If you #include cDebug.au3 (the version with maps) #include #AutoIt3Wrapper_Version=B before #include cDebug.au3 It is fully documented in . During debugging and development of new features, the current version is used to debug the upcoming version, so there is much testing, even so bugs are always possible, particularly in new features, such as reporting elements of maps whose keys match a regular expression. Bug reports and suggestions are welcome. These UDFs have been in regular use for some years. Because when cDebug was developed, maps were a use at your own risk feature, there are two streams of cDebug: cDebug.au3 reports maps, so to use it you must be running a version of AutoIt that supports maps, e.g. 3.3.15.0, and #include cDebug.au3 cDebug no maps.au3 does not report maps, so you can be running any recent version of AutoIt, e.g. 3.3.14.5, and #include cDebug no maps.au3 The only difference between the two streams is that map-reporting code is commented out in cDebug no maps.au3 . These functions are documented in cDebug.pdf A teaser This script: #AutoIt3Wrapper_Version=B ; beta 3.3.15.0 or greater is mandatory for cDebug.au3 #include "cDebug.au3" Local $seasons[] $seasons.summer = 'May to September' $seasons.spring = 'April' $seasons.fall = 'October to November' $seasons.winter = 'December to March' Local $aCats[3][3] = [['jack','black',3],['suki','grey',4],[$seasons,'','']] Local $i = 1 Local $tStruct = DllStructCreate('uint') DllStructSetData($tStruct,1,2018) _GuiDebug('At line '&@ScriptLineNumber,'$cats,jack is,$cats[..][$i],$i,hex,structure{uint}', _ $aCats,$aCats[0][2],$aCats,$i,Hex(-$i),$tstruct) produces: Acknowledgements Melba23, Kafu, ProgAndy, jchd
    1 point
  22. tobject, Your code looks correct. This is something I wrote to answer another question some time ago which uses the same function (you need AutoIt Help open so you can click in it): #include <Misc.au3> #include <WinAPI.au3> _Convert_Coordinates() Func _Convert_Coordinates() Local $tPoint = DllStructCreate("int X;int Y") Local $aCoords Local $dll = DllOpen("user32.dll") While 1 If _Ispressed("01", $dll) = 1 Then $aCoords = MouseGetPos() ConsoleWrite("Screen coords: " & $aCoords[0] & " - " & $aCoords[1] & @CRLF) ExitLoop EndIf WEnd DllClose($dll) WinActivate("AutoIt Help") WinWaitActive("AutoIt Help") Local $hWnd = WinGetHandle("AutoIt Help") DllStructSetData($tPoint, "X", $aCoords[0]) DllStructSetData($tPoint, "Y", $aCoords[1]) _WinAPI_ScreenToClient($hWnd, $tPoint) $aCoords[0] = DllStructGetData($tPoint, "X") $aCoords[1] = DllStructGetData($tPoint, "Y") ConsoleWrite("Client coords: " & $aCoords[0] & " - " & $aCoords[1] & @CRLF) EndFuncTwo things spring to mind (bear in mind I am not at all familiar with the app you are using! ): 1. Does the active window of MS Publisher which you are using have coordinates which start 0,0 in the top left corner? 2. Is $oPublisherObj.Activewindow.hwnd actually giving you the handle of the window you want? (You can check this with the Au3 Window Info Tool) Sorry I cannot be of more help - I hope one of these suggestions does the trick. M23
    1 point
  23. Nine

    Drawing a line

    Interesting. I made a master in computer psychology. It is an exact science but it depends on what school you believe on.
    0 points
×
×
  • Create New...