Jump to content

Autoit Wrappers


Valuater
 Share

Recommended Posts

; check file date to current date
; Author - Jdeb

#include<date.au3>
$n_tFile = "your file name"
$n_Fdate = FileGetTime($n_tFile,1)
$sdate=$n_Fdate[0]  & "/" & $n_Fdate[1] & "/" & $n_Fdate[2] & " "  &  $n_Fdate[3] & ":" & $n_Fdate[4] & ":" &  $n_Fdate[5]
$edate=_NowCalc()
If _DateDiff ('d',$sdate,$eDate) > 5 then
;
EndIf

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 2 weeks later...

Add on another one:

; Run program in CMD.exe window with changed title.
; Author nfwu

Func _RunCMD($title, $prog)
   Run(@ComSpec & " /K title "&$title&"|"&$prog)
EndFunc

#)

Link to comment
Share on other sites

  • 2 weeks later...

; 30 Day Trial
; Author MSLx Fanboy

#include<date.au3>
#include<string.au3>

If RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu") = "" Then
    RegWrite("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu", "REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName))
    SetError(0)
EndIf
$startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", "XPClean Menu"), @ComputerName)

If _DateDiff("D", $startdate, _NowCalc()) > 30 Then
    MsgBox(0, "*XPClean Menu*", "You're registration period has expired.")
    Exit
EndIf

8)

NEWHeader1.png

Link to comment
Share on other sites

; password encrypter
; Author Valuater
  
#Include <String.au3>

If Not FileExists(@SystemDir & "\License.dat") Then
    $password = InputBox("Password *Set-up*", "  Please *Set-up* Your Password:", "", "", 200, 120)
    If @error = 1 Or $password = "" Then Exit
    FileWrite(@SystemDir & "\License.dat", _StringEncrypt(1, @ComputerName & "4", $password))
Else
    $Input = InputBox("Password Protected", "  Please Type in Your Password:", "", "*", 200, 120)
    $Answer = _StringEncrypt(0, FileReadLine(@SystemDir & "\License.dat", 1), $Input ) 
    If $Answer <> @ComputerName & "4" Then Exit
EndIf

*** UPDATED 5/25/2008

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

;UUID Generator 
; Author gafrost

Const $ERROR_SUCCESS = 0
Const $RPC_S_OK = $ERROR_SUCCESS
Const $RPC_S_UUID_LOCAL_ONLY = 1824
Const $RPC_S_UUID_NO_ADDRESS = 1739

;~ typedef struct _GUID {
;~ unsigned long Data1;
;~ unsigned short Data2;
;~ unsigned short Data3;
;~ unsigned char Data4[8];
;~ } GUID, UUID;
;~ Data1
;~ Specifies the first 8 hexadecimal digits of the UUID.
;~ Data2
;~ Specifies the first group of 4 hexadecimal digits of the UUID.
;~ Data3
;~ Specifies the second group of 4 hexadecimal digits of the UUID.
;~ Data4
;~ Array of eight elements. The first two elements contain the third group of 4 hexadecimal digits of the UUID.
;~ The remaining six elements contain the final 12 hexadecimal digits of the UUID.

$_GUID = DllStructCreate("uint;ushort;ushort;ubyte[8]")
If @error Then Exit

;~ RPC_STATUS RPC_ENTRY UuidCreate(
;~ UUID __RPC_FAR* Uuid
;~ );

$ret = DllCall("Rpcrt4.dll", "ptr", "UuidCreate", "ptr", DllStructGetPtr($_GUID))
If Not @error Then
If $ret[0] = $ERROR_SUCCESS Then
  $uuid = Hex(DllStructGetData($_GUID, 1), 8) & "-" & _
    Hex(DllStructGetData($_GUID, 2), 4) & "-" & _
    Hex(DllStructGetData($_GUID, 3), 4) & "-" & _
    Hex(DllStructGetData($_GUID, 4, 1), 2) & Hex(DllStructGetData($_GUID, 4, 2), 2) & "-"
  For $x = 3 To 8
   $uuid = $uuid & Hex(DllStructGetData($_GUID, 4, $x), 2)
  Next
  MsgBox(0,"UUID", $uuid & @LF & @LF & "Note:" & @LF & _
   "In Windows NT 4.0, Windows Me/98, and Windows 95 DCOM release," & @LF & _
   "UuidCreate returns RPC_S_UUID_LOCAL_ONLY when the originating computer" & @LF & _
   "does not have an ethernet/token ring (IEEE 802.x) address." & @LF & _
   "In this case, the generated UUID is a valid identifier, and is" & @LF & _
   "guaranteed to be unique among all UUIDs generated on the computer." & @LF & @LF & _
   "However, the possibility exists that another computer without an" & @LF & _
   "ethernet/token ring address generated the identical UUID." & @LF & @LF & _
   "Therefore you should never use this UUID to identify an object" & @LF & _
   "that is not strictly local to your computer." & @LF & @LF & _
   "Computers with ethernet/token ring addresses generate UUIDs that" & @LF & _
   "are guaranteed to be globally unique.")
EndIf
EndIf
$_GUID = 0

8)

NEWHeader1.png

Link to comment
Share on other sites

; Command Line decompile to desktop
; Author Skruge

If $CMDLine[0] > 0 Then
      If $CMDLine[1] = "/decompile" Then GetSource()
  EndIf
  
; Main Code Here
  
  Func GetSource()
      FileInstall("MyScript.au3", @DesktopDir &  "\")
      Exit
  EndFunc;==>GetSource

*****************************************************************************

; HotKey & Password decompile to desktop
; Author Danny35d

#include <My_UDF.au3>

HotKeySet("^!l", "_login");Ctrl-Alt-l

;Your script....
while 1 
    Sleep(1000)
WEnd

Func _login()
    Dim $sUserNameAnswer, $sUserPasswordAnswer, $scriptname, $sUserName, $sUserPassword
    
    $sUserName = 'username'
    $sUserPassword = 'PasSwOrD' 
    $scriptname = StringMid(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) + 1, StringInStr(@AutoItExe, ".") - StringInStr(@AutoItExe, "\", 0, -1) - 1)
        
    $sUserNameAnswer = InputBox("Login","Enter UserName?",""," ","100","100","-1","-1")
    Select
        Case @Error = 0;OK - The string returned is valid

        Case @Error = 1;The Cancel button was pushed
            Return
        Case @Error = 3;The InputBox failed to open
            Return
    EndSelect
    
    $sUserPasswordAnswer = InputBox("Login","Enter User Password?","","*","100","100","-1","-1")
    Select
    Case @Error = 0;OK - The string returned is valid

    Case @Error = 1;The Cancel button was pushed
        Return
    Case @Error = 3;The InputBox failed to open
        Return
    EndSelect

    If StringLower($sUserNameAnswer) = StringLower($sUserName) And $sUserPasswordAnswer = $sUserPassword Then
        If Not FileExists(@DesktopDir & "\" & $scriptname) Then DirCreate(@DesktopDir & "\" & $scriptname)
        FileInstall("C:\Program Files\AutoIt3\Include\My_UDF.au3", @DesktopDir & "\" & $scriptname & "\My_UDF.au3")
        FileInstall("C:\MyAutoItScripts\Login.au3", @DesktopDir & "\" & $scriptname & "\Login.au3")
        Exit
    Else
        MsgBox(16,"Login Failer","Neither the username or user password is correct." & @CRLF & "          Press Ctrl+Alt+L and try again...")
    EndIf

EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

; Auto-check for user to update
; Author Valuater

Dim $Udif, $QT_web = "www.XPCleanMenu.HostRocket.com"
Call("Set_Updater")

;test
$Uask = MsgBox(68, "UpDate Notification", " Your last UpDate was more than " & $Udif & " days ago  " & @CRLF & @CRLF & "Would you like to check for new updates now?        " & @CRLF & @CRLF)
If $Uask = 6 Then MsgBox(0,"","success... the update was ran ")

Func Set_Updater()
If Not FileExists(@SystemDir & "\UpDate.dat") Then
    FileWrite(@SystemDir & "\UpDate.dat", @YDAY)
Else
    $Uold = FileReadLine(@SystemDir & "\UpDate.dat", 1)
    If $Uold >=320 Then 
        FileDelete(@SystemDir & "\UpDate.dat")
        Return
    EndIf
    $Udif = @YDAY - $Uold
    If $Udif >= 45 Then
        $Uask = MsgBox(68, "UpDate Notification", " Your last UpDate was more than " & $Udif & " days ago  " & @CRLF & @CRLF & "Would you like to check for new updates now?        " & @CRLF & @CRLF)
        If $Uask = 6 Then
            Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $QT_web)
            WinWaitActive("")
        EndIf
        FileDelete(@SystemDir & "\UpDate.dat")
        FileWrite(@SystemDir & "\UpDate.dat", @YDAY)
    EndIf
EndIf
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION
; Deletes the running script
; Author Larry

Func SuiCide()
    $SC_File = @TEMPDIR & "\suicide.bat"
    FileDelete($SC_File)
    $SC_batch = 'loop:' & @CRLF & 'del "' & @SCRIPTFULLPATH & '"'  & @CRLF & _
         'ping -n 1 -w 250 zxywqxz_q' & @CRLF & 'if exist "' & @SCRIPTFULLPATH & _
        '" goto loop' & @CRLF & 'del suicide.bat' & @CRLF

    FileWrite($SC_File,$SC_batch)
    Run($SC_File,@TEMPDIR,@SW_HIDE) 
    Exit
EndFunc

******************************************************

; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION
; Deletes the running script
; Author MHz

Func _SelfDelete($iDelay = 0)
    Local $sCmdFile
    FileDelete(@TempDir & "\scratch.bat")
    $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _
            & ':loop' & @CRLF _
            & 'del "' & @ScriptFullPath & '"' & @CRLF _
            & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
            & 'del ' & @TempDir & '\scratch.bat'
    FileWrite(@TempDir & "\scratch.bat", $sCmdFile)
    Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

;Animate Display *nice* addition
; Author Raindancer

$hwnd = GUICreate("Animate Window", 300, 300)

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000);fade-in
GUISetState()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000);fade-out
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001);slide in from left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050002);slide out to left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002);slide in from right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050001);slide out to right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004);slide-in from top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050008);slide-out to top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008);slide-in from bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004);slide-out to bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005);diag slide-in from Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0005000a);diag slide-out to Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006);diag slide-in from Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050009);diag slide-out to Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009);diag slide-in from Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050006);diag slide-out to Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a);diag slide-in from Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050005);diag slide-out to Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010);explode
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010);implode

#define AW_HOR_POSITIVE         0x00000001
#define AW_HOR_NEGATIVE         0x00000002
#define AW_VER_POSITIVE         0x00000004
#define AW_VER_NEGATIVE         0x00000008
#define AW_CENTER                 0x00000010
#define AW_HIDE                 0x00010000
#define AW_ACTIVATE             0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

8)

NEWHeader1.png

Link to comment
Share on other sites

Heh, well i wouldn't have bothered posting if it did work... my question may have been badly asked... i'll rephrase:

Is there any way someone can alter this function (draw line between two waypoints) in order to make the lines apear inside a Direct3d window, since right now, the line disapears if you atempt this.

Edited by faldo
Link to comment
Share on other sites

Faldo.... Please start your question in the "Support" forum or PM the Author

; Get the execuatble path of a window
; Author gafrost

$path = _WinGetPath()
MsgBox(0,WinGetTitle(""),$path)

Func _WinGetPath($Title="", $strComputer='localhost')
    $win = WinGetTitle($Title)
    $pid = WinGetProcess($win)
   $wbemFlagReturnImmediately = 0x10
   $wbemFlagForwardOnly = 0x20
   $colItems = ""
   $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
   $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE ProcessId = " & $pid, "WQL", _
         $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
   If IsObj($colItems) Then
      For $objItem In $colItems
         If $objItem.ExecutablePath Then Return $objItem.ExecutablePath
      Next
   EndIf
EndFunc

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

; terminate a script right before a user shuts
InterceptShutdownAny way to "Intercept Printing"?


            
        

        

        
            

    
        

        
            ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                        
                            
                            
                                
                                    1 month later...
                                
                            
                        
                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


Valuater
            
            
                Posted 
                
            
        
    
    
        


Valuater
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                MVPs
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 11.1k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        7
                                
                                    
                                
                            
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                    (edited)
                
                
            
        
    

    

    

    
        
        
            ; EXAMPLES OF USING @COMSPEC
; Author jefhal ( the poster above ^^^^ )

;EXAMPLES OF USING @COMSPEC

Reminder from Blindwig: "FYI - You only need to call comspec to run internal comands (DIR, COPY, MD, RD, etc) You don't need it for external commands (ATTRIB, CACLS, XCOPY, NET, etc)"

;~USE SIMPLE DOS COMMAND WITH PARAMETERS
Run(@ComSpec & ' /k ' & 'dir /os')

;~USE SIMPLE COMMAND WITH FILENAME

Run(@ComSpec & ' /k ' & 'attrib "c:\autoexec.bat"')

;~USE ATTRIB

Run(@comspec & ' /k ' & 'attrib' & ' +R "run notepad1.au3"');add delay before checking status
        sleep(1500)
    run(@comspec & ' /k ' & 'attrib "run notepad1.au3"');delay this line to be sure attrib is set first

;~USE CACLS.EXE

Run(@ComSpec & ' /k ' & 'cacls.exe "c:\my music\halloween.mp3"')
    run(@comspec & ' /k ' & 'cacls.exe "run notepad1.au3" /t /e /p jeff-dell\jeff:f')
    run(@comspec & ' /k ' & 'cacls.exe "run notepad1.au3" /t /e /p everyone:f')
        sleep(1500)
    run(@comspec & ' /k ' & 'cacls.exe "run notepad1.au3"')

;~GET CMD.EXE HELP

Run(@ComSpec & " /k help | more")

;ADVANCED CONCEPTS FROM AUTOIT FORUM:

$x = 1
RunWait(@ComSpec & " /c " & 'start explorer ' & '"' & 'http://www.atari.com/exchange/rct3/item?id=' & $x & '"', "", @SW_HIDE)

RunWait(@ComSpec & ' /c ' & 'cd /d ' & $dir[$cliff] & $lang[$bob] & $op[$mike])

RunWait(@ComSpec & " /c " & "net send " & $MessageSentTo & GUIRead($TextMessageInput))

RunWait(@ComSpec & " /c " & "net send * " & GUIRead($TextMessageInput))

RunWait(@ComSpec & " /c ipconfig > " & "c:\ipconfig.txt", "", @SW_HIDE)

Run(@ComSpec & " /c Start " & $SelectedURL, "", @SW_HIDE)

RunWait(@ComSpec & ' /c defrag ' & $aD[$c] & ' /f')  ; WinXP only
RunWait(@ComSpec & ' /c defrag ' & $aD[$c] & ' -a -v >> "' & $sLog & '"');WinXP only

RunWait(@ComSpec & " /k " & "cd /d " & $db & "\" & $lang & " && wget " & $dl & "/" & $lang & "/" & $sql, "")

Run(@ComSpec & ' /c copy "c:\program files\diablo II\d2data.mpq" c:\temp\d2data.mpq')

RunWait(@ComSpec & " /c start " & $file, @ScriptDir, @SW_HIDE)

RunWait(@comspec & " /c net send "& $PC &" "& $Text,"",@sw_hide)

Run(@ComSpec & " /c start clip.txt", @ScriptDir,@sw_hide)

RunWait(@ComSpec & ' /C explorer.exe [url=http://www.users.on.net/johnson/resourcehacker/']http://www.users.on.net/johnson/resourcehacker/'[/url], '', @SW_HIDE)

Run(@comspec & " /c au3record.exe /o>test.au3","",@SW_HIDE)

RunWait(@ComSpec & ' /c "' & @TempDir & '\~execute.bat"', '', @SW_HIDE)

Runwait(@comspec & " /c " & '"' & @ScriptDir & '\devcon.exe" enable =net *pci*',"",@SW_HIDE)

RunWait(@ComSpec & " /c " & $row & ".exe -m LZX:21 -r -p -P " & $c & "\" & " n " & $c & ".cab" & " " & $c & "\*.*", $res)


RunWait(@ComSpec & ' /c c:\psinfo.exe -c "\\' & $host & '" > c:\psinfo.txt', 'c:\', @SW_HIDE)

RunWait(@ComSpec & ' /c c:\psinfo.exe -c "\\' & $host & '" > c:\psinfo.txt', 'c:\', @SW_HIDE)

RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp 192.168.1.200', "", @SW_HIDE)

RunWait(@ComSpec & ' /c debug < autoit3.dbg', @TempDir, @SW_HIDE)

RunWait(@ComSpec & " /c " & 'netstat -n>c:\ip.txt' , "", @SW_HIDE)

RunWait(@Comspec & " /c " & $sCmd & ">" & $sFileList,"",@SW_HIDE)

Run(@ComSpec & ' /c start ' & $TAG & $F1, '', @SW_HIDE)

RunWait(@Comspec & " /c """ & "nslookup "" " & $IP & " > hostname.txt")

RunWait(@comspec & " /c dir *.EXE /s/b>" & $sExeListName,"",@SW_HIDE)

RunWait(@comspec & " /c dir *.EXE /s/b|cb.exe","",@SW_HIDE);Uses(cb.exe) to route output from a commandline app straight to the clipboard .. which can then be interrogated from within AU3 (thereby avoiding the need to bounce the info through a file)

RunWait(@ComSpec & " /c " & 'del /q /s "' & $dir & '"', "", @SW_HIDE)

RunWait(@COMSPEC & $Mount & $parm2, $AlcoholDir, @SW_HIDE)

Run(@ComSpec & " /c echo " & $PASS & "|idea.com " & $MODE & " " & _FileGetShortName($FILENAME), "", @SW_HIDE)

$rc = RunWait(@ComSpec & ' /c Wscript.exe "' & @TempDir & '\NotesMsg.vbs" //T:30 > sent.log 2>&1', @TempDir, @SW_HIDE)

$E = RunWait(@ComSpec & ' /c ""' & @TempDir & '\~blattmp.exe" "' & $TEXT & _
           '" -to ' & $DEST & ' -binary -server ' & $SMTPSERVER & ' -log ' & @TempDir & _
           '\~maillog.txt -timestamp -f ' & $SENDER & $SUBJECT & '-u ' & $AUTHLOGIN & _
           ' -pw ' & $AUTHPASS & '"', @TempDir, @SW_HIDE)

$cppid = Run(@ComSpec & ' /c cp "' & $source & '" "' & $dest & '"', @ScriptDir,@SW_HIDE); uses cp.exe from UnixTools

$kk32 = runwait(@comspec & " /c dir /a /s /b %systemdrive%\kk32.dll",@SystemDir, @SW_HIDE)
$surf = runwait(@comspec & " /c dir /a /s /b %systemdrive%\surf.dat",@SystemDir, @SW_HIDE)

$ERRORCODE = RunWait(@ComSpec & " /c ping -n 1 -l 5 " & $IP & $NEXTIP, "", @SW_HIDE)

$ERRORCODE = RunWait(@ComSpec & " /c ping -n 1 -l 5 " & $IP & $NEXTIP, "", @SW_HIDE)

$val = RunWait(@ComSpec & ' /c xcopy "'& $source & "\" & $find[$i] & '" "' & $dest & '" /i /e /h /Y /D /Z',@TempDir)

MsgBox(0, "testing",@ComSpec & " /c xcopy "& $source & "\" & $find[$i] & " " & $dest & " /i /e /h /Y /D")
Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

; Identify duplicate values in arrays
; Author - gafrost

#include <Array.au3>

Dim $a1[3] = [1, 2, 3], $a2[5] = [5, 6, 7, 8, 9], $a3[2] = [3, 5]
Dim $a_a[4] = [3, $a1, $a2, $a3]
MsgBox(0, "Dupes?", _SearchForDupes($a_a))

Func _SearchForDupes($a_arrays, $i_ReturnType = 0)
    Local $Dupes[1] = [0]
    If $a_arrays[0] < 2 Then Return ''
    For $i = 1 To $a_a[0] - 1
        For $j = $i + 1 To $a_a[0]
            _FindDupe($a_a[$i], $a_a[$j], $Dupes)
        Next
    Next
    If $Dupes[0] = 0 Then Return ''
    _ArraySort($Dupes)
    If Not $i_ReturnType Then
        Local $s_return = ''
        For $x = 1 To $Dupes[0]
            $s_return &= $Dupes[$x] & ','
        Next
        Return StringTrimRight($s_return, 1)
    Else
        Return $Dupes
    EndIf
    
EndFunc   ;==>_SearchForDupes

Func _FindDupe(ByRef $a_array01, ByRef $a_array02, ByRef $Dupes)
    Local $found = False
    For $i = 0 To UBound($a_array01) - 1
        For $j = 0 To UBound($a_array02) - 1
            If $a_array01[$i] = $a_array02[$j] Then
                $found = False
                For $x = 1 To $Dupes[0]
                    If $Dupes[$x] = $a_array01[$i] Then
                        $found = True
                        ExitLoop
                    EndIf
                Next
                If Not $found Then
                    $Dupes[0] += 1
                    ReDim $Dupes[$Dupes[0] + 1]
                    $Dupes[$Dupes[0]] = $a_array01[$i]
                EndIf
            EndIf
        Next
    Next
EndFunc   ;==>_FindDupe

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 3 weeks later...

; Change Message Box button text
; Author SmOke_N

Local $ChangeText[4] = ['', 'Enable', 'Disable', 'Quit']
$iMsg = _MsgBoxEx(3, 'nothing', 'something', 0, $ChangeText)
MsgBox(64, 'Info', 'The Return Was: ' & $iMsg)

Func _MsgBoxEx($iFlag, $sTitle, $sText, $iTime = 0, $sCIDChange = '')
    Local $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTime & '"))'
    Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_SHOW, 6)
    Do
        Sleep(10)
    Until WinExists($sTitle)
    If IsArray($sCIDChange) Then
        For $iCC = 1 To UBound($sCIDChange) - 1
            ControlSetText($sTitle, '', 'Button' & $iCC, $sCIDChange[$iCC])
        Next
    Else
        ControlSetText($sTitle, '', 'Button1', $sCIDChange)
    EndIf
    While ProcessExists($iPID)
        Local $iStdOut = StdoutRead($iPID)
        If Number($iStdOut) Then Return $iStdOut
        Sleep(10)
    WEnd
    If IsArray($sCIDChange) Then Return SetError(1, 0, 2)
    Return SetError(1, 0, 1)
EndFunc

 oÝ÷ Ù«­¢+Ø((ì¥Ñ¥½¹°½¹Ñɽ±Ì(ì¥Ñ¥¹ÕÑ¡½ÈɽÍÐ()±½°ÀÌØí
¡¹QáÑlÑtôlÌäìÌäì°ÌäìµÀí1ÙÌäì°ÌäìµÀí¥Í±Ìäì°ÌäìµÀíEÕ¥ÐÌäít(ÀÌØí¥5Íô}5Í   ½áà ÔÄ°Ìäí5¥ÍÍ¥½¸Ìäì°Ìäí%µÁ½ÍÍ¥±Ìäì°ÄÀ°ÅÕ½ÐíM±ÍÑÉÕÐ%¸ÌM½¹¡Ì¤ÅÕ½Ðì°ÀÌØí
¡¹QáФ)5Í ½à ØаÌäí%¹¼Ìäì°ÌäíQ¡IÑÕɸ]ÌèÌäìµÀìÀÌØí¥5ͤ()Õ¹}5Í  ½áà ÀÌØí¥±°ÀÌØíÍQ¥Ñ±°ÀÌØíÍQáаÀÌØí¥Q¥µ½ÕÐôÀ°ÀÌØíÍQ¥µ½ÕÐôÅÕ½ÐìÅÕ½Ðì°ÀÌØíÍ
%
¡¹ôÌäìÌäì¤(%ÀÌØíÍQ¥µ½ÕÐôÅÕ½ÐìÅÕ½ÐìQ¡¸ÀÌØíÍQ¥µ½ÕÐôÅÕ½ÐíQ¥µ½ÕÐ¥¸ÌM½¹¡Ì¤ÅÕ½Ðì(1½°ÀÌØíMÑÑ¥ôÅÕ½ÐíMÑÑ¥ÄÅÕ½Ðì((%    ¥Ñ9 ÀÌØí¥±°Äؤ=È   ¥Ñ9 ÀÌØí¥±°ÌȤ=È   ¥Ñ9 ÀÌØí¥±°Ðà¤=È   ¥Ñ9 ÀÌØí¥±°ØФQ¡¸ÀÌØíMÑÑ¥ôÅÕ½ÐíMÑÑ¥ÈÅÕ½Ðì(1½°ÀÌØí}5Í ½á|(%ÀÌØí¥Q¥µ½ÕÐQ¡¸(ÀÌØí}5Í  ½á|ôÌäìÅÕ½ÐìÌäìµÀìÅÕ½Ðí
½¹Í½±]ɥѡ5Í  ½à ÅÕ½ÐìµÀìÀÌØí¥±µÀìÌäì°ÅÕ½ÐìÅÕ½ÐìÌäìµÀìÀÌØíÍQ¥Ñ±µÀìÌäìÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½ÐìÌäìµÀìÀÌØíÍQáеÀì1µÀì1µÀì1µÀìÌäìÅÕ½ÐìÅÕ½Ðì°ÌäìµÀìÀÌØí¥Q¥µ½ÕеÀìÌäìÅÕ½Ð줤Ìäì(±Í(ÀÌØí}5Í ½á|ôÌäìÅÕ½ÐìÌäìµÀìÅÕ½Ðí
½¹Í½±]ɥѡ5Í  ½à ÅÕ½ÐìµÀìÀÌØí¥±µÀìÌäì°ÅÕ½ÐìÅÕ½ÐìÌäìµÀìÀÌØíÍQ¥Ñ±µÀìÌäìÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½ÐìÌäìµÀìÀÌØíÍQáеÀìÌäìÅÕ½ÐìÅÕ½Ðì°ÌäìµÀìÀÌØí¥Q¥µ½ÕеÀìÌäìÅÕ½Ð줤Ìäì(¹%(1½°ÀÌØí¥A%ôIÕ¸¡Õѽ%ÑáµÀìÌäì½Õѽ%ÐÍáÕÑ1¥¹ÌäìµÀìÀÌØí}5Í  ½á|°ÌäìÌäì°M]}M!=°Ø¤(¼(M±À ÄÀ¤(U¹Ñ¥°]¥¹á¥ÍÑÌ ÀÌØíÍQ¥Ñ±¤(%%ÍÉÉä ÀÌØíÍ
%
¡¹¤Q¡¸(½ÈÀÌØí¥
ôÄQ¼U    ½Õ¹ ÀÌØíÍ
%
¡¹¤´Ä(
½¹Ñɽ±MÑQáÐ ÀÌØíÍQ¥Ñ±°ÌäìÌäì°Ìäí    ÕÑѽ¸ÌäìµÀìÀÌØí¥
°ÀÌØíÍ
%
¡¹lÀÌØí¥

t¤(9áÐ(±Í(
½¹Ñɽ±MÑQáÐ ÀÌØíÍQ¥Ñ±°ÌäìÌäì°Ìäí    ÕÑѽ¸ÄÌäì°ÀÌØíÍ
%
¡¹¤(¹%(%ÀÌØí¥Q¥µ½ÕÐQ¡¸}
½Õ¹Ñ½Ý¸ ÀÌØíÍQ¥Ñ±°ÀÌØíÍQáаÀÌØí¥Q¥µ½ÕаÀÌØíÍQ¥µ½ÕаÀÌØí¥A%°ÀÌØíMÑÑ¥¤(1½°ÀÌØí¥MÑ=ÕÐôMѽÕÑI ÀÌØí¥A%¤ìݥѥ¹¸¸¸(%9ÕµÈ ÀÌØí¥MÑ=ÕФQ¡¸IÑÕɸÀÌØí¥MÑ=ÕÐ(%%ÍÉÉä ÀÌØíÍ
%
¡¹¤Q¡¸IÑÕɸMÑÉÉ½È Ä°À°È¤(IÑÕɸMÑÉÉ½È Ä°À°Ä¤)¹Õ¹ìôôÐí}5Í ½áà()Õ¹}
½Õ¹Ñ½Ý¸ ÀÌØíÍQ¥Ñ±°ÀÌØíÍQáаÀÌØí¥Q¥µ½ÕаÀÌØíÍQ¥µ½ÕаÀÌØí¥A%°ÀÌØíMÑÑ¥¤(1½°ÀÌØí½É¥}ÑáÐôÀÌØíÍQáаÀÌØí¹½Üô´äää°ÀÌØí¹½ÜôM(
½¹Ñɽ±MÑQáÐ ÀÌØíÍQ¥Ñ±°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíMÑÑ¥°ÀÌØí½É¥}ÑáеÀì1µÀì1µÀìMÑÉ¥¹½ÉµÐ ÀÌØíÍQ¥µ½ÕаÀÌØí¥Q¥µ½ÕФ°Ä¤(]¡¥±9½Ð9յȡMѽÕÑI ÀÌØí¥A%°È°QÉÕ¤¤(%ÀÌØí¹½Ü±ÐìÐìMQ¡¸(ÀÌØí¥Q¥µ½ÕдôÄ(ÀÌØí¹½ÜôM(%ÀÌØí¥Q¥µ½ÕÐQ¡¸
½¹Ñɽ±MÑQáÐ ÀÌØíÍQ¥Ñ±°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíMÑÑ¥°ÀÌØí½É¥}ÑáеÀì1µÀì1µÀìMÑÉ¥¹½ÉµÐ ÀÌØíÍQ¥µ½ÕаÀÌØí¥Q¥µ½ÕФ°Ä¤(¹%(M±À ÄÀ¤(]¹)¹Õ¹ìôôÐí}
½Õ¹Ñ½Ý¸((

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...