Leaderboard
Popular Content
Showing content with the highest reputation on 11/08/2015 in all areas
-
Introduction Since the introduction of ObjCreateInterface, AutoIt is able to create native, real objects. However, this is quite difficult for non-experienced users. This UDF here enables a "classic" syntax for declaring classes and instantiating objects from them. Before you ask: No, it is not just another preprocessor that's "faking" OOP syntax - this is the real deal. While it assists users with a more familiar syntax, objects are created at runtime. Care has been put into this UDF and it is in the authors interest to fix all bugs remaining and implement features as long as the result works in the Stable release of AutoIt. Features Define an unlimited number of classes.Create unlimited instances of objects.Create arrays of objects.Mix and match different data types in arrays (one or more elements can be objects).Define custom constructors and destructors.Pass an unlimited number of arguments to the constructor (even to all objects in one array at the same time).Automatic garbage collection.Compatible with Object-enabled AutoIt keywords (With etc.), optional parentheses on parameterless functions.Fully AU3Check enabled.IntelliSense catches class-names for auto-completion.Automatically generates a compilable version of the script.Non-instantated classes get optimzed away.Create C-style macros.Download Read the Tutorials - Download - Download (forum mirror) Please use the github issue tracker to report bugs or request features. Please read the tutorial before asking a question. Thanks!2 points
-
I have manually converted all Skype4COMLib VBS examples (found HERE) to AutoIt. I have also created a UDF library - http://www.autoitscript.com/forum/index.php?showtopic=75056. IMPORTANT: Skype4Com.dll is automatically included together with Skype Extras Manager during Skype installation. If a user has unchecked Extras Manager during installation, Skype4Com library will be unavailable on that machine and these examples will not work. Notes: All examples have had code added, if they did not already have it, to verify that Skype is running and a user is signed in.All examples use a Skype event handler to detect changes once attached to the Skype API.The COM Error handler for each example simply allows the script to continue, because the section that verifies a user is logged in will error on the first object until Skype is running (I'm working on fixing this so an error handler can be used properly).If you find any errors or have any trouble, please feel free to send me a PM or post a reply to this thread, and I will help you as best I can. Thanks and enjoy! Andy Answer.au3 - This script sets up automatic answering of incoming calls. Attach.au3 - This script listens for connections on the Skype API, connects when available, and holds the skypename of the user when a connection is successful. Buttons.au3 - This script sends key press events to the Skype client. Call.au3 - This script places a call through the Skype API, and monitors status while the call is in progress. Chats.au3 - This script queries chats in chat history. Chats2.au3 - An improved chats example to illustrate new chat properties. Client.au3 - This script opens different windows in the Skype client. Command.au3 - This script sends blocking and non-blocking commands to the Skype API. Conference.au3 - This script creates a conference call. Conferences.au3 - This script lists conference calls hosted by a user, and lists participants in conference calls not hosted by a user. FileTransfers.au3 - This script lists file transfers. GroupChat.au3 - This script creates a group chat. Groups.au3 - This script manages various aspects of contact groups. Join.au3 - This script joins callers to form a conference call. MessageStatus.au3 - This script logs chat text messages. MissedMessages.au3 - This script list all missed messages and changes message status to "Read". Plugins.au3 - This script demos how to create plugin menu items and events. Profile.au3 - This script lists the profile properties for the current user. Response.au3 - This script provides a response to a message received in a chat. Search.au3 - This script performs a simple search for a user. Settings.au3 - This script queries the Skype general parameters. Sms.au3 - This script sends a SMS message. Smss.au3 - This script lists all SMS messages. VoicemailServer.au3 - This script listens for new voicemails, sends SMS message and answers incoming calls.1 point
-
Skype UDF v1.2 Introduction :Skype4COM represents the Skype API as objects, with :methodspropertieseventscollectionscachingSkype4COM provides an ActiveX interface to the Skype API. Develop for Skype in a familiar programming environment, such as Visual Studio or Delphi, using preferred scripting languages such as VBScript, PHP, or Javascript. Requirements : Skype 3.0+ must be installedWindows 2000, XP+ Update : Version 1.2 Fixed _Skype_ProfileGetHandle function Version 1.1 Fixed _Skype_ChatGetBookmarked function Added missing _Skype_ChatGetTopic function Version 1.0 Fixed _Skype_ChatGetAll function Version 0.9 Fixed Mute value returned by the _Skype_OnEventMute callback function Version 0.8 Error ObjEvent is set if none already set Version 0.7 Changed _Skype_GetChatActive to _Skype_GetChatAllActive Version 0.6 Added _Skype_GetCache Added _Skype_SetCache Changed Skype_Error function Minor bugs fixed Version 0.5 Fixed _Skype_ChatCreate Version 0.4 Fixed _Skype_ChatGetMessages Fixed "Skype - SciTE.au3" script Version 0.3 Minor changes Updated Skype in AutoIt example Version 0.2 Fixed _Skype_ChatAddMembers Various bugs fixed _Functions list : (346) Example GUI : Notes : Skype's access control must be accepted manually :After running the example script, click on the "Allow access" button of SkypeThis version is NOT complete If you are running on a 64 bits OS, add this line to your script : #AutoIt3Wrapper_UseX64=n Attachments :Pack (UDF + ExampleGUI)Version 1.2 : Skype-UDF_1.0.0.2.zip Examples : (put them into the "Example folder")-Answers to incomming calls even if you are already in a call : Auto Answer.au3-Shows how to use the OnMute event : Mute Event.au3 Happy coding1 point
-
This example is a cacophony a concordant mixture of scripts and ideas that can previously be found on this thread. This exercise allows for processing the file in chunks. And, allows for the search string to be found when laying cross the boundary of two chunks. Plus, it's been a rainy Sunday. #cs ; -------------------------- Script Description ------------------------------------- This example uses a file pointer (using the FileSetPos and FileGetPos functions) to read data in chunks from a file which is directly appended to a temp file. Each block of data is searched, for a specific text. In the case where searched text is across a chunk boundary, a second search is performed on an increase chunk size. The chunk size is increased by the character length of the search text. When the search text position is found, the file pointer on the original "read" file is increased by the number of characters that make up the search text. So on the next FileRead, the search text will not be read because the file pointer will be pointing to the end of the search text. And subsequently, the search text will not be appended to the temp file. When the file pointer reaches the end of the "read" file, the temp file replaces the original file, keeping the original file's name. #ce; ------------------------------------------------------------------------------------- Local $FileName = "1a.txt" ; <-------------------------------------######### Change to your file name. Local $sSearchText = "456" ; <-------------------------------------######### Change to your search text. Local $iChunkSize = 6 ; <-------------------------------------######### Change the chunk size (in text characters) that your file will be divided into. ; On my system using a 27.344 MB text file, with a 1000000 (1 million) $iChunkSize value, the $sSearchText was found and deleted in about 10 secs. If FileExists($FileName) = 0 Then FileWrite($FileName, "1234567890abcdefghijklmnopqrstuvwxyz") ; If $FileName does not exist then create one. Local $iCharLen = StringLen($sSearchText) ; Number of characters to search for. Local $sSearchText_Binary = StringTrimLeft(Binary($sSearchText), 2) ; Number of characters in binary (without "0x" prefix) to search for. If $iChunkSize <= $iCharLen Then ; There would be no progressive searching through the file. MsgBox(0, "Error", "The $iChunkSize must be greater than number of characters in $sSearchText.") Exit EndIf Local $Flag = 1 ; 1 = $sSearchText not found; 0 (False) = $sSearchText found. Local $iFilePos = 0 ; Used to exit loop Local $FileNameSize = FileGetSize($FileName) ; Used to exit loop ; Open files in binary mode Local $hFile = FileOpen($FileName, 16) ; $FO_READ (0) + $FO_BINARY (16) Local $hFile2 = FileOpen("Temp_File_1a.txt", 17) ; $FO_APPEND (1) + $FO_BINARY (16) ; Temp file for writing to. While 1 If $Flag Then ; If $sSearchText not found $iPos = StringInStr(FileRead($hFile, $iChunkSize), $sSearchText_Binary) ; $iChunkSize is in size of text characters = $iChunkSize multiplied by 2 is size of ; binary (byte) characters. $sSearchText converted to binary is actually used to ; searched the binary $hFile file. FileSetPos($hFile, FileGetPos($hFile) - $iChunkSize, 0) ; Reposition $hFile's file pointer to where it was before FileRead($hFile, $iChunkSize). ; ConsoleWrite("$iPos " & $iPos & " " & FileGetPos($hFile) & @LF) If $iPos = 0 Then ; In the case where $sSearchText is across chunk boundaries increase $iChunkSize by $iCharLen. $iPos = StringInStr(FileRead($hFile, $iChunkSize + $iCharLen), $sSearchText_Binary) FileSetPos($hFile, FileGetPos($hFile) - ($iChunkSize + $iCharLen), 0) ; Reposition $hFile's file pointer to where it was before FileRead($hFile, $iChunkSize + $iCharLen) ; ConsoleWrite("$iPos2 " & $iPos & " " & FileGetPos($hFile) & @LF) EndIf If $iPos Then ; If $sSearchText is found $Flag = 0 ; For next command line:- ; FileRead($hFile) and $iPos are in binary. "$iPos(binary length) / 2" = "$iPos (text length)" ; e.g. binary "595A" (4 characters in length) /2 = text "XZ" (2 character in length) ; i.e. 4 / 2 = 2 ; Also, -1 for minus 1 text character to just before position of $sSearchText. ; Write to $hFile2 from start of chunk to just before position of $sSearchText. FileWrite($hFile2, FileRead($hFile, ($iPos / 2) - 1)) ; See above comment lines. FileSetPos($hFile, FileGetPos($hFile) + $iCharLen, 0) ; Reposition $hFile's file pointer to jump to end of $sSearchText text character position. ; $sSearchText will be miss, or not read, when next writing to $hFile2, the temp file. EndIf EndIf FileWrite($hFile2, FileRead($hFile, $iChunkSize)) ; From current $hFile's file pointer, get a binary Chunk Size of data and write to $hFile2 If $iFilePos = FileGetPos($hFile) Then Exit ; Avoids getting stuck in loop when $sSearchText is not found in $hFile file. $iFilePos = FileGetPos($hFile) ; Store $hFile's file pointer position for comparison in the following loop. ; ConsoleWrite(FileGetPos($hFile) & @LF) If $FileNameSize = FileGetPos($hFile) Then ExitLoop ; When End Of $hFile File is reached, exit loop WEnd FileClose($hFile) FileClose($hFile2) FileMove("Temp_File_1a.txt", $FileName, 1) ; $FC_OVERWRITE (1); Will copy contents of temp file to $FileName, and delete temp file. ; ---- Display file and clean up after example if file size is less than 2 kb ---- If $FileNameSize < 2000 Then Sleep(1000) Local $iPID = ShellExecute($FileName) MsgBox(0, "The End", 'Wait, or press "Ok".' & @LF & @LF & 'File will be deleted, and example will end', 7) If ProcessExists($iPID) Then ProcessClose($iPID) FileDelete($FileName) EndIf1 point
-
; copy code to be processed, and then run this script Local $str = ClipGet(); <- binary or hex input $str = StringRegExpReplace($str, '(.{1,100})', ' $s &= "\1"' & @CRLF) $str = 'Func Example()' & @CRLF & ' Local $s = ""' & @CRLF & $str & ' Return $s' & @CRLF & 'EndFunc' & @CRLF ClipPut($str); <- formatted output (paste into your script) Example Output: Func Example() Local $s = "" $s &= "0xC3BC394124742EC3BF2E2EE282AC402EE280B9C39646C692C3BA2E7CC398C3AB322E" $s &= "E280BA2E2E2E2EE280A6C39B742A6A2E6A2E6A2E6A2E2E45C3A050C3BFC397E280A6C3" $s &= "80752EE280B94DC3BC394124742EC3BF2E2EE282AC402EE280B9C39646C692C3BA2E7C" $s &= "C39833C39B6A2E6A2E6A2E2E45C3A050C3BF2EC388E2809A402EC692C3B8C3BF74C2BD" $s &= "E280A6C38074542E4DC3A051C3BF2E2EE2809A402EC692C3842EE280A6C380752E2E55" $s &= "C3A052C3BF2EC384E2809A402E2E45C3A050C3BF2EC380E2809A402EE280B945C3A43D" $s &= "2E2E2E2E772E74CB86C692C3B82E74C6923DC2A02E2E2EC3AB2E3D2E2E2E2E2EE2809E" $s &= "71C3BFC3BFC3BFC2BB2E2E2E2E33C3B6C3A965C3BFC3BFC3BFE280B94DC3BCE280B92E" $s &= "E280B9422EC3BFC3905F5E33C3805BE280B9C3A55DC383C38CC38C55E280B9C3AC6AC3" $s &= "BF68C3B16D402E64C2A12E2E2E2E50C692C3AC5CC2A134C380402E33C385E280B045C3" $s &= "B0535657502E45C3B464C2A32E2E2E2E2E45C39050C3BF2E6CE2809A402E502E4DC38C" $s &= "33C3B651C2BB50E280A6402EE280B075C3BCC3A8272E2E2EC692C3842EC38645C3BC2E" $s &= "E280B945C390C692C380C3B02E502EC692C389C3BFC3B02EC3812E49E280A6C3892E2E" $s &= "E280B92EE280B92E50E280B9422EC3BFC390E280B94DC38C51C3BF2E30E2809A402EE2" $s &= "80A6C3802EE2809EE2809E2E2E2E33C392C38745C3A82E2E2E2EE280B075C3A466E280" $s &= "B055C3942E45C394C38645C3BC2EE280B94DC38C5051C3BF2E5CE2809A402EC692C384" $s &= "2E2E4DC593C3BF2E58E2809A402EE280B075C2BCE280B075C380E280B075C384C2B32E" $s &= "CB865DC3BCC6927DC3A82EE280B94DC394732E2E4DC3942E55C39052C3A8C38E3D2E2E" $s &= "2E4DC2BC516878E280A6402E50C38645C3BC2EC3BF2E50E2809A402ECB865DC3BCE280" $s &= "B945C390C692C380C3B0C692C3842E2E502EC692C389C3BFC3B02EC3812E49E280A6C3" $s &= "892E2EE280B92EE280B92E50E280B9422EC3BFC390E280B94DC380E280B945C2BCE280" $s &= "B93DC2A4E282AC402E2BC388C381C3B92E33C39BE280A6C38974552E2ECB9CE280B92E" $s &= "E280B940C3B4C692C380C3BC2E4DC390C3A8C38B2E2E2EE280B975C39056C3BFC397E2" $s &= "80B94DC2BCE280B92EE284A25650C3BF2E58E282AC402E2E46C3B02E502EC692C389C3" $s &= "BFC3B02EC3812E49E280A6C3892E2EE280B92EE280B92E50E280B9422EC3BFC390E280" $s &= "B94DC380E280B945C2BC2BC38843C381C3B92E3BC399722E33C3B6E280B955C38C52C3" $s &= "BFC397C38645C3BC2EE280B945C2BCE280B92EC3942E402E3BC3867442E280B94DC380" $s &= "E280B9C3B9E280B9C3B03BC381742F2EC2A4242E2E2E2EE280B92EC692C3A82E2E482E" $s &= "C692C38AC3BFC3B02EC3812E4AE280A6C3922E2EE280B92EE280B92E50E280B9422EC3" $s &= "BFC390C692C3862E3BC3B775C39BE280B945C2BC50C3BFC393C692C3842E33C3B62E4D" $s &= "C593E280B075C2BCE280B075C380E280B075C384C38645C3BC2EC3BF2E54E2809A402E" $s &= "C6927DC3A82E72" Return $s EndFunc1 point
-
For $i = 1 To 5 ;try 5 times $buy = PixelSearch(355, 728, 861, 856, 0x1D1D1D) If Not @error Then MouseClick("", $buy[0], $buy[1]) ExitLoop ; Good, you can stop looking EndIf Sleep(1000) ; bad, wait 1 second and try again Next1 point
-
How to break long lines of autoitcode into multiple short lines automatically?
Trong reacted to InunoTaishou for a topic
This is just one example, it may not work 100% for every single file you run it through but it should get you started. Example Binary File.au3 Long String to Split String.au31 point -
Hmmm, You could always add this line to the top of your script which will, At the very least kill any static processes: if ProcessExists("YourCompiledNameHere.exe") > 0 then Do ProcessClose("YourCompiledNameHere.exe") Until ProcessExists("YourCompiledNameHere.exe") = 0 endif Just replace the "YourCompiledNameHere.exe" with the actual name of your compiled script. Note: this method won't work if the script is not compiled, As when running an au3 program, The autoit3Wrapper.exe (or something to that liking) will appear as the process. The issue most likely lies with the SkypeCom.au3 contents, Although I can't really comment as I haven't seen the code. Cheers Javi1 point