Leaderboard
Popular Content
Showing content with the highest reputation on 08/08/2014 in all areas
-
String Regular Expression Tester V2
jvanegmond reacted to Szhlopp for a topic
Since there are WAY to many posts on how to SRE something I thought I would create a nice little tester. This thing does SRE and SRER. Loads files to test. Gets internet content to test. And more! Here it is: SRETesterV2.1.au3 Prev DL - 211 Enjoy!1 point -
How to search for strings in autoit script file
Nikolle9203 reacted to guinness for a topic
I guess you have done your research beforehand? This subject has been discussed plenty of times with possible solutions having been provided.1 point -
Simple password generator tool for a Help Desk
ViciousXUSMC reacted to Kovacic for a topic
This is a simple incomplete password reset tool, my 3rd script with autoit, so the code is elementary. This is something you can use to customize and make your own. It will generate a password, and give you the nato readout so you can read it to an end user over the phone. Feel free to update and make it better, I no longer require it so enjoy! #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AD.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AD PAssword Reset Tool", 509, 276, 250, 152) $Label1 = GUICtrlCreateLabel("Password Reset Tool", 40, 8, 442, 46) GUICtrlSetFont(-1, 28, 400, 0, "Arial") GUICtrlSetColor(-1, 0x000000) Global $rnd, $result2 = "" $Input3 = GUICtrlCreateInput("", 60, 96, 400, 32, $SS_CENTER) GUICtrlSetFont(-1, 16, 400, 0, "Arial") GUICtrlSetState(-1, $GUI_DISABLE) $Button1 = GUICtrlCreateButton("Generate Password", 16, 64, 107, 25) $Button2 = GUICtrlCreateButton("Set Password", 260, 162, 75, 25) $Button3 = GUICtrlCreateButton("Unlock Account", 155, 162, 99, 25) $Input1 = GUICtrlCreateInput("", 16, 160, 121, 21) $Group1 = GUICtrlCreateGroup("Account status", 8, 188, 489, 81) $Label4 = GUICtrlCreateLabel("Username: ", 16, 204, 58, 17) $Label5 = GUICtrlCreateLabel("Locked: ", 16, 220, 46, 17) $Label6 = GUICtrlCreateLabel("Password Age:", 16, 236, 75, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label7 = GUICtrlCreateLabel("", 26, 133, 436, 24, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetFont(-1, 9, 800, 0, "MS Sans Serif") $z = "rvxs|rdmf|jzlr|izez|lbyl|yjmz|wzet|pyau|qumv|aocr|wwal|qhyh|dlou|ruqj|vgmg|edpg|wsmv|qmnt|kwgr|tduz|jzgq|ywdn|etet|hxvj|ydwp|vvzx|cwcs|fcru|dnin|jwna|pwks|xoak|audd|ppwe|omzq|xwcy|dudn|rwtz|qvtg|jgzi|hxkr|azug|ixla|iikl|ovgk|skpj|kldj|ovwg|psfy|jmck|gkea|bjmq|trfc|tppm|jvae|fgah|scbj|pqtl|gses|gtzz|xtid|snds|xkok|zgcb|iktk|cvil|ynxn|fqqs|qakc|cnsc|jiaz|nryi|brev|olbe|whfs|kpro|lkcg|vvlp|pjlf|igvl|mnyp|shco|nite|exji|drai|gdgd|cylw|hlgr|qfya|dqle|xhgn|jkbl|cghi|xcow|iwui|ltqm|olmx|rujq|ehop|xpgr|zjfg|zebn|iezt|gazx|cgft|tefk|jijz|smhj|zbwr|vxsd|wjmp|sjbk|hyzm|sszr|iqbq|marj|pdsn|derh|sjit|udlh|xwaz|aodg|quab|gxka|exhs|pzdo|bpjf|pizm|xtio|tdiz|txxv|jaat|hcwi|ekrz|zpyy|ppnm|yewo|upzi|zfmw|suii|alvm|zklz|xesg|nyqk|lvih|eppa|mbdk|soju|hnkt|ifsd|wnzk|pndo|ydrj|bzfs|madj|jhcz|ygnw|zrdu|qskm|lbux|qtdt|xjyy|zkfd|yzhd|dwgn|jdun|kteh|geke|warj|qucv|lvqs|jdda|vrfb|qzjj|rvuo|kzfr|jlka|svhy|dctk|lkss|viju|dqpq|dgxw|mcwy|rtxw|ptsj|bebg|kduq|iivb|zygi|hwql|sgia|hvmj|msxx|woxb|vvsc|zplz|brpf|iyyq|vdvp|dxre|mtky|csjv|yfdl|podp|svrn|eovx|nzax|uplb|neiv|yzdk|mtgq|qrzx|kkhl|rxgm|brqr|fqsv|wcpe|acyf|oqeo|utci|susu|ttha|qnnx|utwc|eoih|bema|abjh|ijyx|tihy|gyll|bkae|kett|mbtk|fuyr|fokr|cazl|exro|azla|cyzv|bnfx|mnxi|qlak|jlai|tcor|fcpy|hudz|zosz|tgzl|zqli|rody|xrvj|ntit|keji|xixi|wbmd|lajm|rlps|klqj|woth|fhmk|psxp|npaz|naph|ahfz|pdkb|fnga|tisy|kijq|drqj|fyym|nfej|vaqa|hnrk|lkeh|wbrh|rmie|iuab|lbxz|mvto|qkqo|wfbk|zawj|sfnb|dagk|vxts|pfnn|eatb|ozor|pkje|slxb|fmpv|yqil|owry|ducb|dywa|xguz|ybrj|eoff|lhfp|qwqk|pada|oele|szmo|lvdw|rsjh|ygid|mtrh|zycp|pfoe|icpz|vxkd|rsdm|isrf|nhsh|mbzq|rukh|usrj|cwno|nxph|utro|xghu|ynvw|wswr|vngd|ahpw|uimq|tirj|ysbv|aetj|wwsx|jxcu|fxvw|mszs|pcuo|tvjf|tsef|setx|zrnr|vcmk|pthb|vqpl|tzfa|lqpu|jqbg|flru|jdrb|agfb|qajb|gopo|dfen|vfnp|myvp|fptx|qvbv|qiii|uuaw|khnh|ujnj|mlds|wicf|ihwv|wumi|smhd|pfda|tltj|ixdo|xvor|zuid|hgst|xfqf|yuuy|qesp|ulke|rqoc|yyae|ejbr|lrob|xwrw|fgcc|phmn|jeib|btmn|sxbn|znio|qxhe|trto|tzty|ohqn|qaej|pgdk|oqvy|dnqb|lfmh|guom|pumx|hxnl|jxxm|pipj|hxjw|jlvu|mbql|hvnh|dzii|xpyx|fjtx|gxjd|ixuy|evpb|ogjp|wqxi|bogv|laoo|bslx|axtq|uwca|qzmp|gojb|kctw|nzlj|fuyw|klzo|nvpg|vhfx|vnmj|jrtx|yuin|lwbr|bpsh|txok|gvrp|acfz|tjga|kgew|rmrh|wszy|fulz|otgd|gnyh|fvsk|roox|xixy|nwqu|rdne|rngx|tyjq|gbrj|kgtn|zoys|pten|sptz|oxkh|kbin|uvwr|cgqw|smec|pvoe|hmdw|nkxs|bzzp|dkzu|txzu|ktrm|bbgp|esgh|ocza|mnoy|ejfc|xfwb|rwkz|mrbl|apwe|wmdr|ojgb|pfvi|napt|mwmb|wukl|rfzs|injw|jmpw|pmxe|pncm|smtx|xgee|oqhe|cqry|sipu|vaew|fuzw|ymkc|vvnr|lrip|nbsn|kjdn|nfdd|amcg|cncw|gmiw|juzo" $wlist = StringSplit($z, "|", 3) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _AD_OPEN() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _AD_CLOSE() Exit Case $Button1 generate() Case $Button2 setpw() EndSwitch WEnd Func GenSymbol() $symnum = Random(1, 7, 1) If $symnum = 1 Then Global $symbb = "!" If $symnum = 2 Then Global $symbb = "@" If $symnum = 3 Then Global $symbb = "$" If $symnum = 4 Then Global $symbb = ";" If $symnum = 5 Then Global $symbb = "?" If $symnum = 6 Then Global $symbb = "%" If $symnum = 7 Then Global $symbb = "#" EndFunc ;==>GenSymbol Func generate() Global $rnd = Random(1000, 9999, 1) Global $result = "" GUICtrlSetData($Input3, $result) Global $line = $wlist[Random(1, UBound($wlist))] GenSymbol() nato1() $line = $symbb & $line & $rnd GUICtrlSetData($Input3, $line) $rnd2 = StringSplit($rnd, "") EndFunc ;==>generate Func nato1() $myword = $line symbol($symbb) $array = StringSplit($myword, "", 1) For $i = 1 To UBound($array) - 1 $z = nato2($array[$i]) $result = $result & $nato & " " Next $nums = StringSplit($rnd, "", 1) For $i = 1 To UBound($nums) - 1 $y = digit($nums[$i]) $result2 = $result2 & $numb & " " Next $result = $symb & " " & $result & $result2 GUICtrlSetData($Label7, $result) ;GUICtrlSetData($Label8, "") $result = "" $result2 = "" EndFunc ;==>nato1 Func setpw() If Not GUICtrlRead($Input3) Then MsgBox(0, "Error", "You must generate a password first.") Else MsgBox(0, "Complete", "Password has been set. Thank you.") EndIf EndFunc ;==>setpw Func nato2($letter) If $letter = "a" Then Global $nato = "Alpha" If $letter = "b" Then Global $nato = "Bravo" If $letter = "c" Then Global $nato = "Charlie" If $letter = "d" Then Global $nato = "Delta" If $letter = "e" Then Global $nato = "Echo" If $letter = "f" Then Global $nato = "Foxtrot" If $letter = "g" Then Global $nato = "Golf" If $letter = "h" Then Global $nato = "Hotel" If $letter = "i" Then Global $nato = "India" If $letter = "j" Then Global $nato = "Juliet" If $letter = "k" Then Global $nato = "Kilo" If $letter = "l" Then Global $nato = "Lima" If $letter = "m" Then Global $nato = "Mike" If $letter = "n" Then Global $nato = "November" If $letter = "o" Then Global $nato = "Oscar" If $letter = "p" Then Global $nato = "Papa" If $letter = "q" Then Global $nato = "Quebec" If $letter = "r" Then Global $nato = "Romeo" If $letter = "s" Then Global $nato = "Sierra" If $letter = "t" Then Global $nato = "Tango" If $letter = "u" Then Global $nato = "Uniform" If $letter = "v" Then Global $nato = "Victor" If $letter = "w" Then Global $nato = "Whiskey" If $letter = "x" Then Global $nato = "X-ray" If $letter = "y" Then Global $nato = "Yankee" If $letter = "z" Then Global $nato = "Zulu" Return EndFunc ;==>nato2 Func symbol($sym) If $sym = "!" Then Global $symb = "Exclamation-Mark" If $sym = "@" Then Global $symb = "At-Sign" If $sym = "$" Then Global $symb = "Dollar-Sign" If $sym = ";" Then Global $symb = "Semi-Colon" If $sym = "?" Then Global $symb = "Question-Mark" If $sym = "%" Then Global $symb = "Percent-Sign" If $sym = "#" Then Global $symb = "Pound-Sign" Return EndFunc ;==>symbol Func digit($num) If $num = "1" Then Global $numb = "One" If $num = "2" Then Global $numb = "Two" If $num = "3" Then Global $numb = "Three" If $num = "4" Then Global $numb = "Four" If $num = "5" Then Global $numb = "Five" If $num = "6" Then Global $numb = "Six" If $num = "7" Then Global $numb = "Seven" If $num = "8" Then Global $numb = "Eight" If $num = "9" Then Global $numb = "Nine" If $num = "0" Then Global $numb = "Zero" Return EndFunc ;==>digit Feel free to update and make it better.1 point -
Better refine the requirements for the searched position Local $sOutput = StringRegExpReplace($sInput, '(?<=\s|^)(?=\w\))' , "(" ) Find the places just followed by "a char and ) " and preceded by "a space or start of string" (if needed) Because if you do something like this Local $sOutput = StringRegExpReplace($sInput, '(?:\s)(\w\))' , "($1" ) the non-capturing group is not captured but is still replaced, so the space is lost So you'll have to grab all into backreferences Local $sOutput = StringRegExpReplace($sInput, '(\s)(\w\))' , "$1($2" )1 point
-
Any other comments or questions? It was pretty impressive that example don't you think ?! -_0.1 point
-
Currently logged on user from Administrator to Standard User
Country73 reacted to JLogan3o13 for a topic
My question would remain the same, why post for a batch file in an AutoIt forum (much akin to posting for Java code in a C# forum)? Hopefully the code I provided will work for you, and will be a good launching point for you to learn more about the language. If you take some time to become familiar with AutoIt, you will find there isn't much you can't do with it.1 point