Jump to content

weaponx

MVPs
  • Posts

    5,295
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by weaponx

  1. This will search within the folder "Base" for any folders beginning with "Dir" only. $array = RecursiveFileSearch("Base", "", "^(Dir)", 2) For $X = 0 to $array[0] ConsoleWrite('['&$X&']: ' & $array[$X] & @CRLF) ;ConsoleWrite(StringTrimLeft($array[$X], 9) & @CRLF) Next #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: WeaponX Updated: 2/21/08 Script Function: Recursive file search 2/21/08 - Added pattern for folder matching, flag for return type 1/24/08 - Recursion is now optional Parameters: RFSstartdir: Path to starting folder RFSFilepattern: RegEx pattern to match ".(mp3)" - Find all mp3 files - case sensitive (by default) "(?i).(mp3)" - Find all mp3 files - case insensitive "(?-i).(mp3|txt)" - Find all mp3 and txt files - case sensitive RFSFolderpattern: "(Music|Movies)" - Only match folders named Music or Movies - case sensitive (by default) "(?i)(Music|Movies)" - Only match folders named Music or Movies - case insensitive "(?!(Music|Movies)b)bw+" - Match folders NOT named Music or Movies - case sensitive (by default) RFSFlag: Specifies what is returned in the array 0 - Files and folders 1 - Files only 2 - Folders only RFSrecurse: TRUE = Recursive, FALSE = Non-recursive RFSdepth: Internal use only #ce ---------------------------------------------------------------------------- Func RecursiveFileSearch($RFSstartDir, $RFSFilepattern = ".", $RFSFolderpattern = ".", $RFSFlag = 0, $RFSrecurse = true, $RFSdepth = 0) ;Ensure starting folder has a trailing slash If StringRight($RFSstartDir, 1) <> "" Then $RFSstartDir &= "" If $RFSdepth = 0 Then ;Get count of all files in subfolders for initial array definition $RFSfilecount = DirGetSize($RFSstartDir, 1) ;File count + folder count (will be resized when the function returns) Global $RFSarray[$RFSfilecount[1] + $RFSfilecount[2] + 1] EndIf $RFSsearch = FileFindFirstFile($RFSstartDir & "*.*") If @error Then Return ;Search through all files and folders in directory While 1 $RFSnext = FileFindNextFile($RFSsearch) If @error Then ExitLoop ;ConsoleWrite($RFSnext & @CRLF) ;If folder and recurse flag is set and regex matches If StringInStr(FileGetAttrib($RFSstartDir & $RFSnext), "D") Then If $RFSrecurse Then RecursiveFileSearch($RFSstartDir & $RFSnext, $RFSFilepattern, $RFSFolderpattern, $RFSFlag, $RFSrecurse, $RFSdepth + 1) If $RFSFlag <> 1 AND StringRegExp($RFSnext, $RFSFolderpattern, 0)Then ;Append folder name to array $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf EndIf ElseIf StringRegExp($RFSnext, $RFSFilepattern, 0) AND $RFSFlag <> 2 Then ;Append file name to array $RFSarray[$RFSarray[0] + 1] = $RFSstartDir & $RFSnext $RFSarray[0] += 1 EndIf WEnd FileClose($RFSsearch) If $RFSdepth = 0 Then Redim $RFSarray[$RFSarray[0] + 1] Return $RFSarray EndIf EndFunc ;==>RecursiveFileSearch
  2. I'll see what I can do. As of right now the UDF only retrieves information. I intended it to do everything Devcon can but testing it is very tricky if I want to avoid hosing my system.
  3. Are you using gdi for this? Sounds a little insane when Windows 7 comes with a magnification tool. http://windows.microsoft.com/en-US/windows7/Make-items-on-the-screen-appear-bigger-Magnifier
  4. The only problem I have with this is it leaves the carriage return at the end of the match, and it I can't get it to ignore it.
  5. You can't copy and paste AutoIt code because it puts it all on one line, you have to click Popup then copy it.
  6. $string = _ 'Last Login Time: 07:22:03 pm 03/10/10' & @CRLF & _ 'Account Locked: False' & @CRLF & _ 'Account Disabled: False' & @CRLF & _ 'Grace Logins Allowed: 3' & @CRLF & _ 'Remaining Grace Logins: 3' & @CRLF & _ 'Last Intruder Address:' & @CRLF & _ 'TCP/IP Network Address' & @CRLF & _ 'IP Address: 30.20.222.74' & @CRLF & _ 'Maximum Connections: 6' & @CRLF & _ 'Login Script:' & @CRLF & _ 'map k:=lao-nws_user_server\users2:' & @CRLF & _ '' & @CRLF & _ '@NET USE x: \\loap01\teams' & @CRLF & _ 'Login Time: 05:09:48 am 03/11/10' & @CRLF & _ 'modifiersName: CN=CGNDSDR' $result = StringRegExp($string, "(?m)^Login Time: (.+)",1) If @ERROR Then MsgBox(0,"",@ERROR) For $X = 0 to Ubound($result)-1 ConsoleWrite($result[$X] & @CRLF) Next
  7. Have you tried _IETableWriteToArray ?
  8. So the files can be renamed. They would need to be blocked by a hash.
  9. What good is this if the files can be copied from the removable device and executed?
  10. Huh? Nobody uses ftp for local network file sharing. If you have admin rights on these systems you can just use named pipes. Fyzzle can you provide any code?
  11. Rather than passing the options individually, why can't you just pass it as one string? Global $img = ObjCreate("ImageMagickObject.MagickImage.1") $options = '' $options &= "source.JPG " $options &= "-gravity " $options &= "south " $options &= "-background " $options &= "#afbc22 " $options &= "-splice " $options &= "0x60 " $options &= "-font " $options &= "OCR-A-Extended " $options &= "-pointsize " $options &= "12 " $options &= "-annotate " $options &= "+0+0 " $options &= "filename goes here " $options &= "testoutput.jpg" $NewImage = $img.Convert($options)
  12. #include <GuiConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> ; Initialize GDI+ library _GDIPlus_Startup () ; Capture full screen $hBitmap = _ScreenCapture_Capture() ;Capture window ;$hWin = WinGetHandle ("SciTE") ;$hBitmap = _ScreenCapture_CaptureWnd('', $hWin) $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap) $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hImage) ;Get dimensions $iWidth = _GDIPlus_ImageGetWidth($hImage) $iHeight = _GDIPlus_ImageGetHeight($hImage) $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG") ;Draw semi transparent rectangle along bottom $hBrush1 = _GDIPlus_BrushCreateSolid(0x7F000000) _GDIPlus_GraphicsFillRect($hGraphic, 0, $iHeight-40,$iWidth,40,$hBrush1) ;Define font $hBrush2 = _GDIPlus_BrushCreateSolid (0xFFFFFFFF) ;Text color (white) $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat,1) ;Center text horizontally $hFamily = _GDIPlus_FontFamilyCreate ("Arial") ;Typeface $hFont = _GDIPlus_FontCreate ($hFamily, 20, 1) ;Font style (20pt, bold) $tLayout = _GDIPlus_RectFCreate (0, $iHeight-40,$iWidth,40) ;Draw text along bottom _GDIPlus_GraphicsDrawStringEx ($hGraphic, "Hello world", $hFont, $tLayout, $hFormat, $hBrush2) ; Save resultant image (high quality) $tParams = _GDIPlus_ParamInit (1) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", 100) ;quality 0-100 $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) $pParams = DllStructGetPtr($tParams) _GDIPlus_ImageSaveToFileEx($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg", $sCLSID, $pParams) ; Save resultant image (low quality) ;_GDIPlus_ImageSaveToFile ($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg") ; Clean up resources _GDIPlus_ImageDispose ($hImage) _GDIPlus_GraphicsDispose($hGraphic) _WinAPI_DeleteObject ($hBitmap) _GDIPlus_BrushDispose($hBrush1) _GDIPlus_BrushDispose($hBrush2) ; Shut down GDI+ library _GDIPlus_ShutDown ()
  13. Why can't you install silently using command line switches?
  14. How can we test this without adequate details? A search for "MCP_EnumPrinter" finds nothing on Google.
  15. Oh also, this script violates the Heroes of Newarth TOS:
  16. Don't open or close dll's inside a loop. Don't use DllCall with a filename, use a handle....
  17. Okay well in this case, straight from the Battles For Glory website: http://translate.googleusercontent.com/translate_c?hl=en&sl=ru&tl=en&u=http://www.bsfg.ru/%3Frules&rurl=translate.google.com&usg=ALkJrhjZAzO9ccwcFg9g5ZNgwPEVq_TMuw
  18. Discussion of game bots is prohibited.
  19. This can be done with straight GDI+, i'm looking for a good example.
  20. Manadar's code seems correct to me.
  21. Roll your own function dude, it's not difficult. $timestamp = _NOW() ConsoleWrite($timestamp & @CRLF) ConsoleWrite("Year: " & _Year($timestamp) & @CRLF) ConsoleWrite("Month: " & _Month($timestamp) & @CRLF) ConsoleWrite("Day: " & _Day($timestamp) & @CRLF) ConsoleWrite("Hour: " & _Hour($timestamp) & @CRLF) ConsoleWrite("Minute: " & _Minute($timestamp) & @CRLF) ConsoleWrite("Second: " & _Second($timestamp) & @CRLF) Func _Now() Return StringFormat('%i-%02i-%02i %02i:%02i:%02i',@YEAR, @MON,@MDAY,@HOUR,@MIN,@SEC) EndFunc Func _Year($ts) Return StringMid($ts,1,4) EndFunc Func _Month($ts) Return StringMid($ts,6,2) EndFunc Func _Day($ts) Return StringMid($ts,9,2) EndFunc Func _Hour($ts) Return StringMid($ts,12,2) EndFunc Func _Minute($ts) Return StringMid($ts,15,2) EndFunc Func _Second($ts) Return StringMid($ts,18,2) EndFunc
  22. http://preventrilo.com/
  23. Read the help file... @MON @MDAY @YEAR @HOUR @MIN @SEC
  24. Don't even bother with Win*() functions. Use RunWait() and install it silently like a real man. http://support.myteks.net/xp-sp3-silent-install
×
×
  • Create New...