Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/01/2021 in all areas

  1. chelo32

    Problems with run

    Thank, I was able to get ffmpeg running, it's simple but it gave me an idea of where my error was. Really thank you I was going crazy with so many quotes. Local $sDir = @ScriptDir&"\Mp4.mp4" Local $sffmpeg = "H:\bin\ffmpeg.exe" Local $simgjpg = @ScriptDir&"\img.jpg" Local $mp3 = @ScriptDir&"\KISSING.m4a" Run($sffmpeg & ' -loop 1 -i "' & $simgjpg & '" -i "' & $mp3 & '" -c:a aac -ab 112k -c:v libx264 -shortest -strict -2 "' & $sDir, @ScriptDir, @SW_HIDE) Thank you all for the help
    1 point
  2. Alternative way #include <WinAPIDiag.au3> #include <Inet.au3> #include <array.au3> #include <MsgBoxConstants.au3> $myHWID = (_WinAPI_UniqueHardwareID()) ;~ ConsoleWrite($myHWID) $source = _INetGetSource("http://webfortesting3265.cloudaccess.host/database.txt") Check_Active_License() Func Check_Active_License() If StringRegExp($source, '(?im)^\Q' & $myHWID & '\E') Then ConsoleWrite('Found') Else ;MsgBox(0,"Your HWID: " & $myHWID, 'Any coincidence with ' & $license[$i] ) EndIf EndFunc ;==>Check_Active_License
    1 point
  3. A year ago, I described exactly the same issue in this link, where my voluntary inexistant destination folder (named "Administrateur2") corresponds to the folder named "folder" in your example. In your case, all your source files named file.* will be copied under a single file name (the file name will be... "folder") and each source file copied will constantly overwrite the precedent copied file named "folder", all this without any error returned by the FileCopy function (this explanation corresponds to the presence of a 3rd parameter which allows you to overwrite existing files, as in the example below) To avoid this issue, I think it's better to use the following syntax, even if the help file (topic FileCopy) doesn't stipulate that you are allowed to indicate file names in the destination parameter : #include <FileConstants.au3> $iStatus = FileCopy("C:\SomeDir\file.*", @MyDocumentsDir & "\folder\file.*", $FC_OVERWRITE) If $iStatus = 0 Then ; FileCopy went wrong (for example \folder doesn't exist) ; your error message here EndIf
    1 point
  4. So i found out that the path without the \ and the path doesn't exist he think that it's file and creates file with the last folder name so it's better to add it anyway
    1 point
  5. Nine

    First Scripts

    Be_Kind()
    1 point
  6. Yes.. I answered that, maybe it was not obvious. FileCopy(@ScriptDir & "\file.*", @MyDocumentsDir & "\folder\",8) According to JockoDundee you don't need "\", so: FileCopy(@ScriptDir & "\file.*", @MyDocumentsDir & "\folder",8)
    1 point
  7. No need for the trailing \ in the destination. Where the script runs from shouldn’t matter as the paths are absolute.
    1 point
  8. Jos

    Logic help

    Baby steps..... baby steps!
    1 point
  9. mikell

    Logic help

    I can't wait to see what this function Func _ReadString($TexteStringToCheck = "", $String1 = Null, $String2 = Null, $String3 = Null, $String4 = Null, $String5 = Null, $String6 = Null, $String7 = Null) will look like (and how it will work) using 25,000 parameters
    1 point
  10. BTW to understand how the function works by itself it could also be helpful to translate the not-so-obvious bitwise klingon to usual numeric operations Func _StringRepeat($sString, $iRepeatCount) Local $sResult = "" While $iRepeatCount > 1 ; If BitAND($iRepeatCount, 1) Then $sResult &= $sString If Mod($iRepeatCount, 2) Then $sResult &= $sString $sString &= $sString ; $iRepeatCount = BitShift($iRepeatCount, 1) $iRepeatCount = Int($iRepeatCount/2) WEnd Return $sString & $sResult EndFunc ;==>_StringRepeat
    1 point
  11. The most important is to understand how it works, so you can to build your own next time @pseakins BTW if an array was needed as the output, regex is easier and faster indeed #Include <Array.au3> $txt = "g1f1 h3h2 f1e2 h2h1q a1h1 h8h1 f2f3n h1h4" & @crlf & _ "g1f3 h3h2 f1e2 h2h1n a1h1 h8h1 f4f1 h1h3" & @crlf & _ "f2f8 e7f8 e4f2 h3h2 e3e4 d5e4 f2e4 h2h1q d4g1 h1e4 g1f2 g7g5" $res = StringRegExp($txt, '\b\w{4}', 3) _ArrayDisplay($res)
    1 point
  12. mLipok

    Libre/openoffice Writer

    https://www.libreoffice.org/download/download/ https://download.documentfoundation.org/libreoffice/stable/7.0.4/win/x86_64/LibreOffice_7.0.4_Win_x64_sdk.msi "c:\Program Files\LibreOffice_7.0_SDK\sdk\examples\OLE\vbscript\WriterDemo.vbs" '*********************************************************************** '* '* The Contents of this file are made available subject to the terms of '* the BSD license. '* '* Copyright 2000, 2010 Oracle and/or its affiliates. '* All rights reserved. '* '* Redistribution and use in source and binary forms, with or without '* modification, are permitted provided that the following conditions '* are met: '* 1. Redistributions of source code must retain the above copyright '* notice, this list of conditions and the following disclaimer. '* 2. Redistributions in binary form must reproduce the above copyright '* notice, this list of conditions and the following disclaimer in the '* documentation and/or other materials provided with the distribution. '* 3. Neither the name of Sun Microsystems, Inc. nor the names of its '* contributors may be used to endorse or promote products derived '* from this software without specific prior written permission. '* '* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS '* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT '* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS '* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE '* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, '* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, '* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS '* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND '* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR '* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE '* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. '* '************************************************************************* 'The service manager is always the starting point 'If there is no office running then an office is started up Set objServiceManager= WScript.CreateObject("com.sun.star.ServiceManager") 'Create the CoreReflection service that is later used to create structs Set objCoreReflection= objServiceManager.createInstance("com.sun.star.reflection.CoreReflection") 'Create the Desktop Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop") 'Open a new empty writer document Dim args() Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args) 'Create a text object Set objText= objDocument.getText 'Create a cursor object Set objCursor= objText.createTextCursor 'Inserting some Text objText.insertString objCursor, "The first line in the newly created text document." & vbLf, false 'Inserting a second line objText.insertString objCursor, "Now we're in the second line", false 'Create instance of a text table with 4 columns and 4 rows Set objTable= objDocument.createInstance( "com.sun.star.text.TextTable") objTable.initialize 4, 4 'Insert the table objText.insertTextContent objCursor, objTable, false 'Get first row Set objRows= objTable.getRows Set objRow= objRows.getByIndex( 0) 'Set the table background color objTable.setPropertyValue "BackTransparent", false objTable.setPropertyValue "BackColor", 13421823 'Set a different background color for the first row objRow.setPropertyValue "BackTransparent", false objRow.setPropertyValue "BackColor", 6710932 'Fill the first table row insertIntoCell "A1","FirstColumn", objTable insertIntoCell "B1","SecondColumn", objTable insertIntoCell "C1","ThirdColumn", objTable insertIntoCell "D1","SUM", objTable objTable.getCellByName("A2").setValue 22.5 objTable.getCellByName("B2").setValue 5615.3 objTable.getCellByName("C2").setValue -2315.7 objTable.getCellByName("D2").setFormula"sum <A2:C2>" objTable.getCellByName("A3").setValue 21.5 objTable.getCellByName("B3").setValue 615.3 objTable.getCellByName("C3").setValue -315.7 objTable.getCellByName("D3").setFormula "sum <A3:C3>" objTable.getCellByName("A4").setValue 121.5 objTable.getCellByName("B4").setValue -615.3 objTable.getCellByName("C4").setValue 415.7 objTable.getCellByName("D4").setFormula "sum <A4:C4>" 'Change the CharColor and add a Shadow objCursor.setPropertyValue "CharColor", 255 objCursor.setPropertyValue "CharShadowed", true 'Create a paragraph break 'The second argument is a com::sun::star::text::ControlCharacter::PARAGRAPH_BREAK constant objText.insertControlCharacter objCursor, 0 , false 'Inserting colored Text. objText.insertString objCursor, " This is a colored Text - blue with shadow" & vbLf, false 'Create a paragraph break ( ControlCharacter::PARAGRAPH_BREAK). objText.insertControlCharacter objCursor, 0, false 'Create a TextFrame. Set objTextFrame= objDocument.createInstance("com.sun.star.text.TextFrame") 'Create a Size struct. Set objSize= createStruct("com.sun.star.awt.Size") objSize.Width= 15000 objSize.Height= 400 objTextFrame.setSize( objSize) ' TextContentAnchorType.AS_CHARACTER = 1 objTextFrame.setPropertyValue "AnchorType", 1 'insert the frame objText.insertTextContent objCursor, objTextFrame, false 'Get the text object of the frame Set objFrameText= objTextFrame.getText 'Create a cursor object Set objFrameTextCursor= objFrameText.createTextCursor 'Inserting some Text objFrameText.insertString objFrameTextCursor, "The first line in the newly created text frame.", _ false objFrameText.insertString objFrameTextCursor, _ vbLf & "With this second line the height of the frame raises.", false 'Create a paragraph break 'The second argument is a com::sun::star::text::ControlCharacter::PARAGRAPH_BREAK constant objFrameText.insertControlCharacter objCursor, 0 , false 'Change the CharColor and add a Shadow objCursor.setPropertyValue "CharColor", 65536 objCursor.setPropertyValue "CharShadowed", false 'Insert another string objText.insertString objCursor, " That's all for now !!", false On Error Resume Next If Err Then MsgBox "An error occurred" End If Sub insertIntoCell( strCellName, strText, objTable) Set objCellText= objTable.getCellByName( strCellName) Set objCellCursor= objCellText.createTextCursor objCellCursor.setPropertyValue "CharColor",16777215 objCellText.insertString objCellCursor, strText, false End Sub Function createStruct( strTypeName) Set classSize= objCoreReflection.forName( strTypeName) Dim aStruct classSize.createObject aStruct Set createStruct= aStruct End Function
    1 point
  13. MsgBox (0,"",@MyDocumentsDir)
    1 point
  14. Happy holidays to all p.s. It looks best on a solid, homogeneous background. To move the tree click on the colored balls and drag. To "turn off" the tree click on it (to set the focus) and then press esc Have fun #include <GUIConstants.au3> #include <WinAPISys.au3> HotKeySet("{ESC}", "_TheEnd") Global $AlphaKey = 0x000000, $hLayer[6], $iWidth = 310, $iHeight = 290, $sBall = '♥' Global Const $aColors[6] = [0x00FF00, 0XFF0000, 0X0040FF, 0XFFFF00, 0X00FFFF, 0XFF00FF] ; 0xRRGGBB Global $a[] = ['.', '~', "'", $sBall, "'", '~', '.', '*', ' '], $tree = $a[8] & $a[7] & @CRLF, _ $hTreeGUI, $ndx, $sGotString, $sGetString, $ChristmasBalls, $sRandomBalls, $iNrOfBalls, $vDummy $hTreeGUI = GUICreate('', $iWidth, $iHeight, Default, Default, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetBkColor($AlphaKey, $hTreeGUI) _WinAPI_SetLayeredWindowAttributes($hTreeGUI, $AlphaKey, 0, $LWA_COLORKEY) GUISetState() For $i = 0 To 14 $tree &= StringRight($a[8], 15 - ($i + 1)) For $x = 0 To ($i + 1) * 2 $tree &= $a[Mod($ndx, 7)] $ndx += 1 Next $tree &= @CRLF If $i < 6 Then $hLayer[$i] = GUICtrlCreateLabel("", 0, 0, $iWidth, $iHeight, -1, $GUI_WS_EX_PARENTDRAG) $vDummy = GUICtrlSetFont(-1, 12, 800, 0, "Courier new") + GUICtrlSetColor(-1, $aColors[$i]) + GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) EndIf Next ; RegExp thanks to @seadoggie01 https://www.autoitscript.com/forum/topic/200770-how-to-clean-a-string-by-regexp/?do=findComment&comment=1440488 $ChristmasBalls = StringRegExpReplace($tree, "(*UCP)(?s)[^\Q" & $sBall & @CRLF & "\E]", " ") ; keep only balls StringReplace($ChristmasBalls, $sBall, $sBall) $iNrOfBalls = @extended GUICtrlSetData($hLayer[0], $tree) ; StringRegExpReplace($tree, "(*UCP)(?s)[\Q" & $a[7] & "\E]", " ")) While Sleep(2000) $sRandomBalls = $ChristmasBalls $RemainingBalls = $iNrOfBalls For $i = 1 To Random(5, $RemainingBalls - 5, 1) $sRandomBalls = StringReplace($sRandomBalls, StringInStr($sRandomBalls, $sBall, 0, Random(1, $RemainingBalls, 1)), " ") $RemainingBalls -= 1 Next For $i = 1 To 5 $sGetString = GUICtrlRead($hLayer[$i]) ; StringReplace(GUICtrlRead($hLayer[$i]), $a[7], " ") $sGotString = $sGetString For $ii = 1 To $RemainingBalls If StringMid($sGetString, StringInStr($sRandomBalls, $sBall, 0, $ii), 1) = $sBall Then $sGetString = StringReplace($sGetString, StringInStr($sRandomBalls, $sBall, 0, $ii), " ") EndIf Next If $sGotString <> $sGetString Then GUICtrlSetData($hLayer[$i], $sGetString) Next GUICtrlSetData($hLayer[Random(1, 5, 1)], $sRandomBalls) WEnd Func _TheEnd() If WinActive("[ACTIVE]") = $hTreeGUI Then Exit GUIDelete($hTreeGUI) EndFunc ;==>_TheEnd
    1 point
  15. Jos

    hello every one

    Great , and you feel this last post is less vague? Anyways... start writing that script and come back when you have a specific question with all the required details for us to be able to assist!
    0 points
×
×
  • Create New...