Jump to content

Realm

Active Members
  • Posts

    655
  • Joined

  • Last visited

  • Days Won

    1

Realm last won the day on March 1 2012

Realm had the most liked content!

About Realm

  • Birthday 12/29/1974

Profile Information

  • Member Title
    Lives in a tiny bubble
  • Location
    Campbellsville, KY
  • Interests
    Some of my Favorite things are NFL Sundays and Monday Night Football. I enjoy a wide variety of Movies. For a while now I have become addicted to AutoIT.

Recent Profile Visitors

626 profile views

Realm's Achievements

  1. Thanks @thegebi, I have updated my OP including your revision and added some commenting to the MsgBox's to better demonstrate how the functions work.
  2. Hello James, I never tested actually deleting a file or I might have noticed this: Change this line of code: FileDelete($files[$i]) ;delete the file if it is to this: FileDelete("C:\_TEMP" & '\' & $files[$i]) ;delete the file if it is That should actually delete the files for you....if not let me know.
  3. If by "BrowserApplication" you mean Internet Explorer.....You might want to look in the User Defined Functions section of your helpfile for the UDF IE.au3 It has several functions that help define and handle Internet Explorer controls to more easily automate a webpage.
  4. Hello James, 1. You will not need the #include <Array.au3> in the last example. I included in the first example in order to use the _ArrayDisplay() function to show no array was being populated. 2. I'm sorry about the @DesktopDir confusion, I meant to change that back to your directory call before I posted and forgot. I used @DesktopDir for my own testing purposes since I was certain I had text files both under and over 30 days there. You can freely change the directory and the .txt back to .log or whatever file extension you choose. Here is the version I should have posted: #include <Date.au3> #Include <File.au3> $files = _FileListToArray("C:\_TEMP", "*.log", 1) ;create an array of files in the specified folder $date = _NowCalc();getting the current date $newdate = _DateAdd("D",-30,$date) ;adding -30 days (subtract 30 days) $newdate = StringStripWS(StringReplace(StringReplace($newdate,':',''),'/',''), 8) ;putting the date back together in a format easily compared to the FileGetTime func If IsArray($files) Then ;Making sure an array was created For $i = 1 To UBound($files) - 1 ;Loop through all the files found $aTime = FileGetTime("C:\_TEMP" & '\' & $files[$i], 1, 1) ;get the creation time of the file If $aTime < $newdate Then ;check to see if creation time is older than 120 days FileDelete($files[$i]) ;delete the file if it is EndIf Next EndIf I hope this helps, and feel free to ask any other questions you might have about this script or any other script. Realm
  5. You have a few things here that are going against your results. I have copied your code, added some testing functions so I can show you what is going wrong here in this first snippet. #include <Date.au3> #Include <File.au3> #include <Array.au3> $files = _FileListToArray("C:\_TEMP", "*.log", 2) ;create an array of files in the specified folder _ArrayDisplay($files) ;including this function you can see no array is being created. Reason is because in the thirdparameter it ;requires '1' to return files, or searches for Directories with those names if '2' is the third parameter. ;We need to change that thrid parameter to '1') $date = @YEAR&"/"&@MON&"/"&@MDAY;getting the current date $newdate = _DateAdd("D",-30,$date) ;adding -30 days (subtract 30 days) MsgBox('', 'Is it being converted?', ' $date=' & $date & @CRLF & '$newdate=' & $newdate) ;The problem here is that _DateAdd is looking for a specific time format to convert, not any format will do ;This is easily correct by calling the current date with _NowCalc which will provide the date and time format ;that _DateAdd() requires. $formatdate = StringSplit($newdate,"/") ;removing the / ;These line of code will nolonger be needed utilizing a few functions nested together ;in this next line of code. $newdate = $formatdate[1]&$formatdate[2]&$formatdate[3]&@HOUR&@MIN&@SEC ;putting the date back together in a format easily compared to the FileGetTime func If IsArray($files) Then ;Making sure an array was created For $i = 1 To UBound($files) - 1 ;Loop through all the files found $aTime = FileGetTime("C:\_TEMP" & $files[$i], 1, 1) ;get the creation time of the file ;The path also needs a file/directory seperator If $aTime < $newdate Then ;check to see if creation time is older than 120 days FileDelete($files[$i]) ;delete the file if it is EndIf Next EndIf Now, I have modified your script a little while trying to keep your format as much as possible. I do believe this will work better for you. #include <Date.au3> #Include <File.au3> $files = _FileListToArray(@DesktopDir, "*.txt", 1) ;create an array of files in the specified folder $date = _NowCalc();getting the current date $newdate = _DateAdd("D",-30,$date) ;adding -30 days (subtract 30 days) $newdate = StringStripWS(StringReplace(StringReplace($newdate,':',''),'/',''), 8) ;putting the date back together in a format easily compared to the FileGetTime func If IsArray($files) Then ;Making sure an array was created For $i = 1 To UBound($files) - 1 ;Loop through all the files found $aTime = FileGetTime(@DesktopDir & '\' & $files[$i], 1, 1) ;get the creation time of the file If $aTime < $newdate Then ;check to see if creation time is older than 120 days FileDelete($files[$i]) ;delete the file if it is EndIf Next EndIf I hope this helps, and please let me know if it does. Realm
  6. I just noticed in your comment in Function _CheckExcludes() that if an exclusion is found it's supposed to stop checking. However I don't see anything to stop checking, so more than likely $excludes=0 is reset and the last element in your exclusions is passing a string that you once found an exclusion. Adding an Exitloop will stop checking for more exclusions and list this string to be excluded. Try this function out and tell if it does the trick? ;##################################################################################################### ;Function to loop through the array of exclusions & check if any of the exclusions exist in our string ;##################################################################################################### Func _CheckExcludes() ;clear previous value for $excludes $excludes=0 ; check the string against a list of exclusions (ie. URLs) For $i = 1 to Ubound($arrExcludes)-1 $excludes = StringInStr($myCircuit, $arrExcludes[$i]) ;if exclusion found, then stop checking If $excludes Then ;Msgbox ("","Exclusion Found At",$excludes) ExitLoop EndIf Next EndFunc ....Or if you prefer to know how many different exclusions where found in the string, then you could do something like this: ;##################################################################################################### ;Function to loop through the array of exclusions & check if any of the exclusions exist in our string ;##################################################################################################### Func _CheckExcludes() ;clear previous value for $excludes $excludes=0 ; check the string against a list of exclusions (ie. URLs) Local $excludeFound For $i = 1 to Ubound($arrExcludes)-1 $excludeFound = StringInStr($myCircuit, $arrExcludes[$i]) If $excludeFound Then $excludes += 1 Next EndFunc Realm
  7. Hello hogfan, It appears you are missing the actual array call in your StringInString() function. Hope this helps you. Func _CheckExcludes() ;clear previous value for $excludes $excludes=0 ; check the string against a list of exclusions (ie. URLs) For $i = 1 to Ubound($arrExcludes)-1 $excludes = StringInStr($myCircuit, $arrExcludes[$i]) ;if exclusion found, then stop checking If $excludes Then ;Msgbox ("","Exclusion Found At",$excludes) EndIf Next EndFunc Realm Edit: removed unintentional message.
  8. Simply put: For $i = 1 to 4 _DoSomething() Next Func _DoSomething() ;DoSomething EndFunc
  9. This works beautifully on the actual files. Thanks. I looked at your UDF Example in the forums and noticed that you took it upon yourself to rewrite the original wrapper. I do believe it was the old wrapper I tried using a year or so ago and found difficult to understand and use. I'm going to take a closer look at your UDF and see what I can learn and do with it. I do believe this will be a faster and more reliable approach. Thanks for replying and all your hard work on the wrapper!
  10. I have absolutely no experience with XML files. I have tried using the XMLWrapper long ago, but wasn't too pleased with it's speed and found it to be a little too complicated and difficult to understand. However I did try to reproduce an example that you written to help another forum member from this post: I wasn't able to read the child nodes or extract the attributes I'm looking for. So I turned to SRE for a quick and dirty approach. I am sure DOM would be more reliable, but would it be a faster, or as fast, approach?
  11. Hey guys, I need a little help with my SRE pattern. I'm attempting to extract just a few attributes from an XML file. I thought I could get this to work, but I'm hitting an unforeseen dilemma here. I have included a reproducer script containing 2 example objects and the differences between possible attributes contained in separate objects, along with my attempt at an SRE pattern. I don't need to collect the values of all attributes, just a select few attributes if the object contains them. #include <array.au3> Local $sText = "" & _ "<Item CatalogID='ID_15674'>" & _ " <SUPPLIER_NAME_STRING id='ID1014_161'/>" & _ " <BRANDNAME_STRING id='ID1043_111'/>" & _ " <QRYTEXT_STRING id='ID1082_8519'/>" & _ " <RARITY_STATUS id='ID1164_2'/>" & _ " <ARTID value='27700'/>" & _ " <SUPPLIER_NUMBER value='127700'/>" & _ " <OFFSET_ID value='ID_22265'/>" & _ " <STAMP value='256/350'/>" & _ " <STYLE value='1'/>" & _ " <IS_PROMOTIONAL value='0'/>" & _ "</Item>" & _ "<Item CatalogID='ID_15675'>" & _ " <SUPPLIER_NUMBER value='389844'/>" & _ " <OFFSET_ID value='ID_15674'/>" & _ " <IS_COMPLETED/> " & _ "</Item>" Local $srePattern = "(?mx) " & _ "^ \<Item CatalogID\=\'(.*?)\'\>" & _ "(\<BRANDNAME\_STRING id\=\'(.*?)\'\/\>)?" & _ "(\<COLLECTION\_STATUS id\=\'(.*?)\'\/\>)?" & _ "(\<OFFSET\_ID value\=\'(.*?)\'\/\>)?" & _ "(\<STAMP value\=\'(.*?)\'\/\>)?" & _ "(\<IS\_PROMOTIONAL value\=\'(.*?)\'\/\>)?" & _ "(\<IS\_COMPLETED\/\>)?" & _ "(\<\/Item\>$" $aSRE = StringRegExp( $sText, $srePattern,3) If @error Then MsgBox('','SRE Error',@error & @CRLF & StringLeft($srePattern,@extended)) _ArrayDisplay($aSRE)
  12. WinGetHandle() will return the internal handle of a window.
  13. Sorry it didn't help, but I thought it might have been relevant and would give you an idea how to develop yours. Maybe I misunderstood your question. I thought that the section(s) in my script that had special rules such as using a number, or only uppercase would have helped you. If I understand your question correctly wouldn't the random function fit as a simple solution? $iRandom = Random(27,52,1) $sRandomChar = $aKSet[$iRandom] Edit: A rudimentary form of making sure not to include the letters K, L, or M: While 1 $iRandom = Random(27,52,1) $sRandomChar = $aKSet[$iRandom] If Not StringInStr( 'K,L,M', $sRandomChar) Then ExitLoop WEnd
  14. I wrote a very rudimentary Random String Generator quickly last year for creating stronger passwords for websites. I incorporated a GUI with a few options for creating passwords based on a few different sites, and the rules that applied to making passwords. Again it's simple and to the point, nothing extraordinary, but I'm happy to share it with you if it may give you an idea on how to develop your applicaton #cs TITLE - Random String Generator Title: Random String Generator Filename: generator\generator.au3 Description: Author: Realm a.k.a MicroRealm Version: 2014.0.0.8 Initial Alpha: April 24th, 2014 Last Update: July 2nd, 2014 Script state Requirements: AutoIt3 3.3.10.0 or higher Other Reguirements: None #ce #cs DEVELOPMENT LOG v 2014.0.0.8 - July 2nd, 2014 -Added Character Support for eBay v 0.0.0.7 - June 11th, 2014 -Added Full Character support *Realm 1.5 v 0.0.0.6 - April 26th, 2014 -Fixed 2014-1: Array variable has incorrect number of subscripts or subscript dimension range exceeded.(259) -------------> Modified _Singular_Randomizer() to repopulate character pools once the original pool is exhausted. *Realm 0.5 v 0.0.0.5 - April 25th, 2014 -Created: _String_Randomiser() to simply resort strings randomly. *Realm 0.5 -Cleaned up Comments *Realm 0.5 v 0.0.0.4 - April 25th, 2014 -Modified: _Singular_Randomiser to randomize the generatorlists and strings before picking *Realm 2.25 v 0.0.0.3 - April 25th, 2014 -Created _Singular_Randomizer() Algorithm to deliver random passwords without duplicate characters. *Realm 1.5 v 0.0.0.2 - April 24th, 2014 -Created GUI -Created Internal Global Settings for objects *Realm 3.25 v 0.0.0.1 - April 24th, 2014 -Alpha Stage Initiated. *Realm 1.25 #ce ============================================================================================================================ #Region - Inlcudes #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Array.au3> #EndRegion - Includes #Region - Main Script ;Easy GUI Size Adjustments Local $iCols = 2 Local $iRows = 11 Local $iHdrs = 3 Local $iPadding_border = 5 Local $iPadding_column = 2 Local $iPadding_row = 2 Local $iDepth_AllObjects = 20 Local $iWidth_Col_a = 75 Local $iWidth_Col_b = 213 Local $hdrDepth = 30 Local $hdrWidth = FindGreatestObject($iWidth_Col_a, $iWidth_Col_b) Local $iWidth_gui = ($iPadding_border * 2) + ($iPadding_column * ($iCols - 1)) + ($iWidth_Col_a + $iWidth_Col_b) Local $iDepth_gui = ($iPadding_border * 2) + ($iPadding_row * (($iHdrs - 1) + ($iRows - 1))) + ($iDepth_AllObjects * $iRows) + ($hdrDepth * $iHdrs) Local $iTop_MainModule = $iPadding_border + 1 Local $hdrLeft = 0 Local $butDepth = 20 Local $butWidth = 150 Local $cbWidth = $iDepth_AllObjects Local $cbDepth = $iDepth_AllObjects Local $cbLeft = $iPadding_border + 1 + $iWidth_Col_a - $cbWidth Local $inpWidth = 60 Local $inpDepth = $iDepth_AllObjects Local $inpLeft = $iPadding_border + 1 + ($iWidth_Col_a - $inpWidth) Local $lblWidth = $iWidth_Col_b Local $lblLeft = $iPadding_border + 1 + $iWidth_Col_a + $iPadding_column Local $iTop = $iTop_MainModule Global $cb_rul_characters, $cb_rul_spclA ;GUI Local $guiMain = GUICreate($iWidth_gui & 'x' & $iDepth_gui & ' generator', $iWidth_gui, $iDepth_gui) GUISetFont(12.5) ;Settings Section GUICtrlCreateLabel('Settings:', $hdrLeft, $iTop, $hdrWidth, $hdrDepth ) GUICtrlSetFont(-1, 16, 400) $iTop += ($hdrDepth + $iPadding_row) Local $iLimitMax = 512 Local $iLimitMin = 1 Local $inp_chars = GUICtrlCreateInput('16', $inpLeft, $iTop, $inpWidth, $inpDepth, $SS_RIGHT) GUICtrlSetLimit($inp_chars, $iLimitMax, $iLimitMin) GUICtrlCreateUpdown($inp_chars) GUICtrlCreateLabel('Random Characters', $lblLeft, $iTop, $iWidth_Col_b, $iDepth_AllObjects ) $iTop += ($inpDepth + $iPadding_row) ;Inlcude Section GUICtrlCreateLabel('Include:', $hdrLeft, $iTop, $hdrWidth, $hdrDepth) GUICtrlSetFont(-1, 16, 400) $iTop += ($hdrDepth + $iPadding_row) $cb_rul_letters = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Consist of letters', $lblLeft, $iTop, $lblWidth, $cbDepth) $iTop += ($cbDepth + $iPadding_row) $cb_rul_numbers = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Consist of numbers', $lblLeft, $iTop, $lblWidth, $cbDepth) $iTop += ($cbDepth + $iPadding_row) $cb_rul_characters = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Consist of characters', $lblLeft, $iTop, $lblWidth, $cbDepth) $iTop += ($cbDepth + $iPadding_row) $cb_rul_spclA = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlCreateLabel('Only Chars: (!,@,#,%)', $lblLeft, $iTop, $lblWidth, $cbDepth ) $iTop += ($cbDepth + $iPadding_row) ;eBay $cb_rul_spclB = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetTip($cb_rul_spclB, 'eBay', 'Examples:') GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlCreateLabel('No Chars: (<,>,[,],/)', $lblLeft, $iTop, $lblWidth, $cbDepth ) $iTop += ($cbDepth + $iPadding_row) ;Rules Section GUICtrlCreateLabel('Rules:', $hdrLeft, $iTop, $hdrWidth, $hdrDepth) GUICtrlSetFont(-1, 16, 400) $iTop += ($hdrDepth + $iPadding_row) $cb_inc_lower = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Include a lower case letter', $lblLeft, $iTop, $lblWidth, $cbDepth ) $iTop += ($cbDepth + $iPadding_row) $cb_inc_upper = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Include an upper case letter', $lblLeft, $iTop, $lblWidth, $cbDepth ) $iTop += ($cbDepth + $iPadding_row) $cb_Inc_number = GUICtrlCreateCheckbox('', $cbLeft, $iTop, $cbWidth, $cbDepth) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateLabel('Include a number', $lblLeft, $iTop, $lblWidth, $cbDepth) $iTop += ($cbDepth + $iPadding_row) ;Run Module button $iTop += ($iDepth_AllObjects + $iPadding_row) ;Added for spacer between last section and button $but_run = GUICtrlCreateButton('Run', ($iWidth_gui - $butWidth) / 2, $iTop-10, $butWidth, $butDepth+10) $iTop += ($cbDepth + $iPadding_row) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = -3 ;$GUI_EVENT_CLOSE Exit Case $msg = $but_run Local $iChar = 0 If _IsChecked($cb_rul_spclB) Then $iChar = 4 ElseIf _IsChecked($cb_rul_spclA) Then $iChar = 2 ElseIf _IsChecked($cb_rul_characters) Then $iChar = 1 EndIf Local $sReturn = _Singular_Randomizer(Int(GUICtrlRead($inp_chars)),_IsChecked($cb_rul_letters),_IsChecked($cb_Inc_number),$iChar,_IsChecked($cb_inc_lower),_IsChecked($cb_inc_upper),_IsChecked($cb_rul_numbers)) ClipPut($sReturn) TrayTip('New ' & StringLen($sReturn) & ' Character Password Created.', 'Password hass been placed in your clipboard.', 30) ;Rules CheckBox Group "Changes in this Group must be changed in Function CheckBoxGroup_Rules() as well" Case $msg = $cb_rul_characters If _IsChecked($cb_rul_characters) Then CheckBoxGroup_Rules($cb_rul_characters) Case $msg = $cb_rul_spclA If _IsChecked($cb_rul_characters) Then CheckBoxGroup_Rules($cb_rul_spclA) Case $msg = $cb_rul_spclB If _IsChecked($cb_rul_characters) Then CheckBoxGroup_Rules($cb_rul_spclB) EndSelect WEnd #EndRegion - Main Script #Region - Core Functions ;Checkbox Group - Characters Func CheckBoxGroup_Rules($controlID) If $cb_rul_characters <> $controlID Then GUICtrlSetState($cb_rul_characters, $GUI_UNCHECKED) If $cb_rul_spclA <> $controlID Then GUICtrlSetState($cb_rul_spclA, $GUI_UNCHECKED) If $cb_rul_spclB <> $controlID Then GUICtrlSetState($cb_rul_spclB, $GUI_UNCHECKED) EndFunc ;FindGreatest Object Func FindGreatestObject($iParam1, $iParam2 = 0, $iParam3 = 0, $iParam4 = 0, $iParam5 = 0, $iParam6 = 0, $iParam7 = 0, $iParam8 = 0, $iParam9 = 0, $iParam10 = 0, $iParam11 = 0, $iParam20 = 0, $iParam21 = 0, $iParam22 = 0, $iParam23 = 0, $iParam24 = 0, $iParam25 = 0) Local $iObjects = @NumParams Local $str = 'iParam' Local $iGreatestObject = 0, $iObj For $i = 1 To $iObjects $iObj = Int(Eval($str & $i)) If $iObj > $iGreatestObject Then $iGreatestObject = $iObj Next Return $iGreatestObject EndFunc ;_IsChecked Func _IsChecked($iControlID) Return BitAND(GUICtrlRead($iControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func _Singular_Randomizer($iCount, $letters, $numbers, $iChar, $incLower, $incUpper, $incNumber) Local $string, $list, $ub = 0, $sListRestore If $letters Then If $incLower Then $sListRestore &= _String_Randomiser('ABCDEFGHIJKLMNOPQRSTUVWXYZ') $aTemp = StringSplit( _String_Randomiser('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), '', 1+2) $ub = Random(0,25,1) $string &= $aTemp[$ub] _ArrayDelete($aTemp,$ub) For $i = 0 To UBound($aTemp)-1 $list &= $aTemp[$i] Next $iCount -= 1 EndIf If $incUpper Then $sListRestore &= _String_Randomiser('abcdefghijklmnopqrstuvwxyz') $aTemp = StringSplit( _String_Randomiser('abcdefghijklmnopqrstuvwxyz'), '', 1+2) $ub = Random(0,25,1) $string &= $aTemp[$ub] _ArrayDelete($aTemp,$ub) For $i = 0 To UBound($aTemp)-1 $list &= $aTemp[$i] Next $iCount -= 1 EndIf EndIf If $numbers Then $sListRestore &= _String_Randomiser('0123456789') $aTemp = StringSplit( _String_Randomiser('0123456789'), '', 1+2) $ub = Random(0,9,1) $string &= $aTemp[$ub] _ArrayDelete($aTemp,$ub) For $i = 0 To UBound($aTemp)-1 $list &= $aTemp[$i] Next $iCount -= 1 EndIf If $iChar Then Local $sChar If BitAND($iChar, 2) Then $sChar = '!@#%' Else ;0-255 $sChar &= Chr(33) For $i = 33 To 46 $sChar &= Chr($i) Next If BitAND($iChar, 1) Then $sChar &= Chr(47) For $i = 58 To 59 $sChar &= Chr($i) Next If BitAND($iChar, 1) Then $sChar &= Chr(60) $sChar &= Chr(61) If BitAND($iChar, 1) Then $sChar &= Chr(62) For $i = 63 To 64 $sChar &= Chr($i) Next If BitAND($iChar, 1) Then $sChar &= Chr(91) $sChar &= Chr(92) If BitAND($iChar, 1) Then $sChar &= Chr(93) For $i = 94 To 96 $sChar &= Chr($i) Next For $i = 123 To 126 $sChar &= Chr($i) Next $sListRestore &= $sChar $aTemp = StringSplit( _String_Randomiser($sChar), '', 1+2) $ub = Random(0,3,1) $string &= $aTemp[$ub] _ArrayDelete($aTemp,$ub) For $i = 0 To UBound($aTemp)-1 $list &= $aTemp[$i] Next $iCount -= 1 EndIf EndIf ;~ If $spclA Then ;~ $sListRestore &= _String_Randomiser('!@#%') ;~ $aTemp = StringSplit( _String_Randomiser('!@#%'), '', 1+2) ;~ $ub = Random(0,3,1) ;~ $string &= $aTemp[$ub] ;~ _ArrayDelete($aTemp,$ub) ;~ For $i = 0 To UBound($aTemp)-1 ;~ $list &= $aTemp[$i] ;~ Next ;~ $iCount -= 1 ;~ EndIf Local $aGenList = StringSplit( _String_Randomiser($list), '', 1+2) While $iCount $ub = Random(0, Int(UBound($aGenList))-1, 1) $string &= $aGenList[$ub] _ArrayDelete($aGenList,$ub) $iCount -= 1 If Not UBound($aGenList) Then $aGenList = StringSplit( _String_Randomiser($sListRestore), '', 1+2) EndIf WEnd ;Randomize String before returning Return _String_Randomiser($string) EndFunc Func _String_Randomiser($sString) $aString = StringSplit($sString, '', 1+2) $sString = '' Do $ub = Random(0,Int(UBound($aString))-1,1) $sString &= $aString[$ub] _ArrayDelete($aString,$ub) Until Not UBound($aString) Return $sString EndFunc #EndRegion - Core Functions
  15. Does it have to be RegExp? I'd personally use _FileReadToArray(), and then use RegExp to extract the needed data from the line I need.
×
×
  • Create New...