Leaderboard
Popular Content
Showing content with the highest reputation on 07/17/2014 in all areas
-
File Name: AutoIt v3.3.13.5 Beta File Submitter: Jon File Submitted: 17 Jul 2014 File Category: Beta 3.3.13.5 (17th July, 2014) (Beta) AutoIt: - Added: (Internal) Built-in functions can now be made that work in a ByRef way. Lots of new possibilities! - Fixed: Regression with using subscript access on a non-array variable hard crashing. - Fixed: Accessing a table within an array, or vice versa caused a hard crash. - Fixed: Static keyword with tables. - Fixed: Assigning objects to table elements. UDFs: - Fixed #2782: Documentation of various constants. Click here to download this file2 points
-
Problem with [Do] loop
232showtime and one other reacted to jdelaney for a topic
PixelSearch will never return 1...it will return 0, if it doesn't find your pixel...stick with my example: Local $aSearch Do $aSearch = PixelSearch(0,0,1023,767,0x0018C6) If @error Then Sleep(100) Until IsArray($aSearch) MouseMove($aSearch[0],$aSearch[1],20) Or, you can do this: Local $aSearch, $something Do $aSearch = PixelSearch(0,0,1023,767,0x0018C6) $something = @error If $something Then Sleep(100) Until Not $something MouseMove($aSearch[0],$aSearch[1],20)2 points -
BASS Function Library This library is a wrapper for the powerful Bass.DLL and add-ons (which increase the functionality of Bass.DLL). Bass.DLL is ideal for use in your applications and scripts if you want an easy way to play a vast range of music and sound files formats while keeping dependency on just Bass.dll and it's add-ons (which in turn maximizes compatibility and minimizes extra requirements for your software to run.), while retaining a small file size. The UDFs included with the release are: Bass The basic Bass library. Required with all (most) add-on libraries. Provides playback of many sound files (and streams). BassASIO (By eukalyptus) BASSASIO is basically a wrapper for ASIO drivers, with the addition of channel joining, format conversion and resampling. BassCD Allows for digital streaming and ripping of audio CDs along with analog playback support. BassFX (By eukalyptus/BrettF) An extension providing several effects, including tempo & pitch control. BassEnc (By eukalyptus) An extension that allows BASS channels to be encoded using any command-line encoder with STDIN support (LAME/OGGENC/etc), or any ACM codec. Also features Shoutcast and Icecast stream sourcing, and PCM/WAV file writing. BassSFX Provides a complete set of functions to include support for winamp, sonique, bassbox, and Windows Media Player visualization plugins. BassTags Provides a simple way to retrieve ID3 tags from stream handles. BassCB/Bass_EXT (ProgAndy) This is for advanced users. BassCB allows the playback of streams in AutoIt. BassVST Allows use of VST effect plugins. Download The download includes all of the wrapper and constants, the original download, examples for all of the previously mentioned add-ons, sample audio files (6 channel audio files also included), sample visualization plugins for BassSFx and more. Current Version: 9 Size: 7360KB AutoIt Version Required: 3.3.2.0 Changelog: /> Fixed _BassRecordGetInputName (updated production versions) +> Added Memory Examples of Bass (Thanks ProgAndy and UEZ) +> Added BassVST (Not 100% complete) +> Added BassFX Examples showing use of most functions: Pitch.au3 Reverse.au3 Tempo.au3 /> Fixed error with calling _BASS_ErrorGetCode in BASSCD.au3 /> Fixed startup functions return the wrong value (Thanks ProgAndy!) +> Added helper functions _BASS_ChannelSetVolume, _BASS_ChannelGetVolume (Thanks ProgAndy) Download Link: https://www.autoitscript.com/forum/files/file/493-basszip/ Previous versions are not supported. Patches: Patch 1 "BASS_ASIO" Fixes issues with BASS ASIO and examples. Patch 2 "BASS_FX/BASS" Fixes issues with BASS FX and BASS.1 point
-
GetCommonStartups v3.07
232showtime reacted to ripdad for a topic
GetCommonStartups v3.00 Initial Release: September 17, 2012 Last Updated: July 29, 2014 Current Version: 3.07 What is it? It had a very humble beginning with some minimal coding to display Run Keys and their values in the registry. Since then, it has grown into a tool that I use to trouble-shoot computers. Credits and Updates: This script must be compiled 64Bit if used on a 64Bit OS. Download Version 3.07 GetCommonStartups_v3.07.zip Please let me know if you have any issues or complaints.1 point -
Mapping controlids to an array.
coffeeturtle reacted to guinness for a topic
#include <Array.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> ; Proof of concept for using the control id as an index item for an array. I created back on 8th April 2013. Example() Func Example() ; Create the GUI. Local $iHeight = 400, $iWidth = 400 Local $hGUI = GUICreate('', $iWidth, $iHeight) GUISetState(@SW_SHOW, $hGUI) ; Declare variables to be used throughout the example. Local Const $BUTTON_ROWS_COLUMNS = 8 Local Enum $eCTRL_HWND, $eCTRL_VALUE, $eCTRL_MAX Local $aMsg[1][$eCTRL_MAX], _ $iButtonHeight = $iHeight / $BUTTON_ROWS_COLUMNS, _ $iButtonWidth = $iWidth / $BUTTON_ROWS_COLUMNS, _ $iControlID = 0 For $i = 0 To $BUTTON_ROWS_COLUMNS - 1 For $j = 0 To $BUTTON_ROWS_COLUMNS - 1 $iControlID = GUICtrlCreateButton($i & ',' & $j, $i * $iButtonWidth, $j * $iButtonHeight, $iButtonWidth, $iButtonHeight, $BS_CENTER) ; Increase the size of the array if the control id is greater than or equal to the total size of the array. If $iControlID >= UBound($aMsg) Then ReDim $aMsg[Ceiling($iControlID * 1.3)][$eCTRL_MAX] EndIf ; Add to the array. $aMsg[$iControlID][$eCTRL_HWND] = GUICtrlGetHandle($iControlID) $aMsg[$iControlID][$eCTRL_VALUE] = 'Sample string for the control id: ' & $iControlID Next Next ; Clear empty items after the last created control id. ReDim $aMsg[$iControlID + 1][$eCTRL_MAX] ; Display the array created. _ArrayDisplay($aMsg) Local $iMsg = 0 While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $aMsg[$eCTRL_HWND][$eCTRL_HWND] To UBound($aMsg) ; If $iMsg is greater than 0 and between the 0th index of $aMsg and the last item then display in the console. If $iMsg > 0 Then ConsoleWrite('Control Hwnd: ' & $aMsg[$iMsg][$eCTRL_HWND] & ', ' & $aMsg[$iMsg][$eCTRL_VALUE] & @CRLF) EndIf EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example1 point -
I guess he means the big in the forum editor, he mentions "Bold".1 point
-
Dlund, Fine - just avoid the "bot" word in future, please. But there might be ways to activate these buttons without such a cumbersome process. What app are you trying to automate? M231 point
-
This _ArrayUniqueEX() function appears to work. #include<Array.au3> #include<File.au3> Local $aFile, $aArray Local $InputFile = @ScriptDir & "\Test-2.txt" Local $OutputFile = @ScriptDir & "\Test-2b.txt" $aFile = FileReadToArray($InputFile) ;_ArrayDisplay($aFile) $aArray = _ArrayUniqueEX($aFile) ;_ArrayDisplay($aArray) _FileWriteFromArray($OutputFile, $aArray, 1) ShellExecute($OutputFile) Func _ArrayUniqueEX(Const ByRef $aArray) Local $sData = ChrW(160), $sSep = ChrW(160) For $i = 0 To UBound($aArray) - 1 If $aArray[$i] = "" Or _ ; Add blank lines. StringInStr($aArray[$i], "%16422%") <> 0 Or _ ; Add lines with "%16422%" present. StringInStr($sData, ChrW(160) & $aArray[$i] & ChrW(160)) = 0 Then ; Add lines that do not already exist in $sData. $sData &= $aArray[$i] & $sSep EndIf Next Return StringSplit(StringTrimRight(StringTrimLeft($sData, 1), 1), $sSep, 0) EndFunc ;==>_ArrayUniqueEX1 point
-
Dlund, The "bot" word raises red flags around here - see the Forum rules to understand why. Can you please explain why you are trying to store coordinates and click types for later use. M231 point
-
Jon, This beta breaks Array declaration by init. This crashes: Local $aTest = [4, 5, 6]1 point
-
@shane0000 - Please note "to be interpreted by the bot" Thread reported1 point
-
CRC32: unsigned long crc32(unsigned char* data, unsigned long len, unsigned long crc32, unsigned long poly) { unsigned long table[256], crc; int i, j; for(i = 0; i < 256; i++) { crc = i; for (j = 8; j > 0; j--) { if (crc & 1) crc = (crc >> 1) ^ poly; else crc >>= 1; } table[i] = crc; } for(i = 0; i < len; i++) { crc32 = (crc32 >> 8) ^ table[(crc32 ^ data[i]) & 0xFF]; } return crc32 ^ 0xFFFFFFFF; } ADLER32: #define MOD_ADLER 65521 int adler32(unsigned char* data, int len, unsigned int sum) { unsigned int tlen, a, b; a = sum & 0xffff; b = sum >> 16; while (len > 0) { tlen = len > 5552 ? 5552 : len; len -= tlen; do { a += *data++; b += a; } while (--tlen); a %= MOD_ADLER; b %= MOD_ADLER; } return (b << 16) | a; } LZMA: http://www.7-zip.org/sdk.html1 point
-
This is how I do it.. ; ColorChooser() By Cor ; ; An alternative version of the system color chooser dialog function. ; This version can store and retrieve the 16 custom colors. Nifty. ; ; Send an array of 17 AutoIt RGB (e.g. 0xF0EBC3) colors, the first $array[0] being the ; color you wish to initially set in the picker, and the other 16, any custom colors ; you want to set. Empty values can be set to 0. ; ; Returns an array of 17 colors, $array[0] being the color "picked", and the other 16, ; any custom colors the user may have chosen. You can, of course, store these and then ; send them back to the color picker the next time it is called. At last! Store them ; in an ini file or wimilar and use them after next launch. ; ; NOTE: This function accepts and returns AutoIt RGB colors. If you need to convert to ; and from other color values, use ConvertColorValue(above) ; func ColorChooser($CustomColors=0, $hWndOwnder=0) if not IsArray($CustomColors) or Ubound($CustomColors) < 17 then $CustomColors = StringSplit("0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", ",", 2) endif local $ret_array[17], $color_picked, $aResult local $custcolors = "int ccolors[16]" local $col_STRUCT = "dword Size;hwnd hWndOwnder;handle hInstance;dword rgbResult;ptr CustColors;dword Flags;lparam lCustData;ptr lpfnHook;ptr lpTemplateName" local $tChoose = DllStructCreate($col_STRUCT) local $tcc = DllStructCreate($custcolors) $CustomColors[0] = '0x' & StringMid($CustomColors[0], 7, 2) & StringMid($CustomColors[0], 5, 2) & StringMid($CustomColors[0], 3, 2) DllStructSetData($tChoose, "Size", DllStructGetSize($tChoose)) DllStructSetData($tChoose, "hWndOwnder", $hWndOwnder) DllStructSetData($tChoose, "rgbResult", $CustomColors[0]) DllStructSetData($tChoose, "CustColors", DllStructGetPtr($tcc)) DllStructSetData($tChoose, "Flags", BitOR($__MISCCONSTANT_CC_ANYCOLOR, $__MISCCONSTANT_CC_FULLOPEN, $__MISCCONSTANT_CC_RGBINIT)) for $i = 1 to 16 ; set the custom colors.. $ccolor = Dec(StringMid($CustomColors[$i], 7, 2) & StringMid($CustomColors[$i], 5, 2) & StringMid($CustomColors[$i], 3, 2)) DllStructSetData($tcc, "ccolors", $ccolor, $i) next $aResult = DllCall("comdlg32.dll", "bool", "ChooseColor", "struct*", $tChoose) if ($aResult[0] == 0) then return SetError(-3, -3, -1) if @error then return SetError(@error, @extended, -1) $color_picked = Hex(String(DllStructGetData($tChoose, "rgbResult")), 6) if $color_picked < 0 then return SetError(-4, -4, -1) $ret_array[0] = '0x' & StringMid($color_picked, 5, 2) & StringMid($color_picked, 3, 2) & StringMid($color_picked, 1, 2) for $i = 1 to 16 ; create custom color array for return $cc = Hex(DllStructGetData($tcc, "ccolors", $i), 6) $ret_array[$i] = '0x' & StringMid($cc, 5, 2) & StringMid($cc, 3, 2) & StringMid($cc, 1, 2) next return $ret_array endfunc #cs ; a full implementation.. ; to store any system picked custom colors.. global $MyColors[17] = [""] ; System Color Picker.. func HotKeySystemPicker() SystemPicker($current_color) endfunc func SystemPicker($color) UnSetHotKeys() LoadCustomColors() $MyColors[0] = '0x' & $color $ret_colors = ColorChooser($MyColors, $MyGUI) if @error then return false switch $ret_colors[0] case -1, -3, -4, "" SetHotKeys() return false case else $MyColors = $ret_colors $new_color = StringTrimLeft($MyColors[0], 2) SaveCustomColors() SetHotKeys() endswitch endfunc func SaveCustomColors() if not IsArray($MyColors) or UBound($MyColors) < 17 then return false local $color_str for $i = 1 to 16 $color_str &= $MyColors[$i] & "," next $color_str = StringTrimRight($color_str, 1) if IniWrite($cpc_ini_path, $cpc_my_name, "custom_colors", $color_str) then return true endfunc func LoadCustomColors() local $color_str = IniRead($cpc_ini_path, $cpc_my_name, "custom_colors", "") $MyColors = StringSplit($color_str, ",") endfunc All the above and more, here: http://corz.org/public/machine/source/windows/AutoIt%20Includes/corz_colors.au3 Note: some of those includes need updating! #ce ;o) Cor1 point
-
For the Functions look into IniWriteSection/IniWrite and IniReadSection,/IniRead you can save your 6 coordinate as $sIniLine = $x1 & ',' & $y1 & ',' & $z1& ',' & $x2 & ',' & $y2 & ',' & $z2 so that when you read this from the INI you can use StringSplit($LineFromIni, ',', $STR_NOCOUNT) and this will split it into a 6 element array ($a2i = [ $x1 , $y1 , $z1 , $x2 , $y2 , $z2 ]) Where $a2i[0] would equal $x11 point
-
#include <GUIConstantsEx.au3> $oForm1 = GUICreate("Form1", 623, 226, 192, 114) $Input1 = GUICtrlCreateInput("X Value", 8, 8, 177, 21) GUICtrlSetData(-1, "New Data") $Input2 = GUICtrlCreateInput("Y Value", 264, 8, 129, 21) $Input3 = GUICtrlCreateInput("Z Value", 496, 8, 121, 21) ;GUICtrlSetState(-1, $GUI_DISABLE) $Button1 = GUICtrlCreateButton("$Button1", 8, 187, 137, 16) $Button2 = GUICtrlCreateButton("$Button2", 152, 187, 145, 16) $Button3 = GUICtrlCreateButton("$Button3", 304, 187, 137, 16) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input1, "Newer Data") Case $Button2 Case $Button3 EndSwitch WEnd Here is a start to the msg box you want and the loop that will wait for user interaction. I hacked it out of a past project so you will have to re-position all of the elements.1 point
-
Nếu bạn đang làm việc trên một kịch bản cho một trò chơi, đó là không được phép ở đây trong diễn đàn này.1 point
-
i have idea but im not a coder, plz show me how
232showtime reacted to mLipok for a topic
What you want to achieve ? Edit: and Welcome to the forum.1 point -
Needed some practice.. Local $sFile = @ScriptDir & "\abc" ; your folder in the script directory If FileExists($sFile) = 1 And FileGetAttrib($sFile) = "D" Then ; this will see if the file is present and if it is a directory DirCopy($sFile, @ScriptDir & "\DFG", 1) ; if it is, the script will change its name to DFG ;----------------------------------------------------------------------------------------------------------------------------------------------------------- If FileExists(@ScriptDir & "\DFG") Then ; you can add this part to delete the original file once the second is succesfully created DirRemove($sFile, 1) EndIf ;----------------------------------------------------------------------------------------------------------------------------------------------------------- Else MsgBox(0, "Fail", "Either File does not exist or is not a Directory") EndIf1 point
-
C++ equal of InetRead()
Unc3nZureD reacted to funkey for a topic
I'm glad I could help you. For all others interested in this I wrote the following function. Have fun! #include <Windows.h> #include <tchar.h> #include <Wininet.h> #pragma comment(lib,"Wininet.lib") BOOL InetRead(const TCHAR* sUrl, char* buffer, DWORD* dwBufLen, TCHAR* sProxy = NULL, TCHAR* sProxyUser = NULL, TCHAR* sProxyPwd = NULL); BOOL InetRead(const TCHAR* sUrl, char* buffer, DWORD* dwBufLen, TCHAR* sProxy, TCHAR* sProxyUser, TCHAR* sProxyPwd) { HINTERNET hOpen = NULL; HINTERNET hFile = NULL; DWORD dwBytesRead = 0, dwAllBytesRead = 0; DWORD dwCode, dwParamLen = 4; TCHAR* agent = _T("AutoC"); hOpen = InternetOpen(agent, INTERNET_OPEN_TYPE_PRECONFIG, sProxy, NULL, 0); if (!hOpen) goto err1; hFile = InternetOpenUrl(hOpen, sUrl, NULL, NULL, INTERNET_FLAG_RELOAD | INTERNET_FLAG_DONT_CACHE, NULL); if (!hFile) goto err2; HttpSendRequest(hFile, NULL, 0, NULL, 0); HttpQueryInfo(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwCode, &dwParamLen, NULL); if (dwCode == HTTP_STATUS_PROXY_AUTH_REQ) { if ((sProxy != NULL) && (sProxyUser != NULL) && (sProxyPwd != NULL)) { InternetSetOption(hFile, INTERNET_OPTION_PROXY_USERNAME, (LPVOID)sProxyUser, lstrlen(sProxyUser)); InternetSetOption(hFile, INTERNET_OPTION_PROXY_PASSWORD, (LPVOID)sProxyPwd, lstrlen(sProxyPwd)); HttpSendRequest(hFile, NULL, 0, NULL, 0); HttpQueryInfo(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwCode, &dwParamLen, NULL); } else goto err3; } do { InternetReadFile(hFile, (LPVOID)(buffer + dwAllBytesRead), *dwBufLen - dwAllBytesRead - 1, &dwBytesRead); dwAllBytesRead += dwBytesRead; } while ((dwBytesRead) && (dwAllBytesRead < *dwBufLen)); buffer[dwAllBytesRead] = 0; // because last call of InternetReadFile may add garbage!! goto OK; err3: InternetCloseHandle(hFile); err2: InternetCloseHandle(hOpen); err1: *dwBufLen = 0; return FALSE; OK: InternetCloseHandle(hFile); InternetCloseHandle(hOpen); *dwBufLen = dwAllBytesRead; return TRUE; } int APIENTRY _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int) { char sBuffer[20000]; DWORD dwBuferLen = sizeof sBuffer; TCHAR *sUrl = _T("http://www.google.com/"); if (!InetRead(sUrl, sBuffer, &dwBuferLen))//, _T("http://proxy.com"), _T("user"), _T("password"))) { MessageBox(NULL, _T("InetRead failed!"), _T("Error"), MB_ICONERROR); return 1; } #ifdef _UNICODE int len = MultiByteToWideChar(CP_ACP, 0, sBuffer, -1, NULL, 0); wchar_t* sNew = (wchar_t*)malloc(len * (sizeof(wchar_t))); MultiByteToWideChar(CP_ACP, 0, sBuffer, -1, sNew, len); sNew[len - 1] = 0; MessageBox(NULL, sNew, sUrl, MB_OK); free(sNew); #else MessageBox(NULL, sBuffer, sUrl, MB_OK); #endif return 0; } Edit: Added proxy authentication1 point -
If I can't test it myself then I can't help you further than I already did.1 point
-
Mouseclick on a color?
232showtime reacted to BrewManNH for a topic
That won't work, $coord is an array, you would need to do it this way: MouseClick("primary", $coord[0], $coord[1], 1, 1)1 point -
@muzle6074 if you want to add something to the array you have to change it's size but it doesn't mean it can't be dynamically done. #include <Array.au3> Dim $yourAr For $i = 0 To 5 $retNew = InputBox("Extend array", "Add something new to this array:") If IsArray($yourAr) = 1 Then $Bound = UBound($yourAr) ReDim $yourAr[$Bound+1] $yourAr[$Bound] = $retNew Else Dim $yourAr[1] $yourAr[0] = $retNew EndIf Next _ArrayDisplay($yourAr) (E)Njoy1 point