Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/02/2016 in all areas

  1. Waiting for the September 2016 AutoIt code challenge! Congratulations to the winners .
    2 points
  2. After some deliberation, I have come to a decision to call this a draw between orbs and stamandster. Both your examples are better than my attempt, although tweaking some regular expressions would improve mine to a degree. This was a deceptively difficult challenge and I think your examples are as good as anything some MVPs could have created. Not to be put off by their lack of enthusiasm for this: the only person who volunteered to look at your examples was Jos. To be fair, some people I asked are not able to do so for one reason or another. Despite some confusion over the first post, you have demonstrated, to me at least, that my description was clear enough. Perhaps I could have elaborated more. I wasn't quite sure how to approach this problem myself, and I am most impressed by the winners. I think orbs quickly got on the right track, and stamandster put in great effort to refine his code. Both examples passed further tests with flying colours, although I had to lower orbs' score threshold to get through to Argentina. I declare you both champions of the unofficial August 2016 AutoIt code challenge. Many thanks to all who participated here. @Somerset Better luck next time.
    2 points
  3. "Doesnt matter who wins cause they're all losers" - trolololol
    2 points
  4. water

    OutlookEX

    Version 1.7.0.1

    10,054 downloads

    Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None
    1 point
  5. - _____ _____ _ _ - |_ _|___ ___ ___ _ _| __|___ ___|_|___| |_ - | | | -_| -_| | | |__ | _| _| | . | _| - |_| |___|___|_|_|_ |_____|___|_| |_| _|_| - 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
  6. thanks @czardas and everyone who contributed to this thread, it was enjoyable! i will now cherish my digital medal and go on an offline vacation for a week, so i won't be around to witness the fallout of these: @iamtheky, 1) i believe a new thread is in order. 2) i recon an AutoIt challenge solution that involves calling an external executable/library to perform its core task can hardly be considered valid. the ultimate example being of course this: 3) an AutoIt solution to meet your challenge already exists. i can't tell how fast it is compared to bash command, but it is AutoIt...
    1 point
  7. All of you are awesome! It's finally working! Thanks all!
    1 point
  8. Jos

    Help with IF/THEN for GUI

    That needs an extra space before the /c.
    1 point
  9. 1,429 files in 86 folders - multiple types I'd post the screenshot of the properties but, I cant delete my attachments and neither can the Mods and I am at 100%, maybe they will be nice and increase my cap since IPB is so boned.
    1 point
  10. @zegaris123, try something like this: #include <Constants.au3> $net = Run(@ComSpec & " /c ipconfig /all", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($net) If @error Then ExitLoop ElseIf $line <> "" Then ConsoleWrite("STDOUT read:" & $line & @CRLF) EndIf Wend You should be able to modify it easily to capture the line you're after
    1 point
  11. JLogan3o13

    CSV Issues

    @Fratopolis please stop hijacking other people's threads. This forum is dedicated to helping people with their own scripts; it is not a place where you put in a request and someone barfs up code for you. Why not start with showing the code you're using, and explaining what you have tried on your own, and where it is failing.
    1 point
  12. @argumentum You Rock, thank you!
    1 point
  13. It still has plenty of room for improvement, even at 1.5s
    1 point
  14. Hello, really good work @tarretarretarre. I'm a big fan of oop and I 'm looking forward to trying your framework, but i dont use sciTe and code only with SublimeText. how can I use teeniyScript anyway with SublimeText? Thx. sorry for my bad English. I hope you understand me
    1 point
  15. Read again the help file to discover what the return value of this function is.
    1 point
  16. Second time the prog is mostly better. I have one programm (mailmerging) i wrote meanwhile >4 times, but not while forgotten. The OS has changed. First DataAccess (a very good DB semi compiled language in the 80's and 90's) while Licencence Problems adapted to Turbo-Pascal (also MS-DOS). After a little bit playing with VB and VBA, Delphi in 2008 (all Win 3.11 to Winx XP) i searched for a language i could adapt to. First choise was Visual Data Access (good cheap, small and mostly known but very hard to integrate Word), second choice was Lazarus (also easy [Delphi/Pascal like syntax] but to big exe-files) and since 2009 it's AutoIt. But as i have lost the source, i have to rewrite, if it should be updated.
    1 point
  17. @Simpel , if you use #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/MO you can use the _stripped.au3 to correlate to the line number
    1 point
  18. no, but i am a old man. Only blond haircutters must new learn after pausing more as 1/2 hour. Some functions i don't need every day i have also the need to read about. And no some roses for @Jos and the other devs: AutoIt is the first windows language, where i understood the helpfile from the beginning. But maybe the dev's must write a tut who to use this helpfile, seems most people ignore it. But's the best i ever read.
    1 point
  19. Reading helpfile is always a good idea, but also testing the examples in helpfile brings some more feedback to your brain. I use AutoIt since > 7 years and every day i read in helpfile at least once a day. Most i also test the example.
    1 point
  20. Because Compiled scripts do have a sense of "lines". They just do not correspond to your non-compiled script.
    1 point
  21. Ok, created a different approach to what I've posted earlier... does away with typos.au3 ;-) #include <Array.au3> GLOBAL $MatchPerc = 30 ; no less than % to match on GLOBAL $MatchLen = 3 ; no smaller than X digits to match on Local $adbPNum = _ ['+262 692 12 03 00', '1800 251 996', '+1 994 951 0197', _ '091 535 98 91 61', '2397865', '08457 128276', _ '348476300192', '05842 361774', '0-800-022-5649', _ '15499514891', '0096 363 0949', '04813137349', _ '06620 220168', '07766 554433', '047 845 44 22 94', _ '0435 773 4859', '(01) 882 8565', '00441619346434', _ '09314 367090', '0 164 268 0887', '0590995603', _ '991', '0267 746 3393', '064157526153', _ '0 719 829 7756', '+1-541-754-3012', '+441347543010', _ '03890 978398', '(31) 10 7765420', '020 8568 6646', _ '0161 934 6534', '0 637 915 1283', '+44 207 882 8565', _ '0800 275002', '0750 646 9746', '982-714-3119', _ '000 300 74 52 40', '023077529227', '1 758 441 0611', _ '0183 233 0151', '02047092863', '+44 20 7946 0321', _ '04935 410618', '048 257 67 60 79'] Local $arPNum = _ ['882 8565', _ '123 8762', _ '7543010', _ '07843 543287', _ '00441619346534', _ '+44208', _ '0015417543012'] Consolewrite('--> Matching Threshold '& $MatchPerc &'% of Reference Number | No less than '& $MatchLen & ' digits' & @CRLF) For $i = 0 to Ubound($arPNum)-1 ; find these numbers! $rPNum = StringRegExpReplace($arPNum[$i],"[^0-9]","") ; Santize Numbers For $a = 0 to ubound($adbPNum)-1 $dbPNum = StringRegExpReplace($adbPNum[$a],"[^0-9]","") ; Sanitize Numbers $pM = _PhoneMatch($rPNum,$dbPNum,$MatchPerc,$MatchLen) IF $pM <> 0 then $sPM = StringSplit($pM,'|') Consolewrite($sPM[1] &'% of Reference Number '& $arPNum[$i] &' matches '& $sPM[2] & '% of DB Phone Number '& $adbPNum[$a] & ' -- Accuracy of ' & $sPM[3] &'%'& @CRLF) EndIf Next Next FUNC _PhoneMatch($_refNum,$_dbNum, $_pMatch = 50, $_refNumLen = 3) LOCAL $_refNumC = $_refNum LOCAL $_dbNumC = $_dbNum LOCAL $C = 0 LOCAL $swap = 0 IF Stringlen($_refNum) > Stringlen($_dbNum) Then $swap = 1 $_refNumC = $_dbNum $_dbNumC = $_refNum EndIf $_refNumR = $_refNumC ; cached Right $_refNumL = $_refNumC ; cached Left Do IF $c <> 0 then $_refNumR = StringTrimRight($_refNumR,1) $_refNumL = StringTrimLeft($_refNumL,1) endif $percDbNum = (StringLen($_refNumR)*(100/StringLen($_dbNumC))) $percRefNum = (StringLen($_refNumR)*(100/StringLen($_refNumC))) Select Case (StringInStr($_dbNumC,$_refNumL) OR StringInStr($_dbNumC,$_refNumR)) and $percDbNum >= $_pMatch if $swap = 1 then $_PMAcc = (StringLeft($percDbNum,5) + StringLeft($percRefNum,5))/2 Return StringLeft($percDbNum,5) &'|'& StringLeft($percRefNum,5) &'|'& StringLeft($_PMAcc,5) else $_PMAcc = (StringLeft($percDbNum,5) + StringLeft($percRefNum,5))/2 Return StringLeft($percRefNum,5) &'|'& StringLeft($percDbNum,5) &'|'& StringLeft($_PMAcc,5) endif EndSelect $c = $c + 1 until StringLen($_refNumL) = $_refNumLen OR StringLen($_refNumR) = $_refNumLen EndFunc Output --> Matching Threshold 30% of Reference Number | No less than 3 digits 100% of Reference Number 882 8565 matches 77.77% of DB Phone Number (01) 882 8565 -- Accuracy of 88.88% 100% of Reference Number 882 8565 matches 58.33% of DB Phone Number +44 207 882 8565 -- Accuracy of 79.16% 85.71% of Reference Number 7543010 matches 54.54% of DB Phone Number +1-541-754-3012 -- Accuracy of 70.12% 100% of Reference Number 7543010 matches 58.33% of DB Phone Number +441347543010 -- Accuracy of 79.16% 78.57% of Reference Number 00441619346534 matches 78.57% of DB Phone Number 00441619346434 -- Accuracy of 78.57% 71.42% of Reference Number 00441619346534 matches 90.90% of DB Phone Number 0161 934 6534 -- Accuracy of 81.16% 80% of Reference Number +44208 matches 33.33% of DB Phone Number +44 207 882 8565 -- Accuracy of 56.66% 80% of Reference Number +44208 matches 33.33% of DB Phone Number +44 20 7946 0321 -- Accuracy of 56.66% 84.61% of Reference Number 0015417543012 matches 100% of DB Phone Number +1-541-754-3012 -- Accuracy of 92.30%
    1 point
  22. i never got the hang of RegExp... the score is based on the longest successive substring, which in this case: phone: 00441619346534 query: 00441619346434 (don't you just love monospace fonts? ) now, 11 characters out of 14 is (rounded to) 79%. assuming what we're assuming about typos (i.e. they should be ignored), i feel that a match score of 79% is more sound them 93%. @czardas? also what i failed to highlight, is that once the array contains match scores, it can be sorted - which makes it quite easy for the end user to distinguish between the results. one can easily overlook the dissimilarity demonstrated above, but when they see it's only 79%, they will (hopefully) double-check. especially when - which is more troubling - the match score for 0161 934 6534 is only 71%. the 79% match score takes into account both sides of the query string, which as i mentioned, can (and should) be disabled, so the 71% match score becomes the only result, which happens to be the required result. it scores low because the query is so long. perhaps i should cross-check the shorter string against the longer one, whichever they may be. ... ok, i introduced the cross-check. now the 71% match score reevaluates to 91%. yey! also, another match score that was 85% now reevaluates to 100%, as it should - it matches the query 0015417543012 to the phone +1-541-754-3012. double yey! this is the updated code: #include <Array.au3> #include <Math.au3> ; tester input Global $aPhone = [ _ '+262 692 12 03 00', '1800 251 996', '+1 994 951 0197', _ '091 535 98 91 61', '2397865', '08457 128276', _ '348476300192', '05842 361774', '0-800-022-5649', _ '15499514891', '0096 363 0949', '04813137349', _ '06620 220168', '07766 554433', '047 845 44 22 94', _ '0435 773 4859', '(01) 882 8565', '00441619346434', _ '09314 367090', '0 164 268 0887', '0590995603', _ '991', '0267 746 3393', '064157526153', _ '0 719 829 7756', '+1-541-754-3012', '+441347543010', _ '03890 978398', '(31) 10 7765420', '020 8568 6646', _ '0161 934 6534', '0 637 915 1283', '+44 207 882 8565', _ '0800 275002', '0750 646 9746', '982-714-3119', _ '000 300 74 52 40', '023077529227', '1 758 441 0611', _ '0183 233 0151', '02047092863', '+44 20 7946 0321', _ '04935 410618', '048 257 67 60 79'] Global $aQuery = [ _ '882 8565', _ '123 8762', _ '7543010', _ '07843 543287', _ '00441619346534', _ '+44208', _ '0015417543012'] Global $iScoreThreshold = 0.7 Global $bCheckBothSides = True ; declare a global var to temporarily stote the match score for any specific match Global $iScore ; declare the match results array: rows = phone numbers, columns = queries Global $aMatch[UBound($aPhone) + 1][UBound($aQuery) + 1] ; populate headers (rows and columns) and strip non-numeric characters For $iPhone = 0 To UBound($aPhone) - 1 $aMatch[$iPhone + 1][0] = _StringStripNonNumeric($aPhone[$iPhone]) Next For $iQuery = 0 To UBound($aQuery) - 1 $aMatch[0][$iQuery + 1] = _StringStripNonNumeric($aQuery[$iQuery]) Next ; match For $iPhone = 1 To UBound($aMatch) - 1 For $iQuery = 1 To UBound($aMatch, 2) - 1 $iScore = _Max(_StringMatch($aMatch[$iPhone][0], $aMatch[0][$iQuery], $bCheckBothSides), _StringMatch($aMatch[0][$iQuery], $aMatch[$iPhone][0], $bCheckBothSides)) If $iScore > $iScoreThreshold Then $aMatch[$iPhone][$iQuery] = String(Round($iScore * 100)) & '%' Next Next ; re-populate headers with original values for display For $iPhone = 0 To UBound($aPhone) - 1 $aMatch[$iPhone + 1][0] = $aPhone[$iPhone] Next For $iQuery = 0 To UBound($aQuery) - 1 $aMatch[0][$iQuery + 1] = $aQuery[$iQuery] Next ; display match results _ArrayDisplay($aMatch) ; functions Func _StringStripNonNumeric($sString) Local $sResult = '' For $i = 1 To StringLen($sString) If StringIsDigit(StringMid($sString, $i, 1)) Then $sResult &= StringMid($sString, $i, 1) Next Return $sResult EndFunc ;==>_StringStripNonNumeric Func _StringMatch($sString, $sSubstr, $bCheckBothSides) Local $iScoreMax = 0 Local $iScoreNow = 0 Local $iScorePerChar = 1 / StringLen($sSubstr) ; check end-first For $i = StringLen($sSubstr) To 1 Step -1 $iScoreNow = $iScorePerChar * $i If StringInStr($sString, StringRight($sSubstr, $i)) And $iScoreNow > $iScoreMax Then $iScoreMax = $iScoreNow Next If $bCheckBothSides Then ; check start-first For $i = StringLen($sSubstr) To 1 Step -1 $iScoreNow = $iScorePerChar * $i If StringInStr($sString, StringLeft($sSubstr, $i)) And $iScoreNow > $iScoreMax Then $iScoreMax = $iScoreNow Next EndIf ; done Return $iScoreMax EndFunc ;==>_StringMatch oh, and let's round the percentage. no-one cares for the 0.86% in the 92.86%. just put 93%, ok? why not? the query number appears in both phones in exact.
    1 point
  23. or just without _arraysort: MsgBox(0,"blabla",Highest(2,8,6)) Func Highest($Var1, $Var2, $var3) $Highest = 0 For $i = 1 to 3 $Var = Execute("$Var"& $i) if $Var > $Highest Then $Highest = $Var Next Return $Highest EndFunc
    1 point
  24. PaulIA

    Auto3Lib

    The Auto3Lib library contains a suite of over 1200 functions written in AutoIt. These functions expose the full Windows API calls for use in AutoIt and are designed primarily for the advanced AutoIt programmer. The library comes with an AutoIt style help file. All functions are heavily documented and include sample scripts. Auto3Lib has the ability to manipulate the following controls: Animation controlsDateTime controlsHeader controlsIPAddress controlsListbox controlsListView controlsMenusMonth Calendar controlsProgressBar controlsStatusBar controlsTab controlsToolbarWindow controlsToolTip controlsTreeView controlsAuto3Lib has functions that support the following:ClipboardEvent LogGDI+ImageListsMemory ManagerNetwork AuthenticationNetwork Share ManagerPipesScreen CaptureStringsWindows APIWindows NetworkingWindows TimeWith the exception of "Strings" this library has been Ported to the standard UDF includes in Autoit. This libaray is not supported by the original poster nor is it supported by the Dev team. If installed on a system with the Latest version(s) of AutoIt you'll get bundles of errors. Therefore I've removed the link and download, not needed anymore. Gary
    1 point
×
×
  • Create New...