Jump to content

Leaderboard

Popular Content

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

  1. Updates: New Sample code menu item to create objects and methods that have not been created otherwise. It's a couple of help pages that have been moved to the Sample code menu. Better naming of method parameters. Eg. $oGridPattern.GetItem($iRow,$iColumn,$pUIElement*) instead of $oGridPattern.GetItem(int,int,ptr*). Not finished. The usual minor errors. This completes the implementation of all planned UIASpy features. There may well be updates of existing features and new examples and code snippets. But all main features are implemented. New zip-file at bottom of first post.
    2 points
  2. You can't dodge it. But you can make it so you don't have to go back in your code if you add a new tab. So instead of naming your consoles $Console1, $Console2, $Console3, etc. Simply put them into an array of consoles. Create a single function that will update all the consoles based on the ubound of the array.
    1 point
  3. The best way to learn something like this is to experiment, unless you're writing to the registry or something equally potentially dangerous, most things won't break the computer. The second best way to learn it is to change things in the script and see what those changes do. If it doesn't work, AutoIt is usually pretty good at telling you why it's not working or wrong. Learning programming is like playing with Lego blocks, each new piece added to your knowledge base is like a block used to make something great.
    1 point
  4. jchd

    AutoIt Snippets

    @TheDcoder ProcessExists() accepts both. Helpfile: "The name or PID of the process to check."
    1 point
  5. BrewManNH

    Logic help

    That's incorrect. A variable declared outside a function, using Local or Global is a global variable. A Local variable declared inside a function is local to that function and only lives as long as the script is inside that function, and ceases to exist outside of it. A variable declared as Global inside a function is still global in scope. Any variable used as a parameter of a function is automatically declared and is declared as Local to that function. A variable declared using Dim will be global in the global scope and local inside a function, which is why it's not a good idea to use Dim unless you're careful of it's use. See the second example in the help file in regards to what can happen to a variable when you use Dim inside a function if it has the same name as a Global variable.
    1 point
  6. mLipok

    AutoIt Snippets

    Thanks @Deye Little modified version: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _IsProcessWindowed ; Description ...: Check if Procces (specified by name) exist and is windowed ; Syntax ........: _IsProcessWindowed($sProcessName) ; Parameters ....: $sProcessName - a string value. Process name to check ; Return values .: True / False ; Author ........: Deye ; Modified ......: mLipok ; Remarks .......: ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&comment=1422521 ; Example .......: No ; =============================================================================================================================== Func _IsProcessWindowed($sProcessName) Local $iPID = ProcessExists($sProcessName) If $iPID = 0 Then Return SetError(1, 1, False) _WinAPI_EnumProcessWindows($iPID) If @error Then Return SetError(@error, 2, False) Return True EndFunc ;==>_IsProcessWindowed
    1 point
  7. #include <String.au3> #include <Array.au3> #include <MsgBoxConstants.au3> $string = "helloHelloBye192.168.1.1:123418292293hdhfhdbdabgsgs" $arraySplitString = StringSplit(StringRegExpReplace($string, '([^0-9.:])', ''), ':') $result = $arraySplitString[1] & ":" & StringLeft($arraySplitString[2], 5) MsgBox(0,"", $result) This takes care of #2
    1 point
  8. Look at StringSplit in the help file for questions 1 and 3, and for 3 look at _ArrayUnique after the stringsplit.
    1 point
  9. Does this UDF do what you want?
    1 point
×
×
  • Create New...