Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/20/2016 in all areas

  1. Taking the idea from @Melba23's (btw, thanks ) ExtMsgBox and also making use of his StringSize UDF, I made a extended version of the InputBox function. From the README file: This UDF creates input boxes (just like native InputBox), but with multiple inputs. You can also set some inputs to be password-style, set the default texts for some of the edits and even set the label of the OK/cancel buttons. How to use _ExtInputBox($sTitle, $sTexts [ , $sDefaults = Null [ , $sPasswords = Null [ , $sBtnLabels = "OK|Cancel" [ , $iWidth = -1 [ , $iLeft = -1 [ , $iTop = -1 [ , $iTimeout = 0 [ , $hParent = 0 ] ] ] ] ] ] ] ] ) Arguments are: $sTitle (mandatory): The window title (e.g.: "Hello World") $sTexts (mandatory): The edit labels, separated by | (e.g.: "Your email|Your password") $sDefaults: The default input texts, separated by | (e.g.: "|you@us.com||" will tell that the first input will have nothing as default text, the second will have you@us.com as default text and the third and forth will also have nothing). Note that if you set the default value of 1 input, you must set the value of them all (even if it's nothing), otherwise all inputs will have no default value. Default is none. $sPasswords: One or more 1-based index of inputs, separated by anything that is not a number (pipeline - | - recommended), of the inputs that will receive password style (e.g.: "2|3" wíll tell that the second and third inputs are password-style, default is none) $sBtnLabels: The TWO label of the default OK/Cancel buttons (e.g.: "Submit|Close") $iWidth: Window width (default is the size of the longest string with the limit of 25% of the screen width). Obviously it's not possible to set the height as it's calculated automatically. $iLeft: Distance of the window from the left side of the screen (default is centered) $iTop: Distance of the window to the top of the screen (default is centered) $iTimeout: Time limit for filling the form data (default is none) $hParent: Parent form (default is none) Return value Sucess: an 1-based array with the input values entered ($aArray[1] = 1st input value, $aArray[2] = 2nd input value, $aArray[n] = nth input value, whereas $aArray[0] = input count) Failure: False, and set @extended to 1 if the user clicked cancel, 2 if the user closed the window, or 3 if timeout ended. Examples (two of them) #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Username|Password", Null, "2") If $sData = False Then MsgBox(0, "", "You pressed cancel, exit or timeout ended.") Else MsgBox(0, "You entered:", "Username: " & $sData[1] & @CRLF & "Password: " & $sData[2]) EndIf #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Your full name|Your email|Your telephone|Choose an username|Choose a password|Repeat password", "Mr./Ms. ||+1 |admin||", "5,6", "Register|Cancel") If $sData = False Then Switch @extended Case 1 MsgBox(0, "", "You clicked Cancel") Case 2 MsgBox(0, "", "You closed the window.") Case 3 MsgBox(0, "", "Timeout ended (but we have no timeout on this example, so this will never happen)") EndSwitch Else MsgBox(0, "You entered:", "Full name: " & $sData[1] & @CRLF & _ "Email: " & $sData[2] & @CRLF & _ "Telephone:" & $sData[3] & @CRLF & _ "Username: " & $sData[4] & @CRLF & _ "Password: " & $sData[5] & @CRLF & _ "Password repeat: " & $sData[6]) EndIf Download Download ZIP from GitHub Btw, fork me on Github
    1 point
  2. - _____ _____ _ _ - |_ _|___ ___ ___ _ _| __|___ ___|_|___| |_ - | | | -_| -_| | | |__ | _| _| | . | _| - |_| |___|___|_|_|_ |_____|___|_| |_| _|_| - By TarreTarreTarre|___|Build '1.0.0' |_| + F5 = Run script + F6 = Build 'AU3' + F7 = Build 'EXE' + F8 = Options GUI + F10 = Exit TeenyScript All example code and documentation moved to: http://teenyscript.tarre.nu/documentation Official Github repo: http://github.com/tarreislam/teenyscript F.A.Q Q: What is TeenyScript? A: TeenyScript is a Superset of AutoIt which makes it more advanced Q: How does it work? A: TeenyScript code are parsed into native AutoiT code Q: Does it depend on anything else than AutoIt? A: Just one dependency, that is AutoitObject, the best UDF ever created for AutoIt, besides that, only Native AutoIt is used Features "Anonymous" functions Endless scope nesting OOP (powered by AutoitObject) User-friendly integration Powerful macros Namespaces Lists Project support, for easy deployment Userfriendly GUI for userfriendly Tasks for the Userfriendly person And much more To come You decide, I am happy to do requests! Install and Update TeenyScript HOW TO GET STARTED Run TeenyScript.au3 Now this should see something like this in your console Code Press F8 and navigate to the misc tab to install SciTE calltips Run \ Build \ Compile How to run with Sublime Text Here is some examples of TeenyScript code ;Basic List usage $Example_A = Func() ; Create a list Local $myList = { 'Name': 'Tarre' } ; Add \ Change data on $MyList $myList{'Age'} = 25 ; Create MySecondList Local $MySecondList = { "Name" => "John", "Age" => "00" } ; Using variable instead of a string Local $KeyName = "Age" Local $KeyVal = 1337 $MySecondList{$KeyName} = $KeyVal ; You may also pass lists to lists. however this has to be done in this fashion. Local $oList = {'myList': $myList, 'mySecondList' => $MySecondList} ; Return the objects Return $oList EndFunc();call the function on the variable ; Loop through list and print their values $Example_B = Func() Local $MyList = {'A': 'Hello FROM A', 'B': 'Hello FROM B', 'C': 'Hello FROM C'} Local $aNames = ['A', 'B', 'C'] For $i = 0 To UBound($aNames) -1 MsgBox(0,0,$myList{$aNames[$i]}) Next EndFunc #MAIN MsgBox(0,"Example A 1", $Example_A.myList.Name) MsgBox(0,"Example A 2", $Example_A.myList.Age) MsgBox(0,"Example A 3", $Example_A.mySecondList.Name) MsgBox(0,"Example A 4", $Example_A.mySecondList.Age) $Example_B(); Execute examble B Here is a non class nested function calculator example (calculator.ts.au3) $calculator = Func($a, $and, $b) $division = Func($a, $b) if Not $a or Not $b Then Return "Error dividing 0" EndIf Return $a/$b EndFunc Switch $and Case '+' Return $a + $b Case '-' Return $a - $b Case '/' Return $division($a, $b) Case '*' Return $a * $b EndSwitch Return "Unkown attribute "&$and EndFunc #MAIN ConsoleWrite($calculator(25, '*', 25)&@CRLF) ConsoleWrite($calculator(25, '/', 0) & @CRLF) ConsoleWrite($calculator(1, '^', 2) & @CRLF) teeny-script.zip (OLD) TeenyScript beta2.zip (OLD) teeny-script Beta 4.zip (OLD) teeny-script Beta 5.zip (OLD) teeny-script BETA 6.zip (OLD) TeenyScript Beta 7.zip (OLD) teeny-script Beta 8.zip (OLD) TeenyScript-master 1.0.0.zip (OLD) TeenyScript-1.1.0.zip (OLD) TeenyScript-1.2.0.zip (OLD) TeenyScript-2.0.0.zip (OLRD, Release notes) TeenyScript-2.1.3.zip (Newest 2016-09-16, Release notes)
    1 point
  3. BrewManNH

    For Next Loop problem

    Whoops crossing paths there.
    1 point
  4. @boomingranny the following works just fine for me on Windows 10: ProgressOn("Progress Meter", "Increments every second", "0%", 500, 200) For $i = 10 To 100 Step 10 Sleep(1000) ProgressSet($i, $i & "%") Next ProgressSet(100, "Done", "Complete") Sleep(5000) ProgressOff() What version of AutoIt are you running?
    1 point
  5. I'm wanting to achieve it without third party tools. That tool is worth a look, but it does require another tool itself. For the moment I have discovered how to derive a direct http link to the mp4 file.
    1 point
×
×
  • Create New...