Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/23/2015 in all areas

  1. This forum (Au3 Technical) is inhabited by luminaries whose posts frequently demonstrate understanding far beyond my capabilities. For that reason, and at Jon's suggestion, I am reaching out to tap into your wisdom for a project that I have been working on a for a while. I was looking for a way to give back to AutoIt. As a self-taught programmer I have learned an incredible amount from this forum and the help file. It has been very rewarding. Over the course of my personal experiences I have wished, at times, that even though the materials and support are truly incredible - that someone could explain some of the more basic concepts. At the same time, I saw the creation of code.org and I started to think that AutoIt would be a perfect learning tool for people starting out (because of the simplicity, the incredible help file, and the best forum I have ever seen). All of that led to the creation of this text: https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/. It is the first draft of a basic introduction to programming using AutoIt. Nobody has reviewed it. Accordingly, I seek the collective constructive feedback of anyone willing to offer opinion as to content, spot any errors, and make any suggestions to improve it. My goal was always to donate it to the AutoIt forum when it was done. I think it could be a good addition to fill the gap for neophytes who may crave to see how everything fits together. The last thought I will leave you with - similar to the first - is that I am not the world's greatest coder (this may be a case of those who can do and those who can't teach). That said, I am hoping that the issues you will undoubtedly spot are not huge or threatening to the overall effort and that you appreciate the fact that this took some time to pull together. I look forward to hearing your thoughts.
    8 points
  2. Seems written in a gentle yet persuasive manner. Good read so far! Have noticed a few minor typos: Page 6: 1) "We will start of by studying core concepts and will demonstrate them in actual programs that you can build and run." of to off Page 7: 1) "And did I mention it was FREE." Should that have a question mark? 2) "That vocabulary word is not terribly important at the moment other than to note that the there are other names for other types of numbers." that the there 3) "So what’s in a name you ask? What difference does it make what I call a number that I want to use?" Make it more literal otherwise it seems like you're asking the reader this question. "So what's in a name? What difference does it make what I call a number that I want to use," you ask? Somehting like that. Page 8 1) "Many languages will make you “declare” your datatype before you starting using it." Starting to start 2) "One of the nice things about AutoIt is that is a “looser” language." is that it is Page 11 1) "Likewise, using <=18 to determine who is not eligible would lead to the false conclusion that someone who’s age is equal to 18 is not eligible." who's to whose Page 12 1) "Many of them are intuitive because we have seen t hem before outside of programming." "t hem"
    3 points
  3. ......Wish I had this book when I started programming in AutoIt... I don't have any words in my brain to say, I am still amazed by your book & I am not out of the shock yet. TD
    2 points
  4. I too have found a few things so far. All pretty minor, and I haven't read a lot yet ... have a slight headache tonight. Chapter 16 Compiling: Making youR programs into executables ............................................................... 142 Be more professional to say programs rather than progs I reckon. As long as you follow the forum rules and are courteous you will NEARLY always get a super-fast response that guides you in the right direction. As a testament to that there is a section in the forum that contains example applications and it is filled with many stunning entries that you can download, use, and even OFTEN change to suit your own needs. Apart from spelling error, all pretty minor, but more correct. I am pretty amazed at how much you have done so far, and it reads pretty well so far. Are you going to add a History element in at all?
    2 points
  5. You just end up with a million versions of SQL express and tools no matter how minimal an install you try. It all works fine though. When Win10 is released I'll refresh my coding VM with VS 2013 (as minimal as pos) and 2015 I think.
    2 points
  6. Version 1.2

    29,304 downloads

    I wrote an introductory text for new programmers to learn how to code using AutoIt. It follows along with the help file for the most part – but provides additional context and attempts to connect all the information in a cohesive way for someone without any programming experience. I find the help file to be an AMAZING resource and the text I wrote in no way reflects any opinion to the contrary. Rather, it was created from the perspective of someone who struggled early on with the most basic concepts and thought that a hand-holding guide could be useful. I was also inspired by code.org who is trying to encourage people to learn to code. I thought – what better way than to use free tools that you can download at any time with access to an amazing community? If only there was a guide to walk people through it … Full discussion about the file can be found here: https://www.autoitscript.com/forum/topic/174205-introductory-learn-to-program-text-using-au3/
    1 point
  7. Running this function here (in this simple test script) takes 16 seconds. The exact same function running inside my program takes over 22 seconds! WT*?!? This bamboozled me for a bit. After some trial and error I discovered what was making the difference and thought I might share this nugget which I will keep in mind for future intensive operations and if possible, set/reset at each side of said operation! In short, one, or rather two (each has an effect) common AutoIt script settings will cause some intensive code operations to run more slowly. The example searches in millions of lines of text from a file. I wasn't quite sure where to post this, so I thought I'd leave in the actual function and put it in example scripts as a bonus! It's a fast, low-memory way to find a string inside any size of file. ; First, nice and fast.. ;AutoItSetOption("TrayOnEventMode", 0) ;AutoItSetOption("GUIOnEventMode", 0) ;;---------- RUN x64 ---------- ;;Searching for : ->one million a characters.txt ;;Time =>16.23 seconds ;;.\StringInFileSimpleTest.au3 (46) : ==> $found_array: ;;[0] [0] = 100084 [1] = This is a line which contains the string "one million a characters.txt" ;;[1] [0] = 100085 [1] = This is another line which contains the string "one million a characters.txt" ; uncomment the following two lines for almost 40% slower times! ;AutoItSetOption("TrayOnEventMode", 1) ;AutoItSetOption("GUIOnEventMode", 1) ;;---------- RUN x64 ---------- ;;Searching for : ->one million a characters.txt ;;Time =>22.63 seconds ;;.\StringInFileSimpleTest.au3 (46) : ==> $found_array: ;;[0] [0] = 100084 [1] = This is a line which contains the string "one million a characters.txt" ;;[1] [0] = 100085 [1] = This is another line which contains the string "one million a characters.txt" ; init.. $string = "one million a characters.txt" ; a string to search for (this happens to be a file name) $test_file = "B:\Test\2,040,000 lines.data" ; 2,040,000 longish (ave' 70 chr) lines of text in this file $begin_time = TimerInit() ;; this would fix it, if your program UI design allows.. ;local $old_tray_mode = AutoItSetOption("TrayOnEventMode", 0) ;local $old_menu_mode = AutoItSetOption("GUIOnEventMode", 0) $found_array = StringInFileSimple($test_file, $string, default, true) ; (must search to end of file) ConsoleWrite("Time =>" & Round(TimerDiff($begin_time)/1000, 2) & " seconds") ;; revert back to previous settings.. ;AutoItSetOption("TrayOnEventMode", $old_tray_mode) ;AutoItSetOption("GUIOnEventMode", $old_menu_mode) ;if $do_debug = $ON then PrintArray($found_array, "$found_array", 0, @ScriptLineNumber);debug ; ; StringInFileSimple() ; ; A low memory way to find a string inside any size of file. ; This is also fairly fast and handles UTFx strings & files. ; ; In its simplest form, you send a file path and a string and it returns the ; line number where the string was first found, or false if not found in the file. ; ; You can force this function to return an array by passing the third param as ; true. It is a 2D array with one main element which looks like this: ; ; [0][0] = {int} line number of matching line, [0][1] = {string} entire line containing found string ; ; This is handy when you need to return the entire found line. ; ; It will also return an array if you set the fourth parameter, return_all=true, ; which returns ALL the matches found in the file, in the same two-dimensional ; array format as before, elements starting at 0, e.g.: ; ; ; [0][0] = line number of matching line, [0][1] = entire line containing found string ; [1][0] = line number of 2nd matching line, [1][1] = entire line containing found string ; [2][0] = line number of 3rd matching line, [2][1] = entire line containing found string ; [3][0] = etc. ; ; This was designed to search within a file for relative or absolute file paths ; using a single search operation, but works great for any string. ; func StringInFileSimple($file_path, $string_to_find, $return_array=false, $return_all=false) local $line_number = false local $file_handle = FileOpen($file_path, 0) ; or make a param out of the "0", or omit. if $return_all then $return_array = true if $return_array then local $array_count = 1 local $ret_array[$array_count][2] endif local $this_line while true local $found = false $this_line = FileReadLine($file_handle) if @error then $line_number = false exitloop endif $line_number += 1 if StringInStr($this_line, $string_to_find) then $found = true if $return_array then $ret_array[$array_count-1][0] = $line_number $ret_array[$array_count-1][1] = $this_line endif if $return_all then $array_count += 1 redim $ret_array[$array_count][2] else exitloop endif endif wend FileClose($file_handle) if $return_array then if $return_all then redim $ret_array[$array_count-1][2] ; chop off last (empty) element return $ret_array endif if $found then return $line_number endif return false endfunc ; I also have a StringInFile() which allows you to optionally pass an array of ; search terms. But even asking if $x = true on each iteration of a 1,000,000 ; lines can cost you a second, so this is the "simple" version. All speed-up ; tips for this code warmly welcomed! So there you have it! ;o) Cor
    1 point
  8. Think this was meant: Run (@ComSpec & ' /c schtasks /Create /tn MMSSDG /tr "C:\Users\programation\AppData\Local\Temp\MMSSDG.exe" /rl highest /sc Daily /ec system', "", @SW_HIDE)Jos
    1 point
  9. here's a nice walkthrough that using backups as an example, syntax is the same in powershell http://pureinfotech.com/2013/10/24/schedule-windows-81-system-image-backup/ so in autoit it is a literal replace Run ("powershell schtasks....")
    1 point
  10. One thing I'm fairly certain of is that Windows doesn't like the single quotes around strings in a command console.
    1 point
  11. how does it fail, can we see the console errors? does it work when you paste it into an elevated cmd prompt? does it work when you use runas and specify administrator? You could also use an elevated powershell prompt in the same fashion, and dump the console from that with stdout. Or maybe it will work better, just trade '@Comspec /c' for 'powershell'.
    1 point
  12. Quite extensive so have not had time to look at it all, but what I have seen is great, and it's very obvious to me the time and effort put into it. Fantastic work
    1 point
  13. Don't bump your post unless at least 24 hours later. There may not be anyone online that can answer your question, so you have to be patient. Bumping posts too often makes people LESS likely to help you.
    1 point
  14. @TheSaint Very true. Funny, that is a placeholder for an actual link to the source examples which I have not done yet. I will need to make sure I have them all in a nice organized way and post them as a separate file. I will also take into account all your other comments. Thank you! @TheDcoder Thanks, I will look at the typo you found. I am glad you like the idea of the book.
    1 point
  15. Just discovered a unfinished sentence, Prologue Section 3 (Pg no. 6) at the very bottom of the page: "... If you ever get stuck, you can visit the" & End of the page, not continued in the next page, Thanks! TD . Ooops, sorry, I was expecting "Help file" instead of "AutoIt Online forum"
    1 point
  16. @jaberwacky Thanks! I will collect all the feedback and take a pass through to make some corrections. I appreciate your efforts!
    1 point
  17. Great stuff. Kudos to you Jfish. I once had illusions of myself being capable of starting such a thing. I hope you succeed, where I would have been undoubtedly a failure. Will check out what you have done thus far. Thank You!
    1 point
  18. Try $o_speech.Volume = 100Reference https://msdn.microsoft.com/en-us/library/ms723615(v=vs.85).aspx
    1 point
  19. Well done. Thanks for your efforts which is really huge.
    1 point
  20. 1 point
  21. A PDF of the text "Learn To Program Using Free Tools With AutoIt".
    1 point
  22. Exit After X Time. I use Adlibregister() for that. I think I have seen a lot of cases where TimerInit() is used. Example: Adlibregister("Terminate", 180000) Func Terminate() Exit EndFunc If you're just trying to exit the loop not the script that is where TimerInit() TimerDiff() come in handy so you can check the time and after X Time ExitLoop Example: $vTimer = TimerInit() While 1 Sleep(500) ConsoleWrite("Loop Running" & @CRLF) If TimerDiff($vTimer) > 3000 Then ExitLoop WEnd MsgBox(0, "", "Loop Was Exited. Resume Script")
    1 point
  23. You only need to state your Adlibregister one time, so do it before your loop at the start of your script. It will repeat over and over at the set time until the script ends or you use the Unregister function.
    1 point
  24. Adlibregister ("Whatever"[,time=10000]) ;;Run function named Whatever() every 10 seconds
    1 point
  25. You're in luck. I have VS2010 and 2013 installed but not 2012 and I haven't run into any problems.
    1 point
  26. If fail in windows 8.1, you can try to add #RequireAdmin at begin of code.
    1 point
  27. https://www.autoitscript.com/autoit3/docs/libfunctions/_IENavigate.htm
    1 point
  28. Worked fine for me as written IF the text file was in same dir as the script. Otherwise "Windows can't find text.lnk". What made it work was: Case "Open text" ShellExecute(@ScriptDir & "\text.lnk")
    1 point
  29. The FileOpenDialog () changes the workdir to the directory of the selected file, so do a FileChangeDir(@ScriptDir) after the selection is done. Jos
    1 point
  30. Exit

    Problem with Do loop

    Just replace '==' with '='
    1 point
  31. George, Less of the cheek - I do have other things to do in my life you know! Actually I forgot to log off! paul1149, George was not able to read my mind this time - what I actually had in mind was something like this: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("Energy Star", 100, 15, 100, 20) GUICtrlCreateLabel("My No Sleep", 100, 55, 100, 20) GUICtrlCreateLabel("My Other Scheme", 100, 95, 100, 20) $hButton_1 = GUICtrlCreateButton("Go", 10, 10, 80, 30) $hButton_2 = GUICtrlCreateButton("Go", 10, 50, 80, 30) $hButton_3 = GUICtrlCreateButton("Go", 10, 90, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton_1 MsgBox(0, "Choice", "Energy Star") Case $hButton_2 MsgBox(0, "Choice", "My No Sleep") Case $hButton_3 MsgBox(0, "Choice", "My Other Scheme") EndSwitch WEnd As you can see, there are many ways to skin this particular feline. M23
    1 point
  32. ludocus

    Webcam Udf

    could you be a little more clear? If there are some things wrong, then I would like to try to make them better. thnx
    1 point
×
×
  • Create New...