Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/19/2014 in all areas

  1. CodeCrypter enables you to encrypt scripts without placing the key inside the script. This is because this key is extracted from the user environment at runtime by, for example: password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here): Latest version: 3.4 (3 Dec 2021): please follow this link. Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly. How the bits and pieces fit together: CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here: '?do=embed' frameborder='0' data-embedContent>> The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init(). From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely: In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really. Not convinced? Check out: a simple HowTo Guide: HowToCodeCrypt.pdf an updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:CodeCrypterFAQ.pdf For additional explanations/examples in response to specific questions by forum members (how it works, what it can/cannot do), see elsewhere in this thread, notably: Simple analogy of how it works: post #53, second part General Explanation and HowTo: post #9, 51, 75, 185/187, 196, 207, 270, 280 (this gets a bit repetitive) BackTranslation: post #179 Obfuscation: post #36 (general), 49 (selective obfuscation) Specific features and fixes: post #3 (security), 84 (redefining the expected runtime response), 169 (Curl Enum fix), 185/187 (using license keys), 194 (replacing Ward's AES UDF with different encryption/decryption calls), 251 (AV detection issue), 262 (extract key contents to USB on different target machine prior to encryption) Limitations: post #26 (@error/@extended), 149 (FileInstall), 191 (AES.au3 on x64) Not recommended: post #46/249 (static encryption), 102 (programme logic error), 237 (parsing password via cmdline) Technical notes: BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want). CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples. Encryption currently relies on Ward's excellent AES UDF and TheXman's sophisticated CryptoNG bundle. You can replace these with any other algorithm you like (but this is not trivial to do: edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry(), see post #194 in this thread). AES by Ward, and CryptoNG by TheXman are also included in the bundle (with many thanks to Ward and TheXman for graciously allowing me to republish their outstanding work). Going to lie down now... RT
    1 point
  2. This is basically two functions (plus supporting infrastructure): _Xbase_ReadToArray($filename, Byref $array, [...]) _Xbase_WriteFromArray($filename, Byref $array, [...]) that transfer all data from one container to the other. Various optional formatting parameters are detailed in the Remarks section of the script; a small test script plus dbf test file (the latter from the (free) Harbour distribution, see here) are provided for your entertainment. Note that the $array variable has to exist already, as it's parsed ByRef, but it does not have to have the correct dimensions. This is pure AutoIt (no SQL, no ADO, no dlls, no external dependencies). The Xbase specification was gleaned from here. There is no support (either currently or planned) for a GUI, or additional functionality; it's just a simple data interface I needed for my MatrixFileConverter for Eigen4Autoit (link in signature), that might be of use to others (see MatrixFileConverter.au3 for an implementation example). One thing to keep in mind is AutoIt's array size limitation (16 MB elements); Xbase files can be considerably larger. On the other hand, AutoIt arrays are less restricted in their number of columns than (certain versions of) Xbase (see script for details). Appropriate error messages will inform you when you've hit these buffers. Xbase.v0.8.7z third beta release
    1 point
  3. Mat

    Semantic version library

    Semantic versioning (SemVer) is a style of version numbers that defines more precisely the version numbering format. The official specification can be found at semver.org. In summary, version numbers consist of Major version, minor version and patch (in the normal 1.2.3 form). Major version changes indicate what AutoIt would call "script breaking" changes. Minor versions add functionality, and patches fix bugs. In addition, semantic versioning allows for pre-release tagging, so rather than a beta cycle that goes 1.3.1, 1.3.2, 1.3.3 etc, before a release of 1.4.0 you'd have 1.4.0-beta1, 1.4.0-beta2 etc. Builds can also contain metadata, so a full version string could be "1.4.0-beta2+compatibilitybuild" or something along those lines. The cool bit is conditions. This means you can write the normal dependency strings and compare versions against them. For example ">1.2.1 <=1.2.3" matches any of 1.2.1, 1.2.2, 1.2.3 and any pre-releases of 1.2.2 or 1.2.3 (but not pre-releases of 1.2.1). You can also match like "=1.2.*" or match according to versions that are compatible, or reasonably close. The api is very similar to how it is used in other languages. Npm has its library here, which has a good description of the types of comparisons. The examples on that page are the basis for most of the unit tests. SemVer.au3 Fork me on Github Thanks to Manadar for some of the unit tests, and Assert() function taken from his assert.au3. As a final note, AutoIt does not use semantic versioning, and a version number with 4 parts will not match as being valid under this system. Semver in other languages: .NET, Node.js, Ruby, PHP, Go, Java, Python, you get the idea. Basically search github and you'll find a compatible library in any language. comparison based on pre-release tags isn't implemented yet, though is defined by the standard.
    1 point
  4. Jon

    AutoIt v.3.3.13.17 Beta

    File Name: AutoIt v.3.3.13.17 Beta File Submitter: Jon File Submitted: 19 Aug 2014 File Category: Beta 3.3.13.17 (19th August, 2014) (Beta) AutoIt: - Changed: Default text file encoding changed to UTF8 without BOM. - Changed: FileOpen() has new modes for forcing ANSI, UTF16-BE/LE without BOM. - Fixed #2834: FileOpen() and DirCreate() problem with relative paths when creating directories. UDFs: - Changed: _SQLite 3.8.5.0 -> 3.8.6.0. - Added #2836: _WinAPI_SfcIsKeyProtected() doc example. - Fixed: Limit bug in _ArraySwap(). Others: - Changed: Improved highlighting AutoIt code inside the HTML files. Click here to download this file
    1 point
  5. Hi, Here is modified UDF and example which will cater for embedded child GUIs: <snip> Comments welcomed. M23
    1 point
  6. mesale0077, a 'feature request' might work better, than adding your own (flawed) code. And why post the entire UDF? Please delete it from your post as it will not reflect the current and new versions of the UDF. Anyway, even though you didn't really ask, I went ahead and added a 'Remove' function to the UDF, which actually works correctly for both HKCU and HKLM branches.. 2014-08-19 Update 2: Added: _IE_EmbeddedRemoveBrowserEmulation() per (pseudo-request) by mesale0077 Changed: _IE_EmbeddedGetBrowserEmulation() parameters are rearranged to match other function signatures Update in 1st post
    1 point
  7. Danyfirex

    Maths

    my way. $W = 1046 $H = 562 ConsoleWrite("Width = " & $W & @CRLF) ConsoleWrite("Height = " & $H & @CRLF) _NewSize($W, $H) ConsoleWrite("New Width = " & $W & @CRLF) ConsoleWrite("New Height = " & $H & @CRLF) Func _NewSize(ByRef $X, ByRef $Y) $newwidth = 640 $Y= int($Y-( $Y*((100-($newwidth/$X)*100))/100)) $X=$newwidth EndFunc Saludos
    1 point
  8. Melba23

    Maths

    JohnOne, My suggestion: $W = 1046 $H = 562 ConsoleWrite("Width = " & $W & @CRLF) ConsoleWrite("Height = " & $H & @CRLF) ConsoleWrite("Ratio: " & Round($W/$H, 2) & @CRLF) $newwidth = 640 _NewSize($W, $H, $newwidth) ConsoleWrite("New Width = " & $W & @CRLF) ConsoleWrite("New Height = " & $H & @CRLF) ConsoleWrite("Ratio: " & Round($W/$H, 2) & @CRLF) Func _NewSize(ByRef $Width, ByRef $Height, $NewWidth) $Height = Int($NewWidth / $Width * $Height) $Width = $NewWidth EndFunc M23
    1 point
  9. This is possible without automating any user interface. If this is only your second project, then you won't have been exposed yet to the monstrosity that is the Windows API (shortened to WinAPI). The WinAPI dlls give you control over nearly everything on the system, but with great power comes great big confusing documentation pages, on a site called MSDN. With great power also comes great ability to get your computer completely FUBAR. So with that warning in place, here is the code to rotate the screen directly with the winapi. Hopefully this shows you just how powerful programming can be, and why it is a great skill to learn #include <APIGdiConstants.au3> #include <WinAPIGdi.au3> Local $i = 0, $aData $aData = _WinAPI_EnumDisplaySettings('', $ENUM_CURRENT_SETTINGS) ConsoleWrite('Current settings: ' & $aData[0] & ' x ' & $aData[1] & ' x ' & $aData[2] & ' bit, ' & $aData[3] & ' hz' & @CRLF) ; Store the current settings $tDM = _WinAPI_EnumDisplaySettingsEx("", $ENUM_CURRENT_SETTINGS) ; Get the settings to change $tDM2 = _WinAPI_EnumDisplaySettingsEx("", $ENUM_CURRENT_SETTINGS) ; Flip orientation, but also switch width/height. $tDM2.Fields = BitOR($tDM2.Fields, $DM_DISPLAYORIENTATION) $tDM2.DisplayOrientation = $DMDO_90 $v = $tDM2.PelsWidth $tDM2.PelsWidth = $tDM2.PelsHeight $tDM2.PelsHeight = $v ; Change the display settings $ret = _WinAPI_ChangeDisplaySettings($tDM2, 0) ; Wait for the user to click ok, will also timeout after 10 seconds just in case I've messed the display up. MsgBox(0, $ret, "H" & @LF & "e" & @LF & "l" & @LF & "l" & @LF & "o", 10) _WinAPI_ChangeDisplaySettings($tDM, 0) MsgBox(0, @error, "Back to normal") Func _WinAPI_ChangeDisplaySettings($tDevMode, $dwFlags) Local $aRet = DllCall("user32.dll", "LONG", "ChangeDisplaySettingsW", "ptr", DllStructGetPtr($tDevMode), "DWORD", $dwFlags) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_WinAPI_ChangeDisplaySettings ; #FUNCTION# ==================================================================================================================== ; Author.........: Yashied ; Modified.......: jpm, Mat ; =============================================================================================================================== Func _WinAPI_EnumDisplaySettingsEx($sDevice, $iMode) Local $sTypeOfDevice = 'wstr' If Not StringStripWS($sDevice, $STR_STRIPLEADING + $STR_STRIPTRAILING) Then $sTypeOfDevice = 'ptr' $sDevice = 0 EndIf Local $tDevMode = DllStructCreate($tagDEVMODE_DISPLAY) DllStructSetData($tDevMode, 'Size', DllStructGetSize($tDevMode)) DllStructSetData($tDevMode, 'DriverExtra', 0) Local $aRet = DllCall('user32.dll', 'bool', 'EnumDisplaySettingsW', $sTypeOfDevice, $sDevice, 'dword', $iMode, _ 'struct*', $tDevMode) If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, 0) Return $tDevMode EndFunc ;==>_WinAPI_EnumDisplaySettingsEx
    1 point
  10. #include <Date.au3> $hTimer = TimerInit() $rtime = 2 * 86400000 ;2 days in ms While 1 sleep(1000) Local $fDiff = TimerDiff($hTimer) Local $ctime = $rtime - $fDiff if $fDiff > $rtime Then ;GetnPost() ToolTip("TIMESUP!!!!",0,0) Sleep(5000) Local $hTimer = TimerInit() Else ToolTip("TIMELEFT: " & _Convert($ctime), 0, 0) EndIf WEnd Func _Convert($ms) Local $day, $hour, $min, $sec _TicksToTime($ms, $hour, $min, $sec) If $hour > 24 Then $day = $hour/24 $hour = Mod($hour, 24) EndIf Return StringFormat("%02i/%02i/%02i/%02i", $day, $hour, $min, $sec) EndFunc
    1 point
  11. Nice for the ones who can't use Shift Alt Arrow
    1 point
  12. To read one or more cells from Excel use function _Excel_RangeRead from the Excel UDF. In the help file you'll find example scripts.
    1 point
  13. Since everyone likes to look at pictures, I added one Also, some changes: 2014-08-19: Changed: UDF Renamed to IE_EmbeddedVersioning Changed: Function _IE_EmbeddedSetBrowserEmulation() can be called with no parameters - in this case, it sets the Browser Emulation Flags to reflect the current installed version of IE Updated: HTML5 Canvas demo
    1 point
  14. Look at the _Excel_XX functions in the help file to help you get the information from an excel spreadsheet. I'm not sure what you're planning to do with this data afterwards, but I'm sure that notepad isn't necessary to do it. Maybe explain better what it is you're attempting to do and we can help you with it.
    1 point
  15. The only way I know is using pics for the radiobuttons. #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _Unradiobmp("UnRadio.bmp", @ScriptDir, 0) _Radiobmp("Radio.bmp", @ScriptDir, 0) _Main() Func _Main() Local $hItem, $hImage, $hTreeView Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS) GUICreate("TreeView Create Solid BitMap", 400, 300) $hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUISetState() $hImage = _GUIImageList_Create() _GUIImageList_AddBitmap($hImage, "Radio.bmp") _GUIImageList_AddBitmap($hImage, "UnRadio.bmp") _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImage) For $x = 0 To 7 $hItem = _GUICtrlTreeView_Add($hTreeView, 0, StringFormat("[%02d] New Item", $x + 1), 1, 0) Next ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func _Radiobmp ( $_Name, $_OutputPath, $_OverWrite=1 ) If Not FileExists ( $_OutputPath ) Then DirCreate ( $_OutputPath ) If StringRight ( $_OutputPath, 1 ) <> "\" Then $_OutputPath = $_OutputPath & "\" Local $_FilePath = $_OutputPath & $_Name If FileExists ( $_FilePath ) Then If $_OverWrite = 1 Then $_Filedelete = Filedelete ( $_FilePath ) If Not $_Filedelete Then MsgBox ( 0, "Error", "Unable to overwrite the file.", 5 ) Return SetError ( 1, 0, 0 ) EndIf Else Return EndIf EndIf Local $_FileBin $_FileBin = "0x424D360300000000000036000000280000001000000010000000010018000000000000030000C30E0000C30E00000000000000000000C8D0D4C8D0D4C8D0D4" $_FileBin &= "C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8" $_FileBin &= "D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" $_FileBin &= "808080C8D0D4C8D0D4FFFFFFFFFFFFFFFFFFFFFFFFC8D0D4C8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFF" $_FileBin &= "FFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFC8D0D4FFFF" $_FileBin &= "FFC8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4808080" $_FileBin &= "404040FFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFF00000000" $_FileBin &= "0000FFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040404040FFFFFFFFFFFFFFFFFFFFFFFF404040404040FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" $_FileBin &= "C8D0D4808080808080404040404040404040404040808080808080C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D480808080808080" $_FileBin &= "8080808080C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" Local $_File = FileOpen ( $_FilePath, 17 ) If $_File = -1 Then MsgBox ( 0, "Error", "Unable to recreate the file.", 5 ) Return SetError ( 1, 1, 0 ) EndIf FileWrite ( $_File, $_FileBin ) FileClose ( $_File ) EndFunc ;==> _Radiobmp ( ) Func _Unradiobmp ( $_Name, $_OutputPath, $_OverWrite=1 ) If Not FileExists ( $_OutputPath ) Then DirCreate ( $_OutputPath ) If StringRight ( $_OutputPath, 1 ) <> "\" Then $_OutputPath = $_OutputPath & "\" Local $_FilePath = $_OutputPath & $_Name If FileExists ( $_FilePath ) Then If $_OverWrite = 1 Then $_Filedelete = Filedelete ( $_FilePath ) If Not $_Filedelete Then MsgBox ( 0, "Error", "Unable to overwrite the file.", 5 ) Return SetError ( 1, 0, 0 ) EndIf Else Return EndIf EndIf Local $_FileBin $_FileBin = "0x424D360300000000000036000000280000001000000010000000010018000000000000030000C30E0000C30E00000000000000000000C8D0D4C8D0D4C8D0D4" $_FileBin &= "C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8" $_FileBin &= "D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4FFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" $_FileBin &= "808080C8D0D4C8D0D4FFFFFFFFFFFFFFFFFFFFFFFFC8D0D4C8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFF" $_FileBin &= "FFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFF" $_FileBin &= "FFC8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4808080" $_FileBin &= "404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFFFFFFFF" $_FileBin &= "FFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8D0D4FFFFFFC8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040404040FFFFFFFFFFFFFFFFFFFFFFFF404040404040FFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" $_FileBin &= "C8D0D4808080808080404040404040404040404040808080808080C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D480808080808080" $_FileBin &= "8080808080C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0" $_FileBin &= "D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4" Local $_File = FileOpen ( $_FilePath, 17 ) If $_File = -1 Then MsgBox ( 0, "Error", "Unable to recreate the file.", 5 ) Return SetError ( 1, 1, 0 ) EndIf FileWrite ( $_File, $_FileBin ) FileClose ( $_File ) EndFunc ;==> _Unradiobmp ( )
    1 point
  16. How would i go about automatically downloading all the images on a certain site? i've started this inetget example of what i want, but its not working... any ideas where i should go from here? how what i'm doing wrong? it works with this site (only one i've tested) "http://www.autoitscript.com/" whats not working:"http://www.autoitscript.com/forum/" why? :S what can i do? #include <INet.au3> #include <String.au3> Do $choice = MsgBox (4,'welcome','Would you like to download?') If $choice = 6 Then $Website = InputBox ('Website','Pick A Website To Scavenge The Downloadable Content.') If Not @error Then ;~ ConsoleWrite (GetFileName ($Website) & @CRLF) ProgressOn ('downloading','starting...') $Source = _INetGetSource($Website) ;images $array = _StringBetween ($Source,' src', '>') If IsArray ($array) Then ConsoleWrite ($Website & ' has images:' & UBound ($array) & @CRLF) For $n = 0 To UBound ($array)-1 $patharray = _StringBetween ($array[$n],'="','" ') If IsArray ($patharray) Then $percent = Round (100*($n/UBound ($array))) ProgressSet ($percent,$percent,'Downloading Content...') GetFile ($Website,$patharray[0]) EndIf Next EndIf ProgressOff () EndIf EndIf Until $choice = 7 Func GetSiteName ($Website) Local $array = StringSplit ($Website,'.') Return $array[2] EndFunc Func GetFileName ($FilePath) Local $tpath = $FilePath Do If StringInStr ($tpath,'\') Or StringInStr ($tpath,'/') Then $tpath = StringTrimLeft ($tpath,1) Else Return $tpath EndIf Until False EndFunc Func GetFile ($Website,$FilePath) Local $FileName = GetFileName ($FilePath) Local $SiteName = GetSiteName ($Website) Local $Dir = @DesktopDir & '\' & $SiteName & '\' Local $FullPath If StringLeft ($FilePath,1) == '/' Then Local $FullPath = $Website & $FilePath Else Local $FullPath = $Website & '/' & $FilePath EndIf If Not FileExists ($Dir) Then DirCreate ($Dir) EndIf Local $hDownload = InetGet($FullPath, $Dir & $FileName,16 + 2 + 1) InetClose($hDownload) EndFunc
    1 point
×
×
  • Create New...