Leaderboard
Popular Content
Showing content with the highest reputation on 07/14/2013 in all areas
-
You can find a lot of libraries (DLLs) to create OpenGL windows and contexts, to load images and data into textures, to load 3D models, and to call functions that are not in opengl32.dll. Are all these external libraries necessary? The zip files below contains UDFs to create contexts, load images and models, and call functions without any external libraries. They also contains a number of examples. Well, it's not quite true that I do not use any DLLs at all. In some examples I'm using The Embedded Flat Assembler (FASM) UDF by Ward (includes fasm.dll) to optimize loops. This is the ExLauncher, that can be used to run the examples: Press Play to run the first example, and Next to run the following examples. In the Samples menu you can select OpenGL 1.1, 2.1, and 3.3 examples. With Samples | Models you can open the 3D model Viewers, and run 3D model examples. With Samples | Templates you can see a number of templates, as you can use as a start for your own examples. The documentation is divided into five chapters: Chapter 1 is mostly about OpenGL 1.x. Topics like calling functions, creating a rendering context, and loading images into textures are also covered.Chapter 2 deals with OpenGL 2.x and the new concepts that appeared in these versions. Most important is the concept of shaders.Chapter 3 is mostly about OpenGL 3.x. There is also a section on OpenGL/GLSL versions and a section on error handling.Chapter 4 is about implementing a model loader for Wavefront (OBJ) 3D models.Chapter 5 is a summary.In bottom of the post you can download zip files. Use ExLauncher.au3 in top folder to run examples. To view Wavefront (OBJ) 3D models see section 4.0. Chapter 1 is mostly about OpenGL 1.x. Topics like calling functions, creating a rendering context, and loading images into textures are also covered. 1.1 Calling functions Functions defined in OpenGL 1.2 and higher and functions defined in extensions are part of the software that belongs to the video card. To access these functions you normally use a function loading library e.g. GLEW. You can also access the functions manually: 1.2 Rendering contexts (Update 2013-09-21) With OpenGL 3.0 and higher there are more ways to create a rendering context. In the OpenGL wiki the terms simple and proper are used to describe two different types of contexts. Update: New MSAA context. 1.3 Textures and images (Update 2013-09-21) A texture is an OpenGL object that contains an image. Without an image loading library or at least an image loading function it can be tricky to load an image into a texture. These functions loads BMP, GIF, ICO, JPG, PNG, RGB, RGBA, TGA, TGA(RLE), TIF and WMF files. Update: Anisotropic filter (bottom of spoiler). 1.4 OpenGL 1.1 examples (Update 2013-08-03) SamplesOpenGL 1.1 contains the OpenGL 1.1 examples. Here is a list: 1.5 Run examples (Update 2013-08-03) You can run examples in the Samples folder by double clicking, or you can run them from Scite. The easiest is to use ExLauncher.au3 in the top folder: 1.6 Threads example Imagine that when you move the mouse across the screen, it'll create a track on the screen that follows your mouse. Then imagine that there isn't just one track, but many tracks that are slightly offset relative to each other. This is threads: Chapter 2 deals with OpenGL 2.x and the new concepts that appeared in these versions. Most important is the concept of shaders. 2.1 New concepts In the last versions of OpenGL 1.x and especially in version 2.0 and 2.1 a new set of concepts showed up. It was concepts such as shaders, attributes, uniforms and vertex buffer objects (VBOs): 2.2 Shaders Shaders were introduced in OpenGL 2.0. A shader is a program running on the GPU. You write a shader in the OpenGL Shading Language (GLSL). It's a C-like language: 2.3 Math functions When you use shaders in OpenGL 2.0 and higher you don't use old functions like glMultMatrix, glRotate, glTranslate, gluLookAt or gluPerspective. You have to use a new set of functions that works with the functionality of the shaders: 2.4 OpenGL 2.1 examples (Update 2013-06-16) SamplesOpenGL 2.1 contains the OpenGL 2.1 examples. All these examples are based on shaders and the new concepts in OpenGL 2.1. Here is a list: Chapter 3 is mostly about OpenGL 3.x. There is also a section on OpenGL/GLSL versions and a section on error handling. 3.1 OpenGL versions OpenGL versions and corresponding GLSL version: 3.2 Error handling OpenGL error handling is done with glGetError and glGet-functions. Initialize error handling before a group of commands and check errors after the last command. Here error handling is illustrated with LoadGLSLshader in oglIncludesoglLoadShaders.au3: 3.3 OpenGL 3.3 examples (Update 2013-06-16) SamplesOpenGL 3.3 contains the OpenGL 3.3 examples. Most of these examples are added in an update on 2013-06-16. Chapter 4 is about implementing a model loader for Wavefront (OBJ) 3D models 4.0 View 3D models (New 2014-05-04) Added a few pictures that shows how the model Viewers works. 4.1 3D models (New 2013-08-03) When you need a 3D model in your OpenGL project you probably just want to find the model on the internet and load it into your project with some kind of model loading function. 4.2 Wavefront (OBJ) loader (Update 2013-09-21) A Wavefront 3D model (Wavefront .obj file) consists usually of two files: An OBJ-file (Object files) which contains vertices, texture coordinates, normal vectors and face triangles to describe the geometry of the model. And a MTL-file (Material files) with material definitions to describe the look of the model. Material definitions are parameters for the OpenGL glMaterial command to describe the light reflectivities of the surface of the model, and definitions of texture maps to put on the surface of the model. 4.3 Wavefront (OBJ) viewer (Update 2013-09-21) SamplesModelsModel Viewer contains two viewers for Wavefront (OBJ) 3D models. Model Viewer (OBJ) 1.1.au3 is an OpenGL 1.1 version (2.0 or lower) and Model Viewer (OBJ) 2.1.au3 is a 2.1 version (2.1 or higher). Model Viewer (OBJ).au3 calls the proper script depending on your OpenGL version. The latter can be opened through the Tools menu in ExLauncher.au3. 4.4 Example models (Update 2013-09-21) The Models folder at the top level contains the example models. The SamplesModels folder at the top level contains the viewers and the au3-scripts to run the examples. Example models are split into two groups: Samples and models. Models are further divided into three groups: Small, medium and large models: 4.5 Large models (Update 2013-09-21) The optimizations provided in this update and the 2013-08-24 update has largely eliminated the problems of large models. 4.6 Using the models (Update 2013-09-21) SamplesModelsOpenGL 1.1 and SamplesModelsOpenGL 2.1 contains some small examples which shows how to use the models. 4.7 Software (Update 2013-08-24) Blender is a program to edit 3D models. AssimpView is a model viewer. Both of these programs are able to export a model as a Wavefront (OBJ) triangle mesh. 4.8 Next version (Update 2013-09-21) Some issues should be handled in the next version: 4.9 Summary (Update 2013-09-21) This is a summary of the main features and limitations for the Wavefront (OBJ) 3D model loader: Chapter 5 is a summary 5.1 Sources for the UDFs (New 2013-06-16) The zipfile contains a number of OpenGL UDFs in the oglIncludes folder. This is a description of the sources for these UDFs: 5.2 Updates (New 2014-05-04) The example was released 2013-05-19. This is a summary of the updates. Zip files and downloads Included UDFs FASM.au3 and MemoryDll.au3 by Ward to optimize loops. The UDFs are included in the code zip. Contents of the code zip The zipfiles contains a number of files and folders: ExLauncher.au3 - to start the examples, run this fileImages - images used in the examples (not since 2014-05-04)Models - Wavefront (OBJ) 3D example modelsIncludes - utility functions and UDFsoglIncludes - OpenGL related constants and functionsSamples - a collection of examples and templatesTools - a few OpenGL toolszLinks - links to dokuUpdate 2014-05-04 for AutoIt 3.3.10 (code): OpenGL2-3.3.10.7z Downloads at Dropbox The images and 3D models can be downloaded from OpenGL Images and Models at Dropbox. The folder contains three 7z-files: Images.7z, 3.5 MB - the images from the first release 2013-05-19. You need these images, but if you have already installed the images, you do not need to download this package.ModelSamples.7z, 1.66 MB - sample 3D models. If you want to test the Wavefront (OBJ) 3D models and the model loading functions, you need this package.Models.7z, 39.15 MB (250 MB uncompressed) - larger models. The pictures in post 13, 14 and 16 are created from models in this package.If you don't want to test any 3D models there is no need to download and install the last two packages.Click the Download button in upper right corner to download all three packages in one big zip. Testet on XP 32 bit with a NVIDIA video card supporting OpenGL 3.3 and Win 7 64 bit with an Intel card supporting OpenGL 3.1. Use ExLauncher.au3 in top folder to run examples. To view Wavefront (OBJ) 3D models see section 4.0. AutoIt 3.3.8 You can get the 2013-09-21 version for 3.3.8 here. You need the images and possibly the 3D models. x64 issues (no x64 issues in 3.3.10)2 points
-
Hi mates, well this is my first contribution. a simple UDF to use Virustotal API v2.0 The response return is not parsed|splitted. requires >WinHttp UDF Functions List: Update: Now a Only Function using a flags for respective mode. VT() Use respective flag($Type) VT(ByRef $aAPI, $Type, $sResource, $sAPIkey,$Comments="") flags($Type) $fReport = retrieve a scan report on a given file $fScan = submit a file for Scanning $fRescan = Rescan files in VirusTotal's file store $uReport = retrieve a scan report on a given URL $uScan = submit a URL for Scanning $Comment = Make a commnet on files and URLs Example: #include <Crypt.au3> #include "VT.au3" Example() Func Example() _Crypt_Startup() Local $sFilePath = @WindowsDir & "\Explorer.exe" Local $bHash = _Crypt_HashFile($sFilePath, $CALG_MD5) _Crypt_Shutdown() Local $hVirusTotal = VT_Open() Local $APIkey='Your API key' ConsoleWrite(VT($hVirusTotal, $fReport, '20c83c1c5d1289f177bc222d248dab261a62529b19352d7c0f965039168c0654',$APIkey) & @CRLF) ConsoleWrite(VT($hVirusTotal, $fScan, $sFilePath,$APIkey) & @CRLF) ConsoleWrite(VT($hVirusTotal, $fRescan, hex($bHash),$APIkey) & @CRLF) ConsoleWrite(VT($hVirusTotal, $uReport, "http://www.virustotal.com",$APIkey) & @CRLF) ConsoleWrite(VT($hVirusTotal, $uScan, "http://www.google.com",$APIkey) & @CRLF) ConsoleWrite(VT($hVirusTotal, $Comment, hex($bHash) ,$APIkey,"Hello Word | Hola Mundo") & @CRLF) VT_Close($hVirusTotal) ; EndFunc ;==>Example Saludos VT.au31 point
-
Examples of @comspec formatting
dakotadevada reacted to jefhal for a topic
;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")1 point -
Update the Excel UDF that comes with AutoIt
232showtime reacted to water for a topic
This UDF is now part of AutoIt since 3.3.12.0. New versions of Microsoft Office have been released since the last changes were made to the Excel UDF. The new extensions (e.g. xlsx) are not (fully) supported, new functions are missing etc. The rewrite of the Excel UDF delivers changes in the following areas: Works with as many instances of Excel as you like - not just one Works with any Workbook - not just the active one Works with any Worksheet - not just the active one Only does what you tell it to do - no implicit "actions" Only one function to read from a cell or a range Only one function to write a string, an 1D or 2D array to a cell or a range Support for every file format Excel supports Speed enhancements when transferring data from/to an Excel sheet (20 - 100 times faster) 2014-03-22 - Beta 5 Known bugs None The example scripts have been tested with Excel 2010 and AutoIt 3.3.10.2 on Windows 7. You need to run the scripts with the latest AutoIt production version (3.3.10.x)! Please test with Excel 2003 and Excel 2007 and post changes you need/want to see in the next beta version! Excel Rewrite Beta 5.zip has been removed as it is now part of AutoIt since 3.3.12.0. (627 downloads) History.txt1 point -
AZJIO, you might be interested to know I did this today...1 point
-
from this link : You can use following commands in Command Prompt to perform actions using Resource Hacker: -add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName, -extract ExeFileName, ResourceAddress, ResourceType, ResourceName, -delete ExeFileName, ResultingFileName, ResourceType, ResourceName, Where: ExeFileName - Source file name ResultingFileName - Output file name ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk) ResourceType - Resource type (e.g. Bitmap, AVI, etc.) ResourceName - Resource name (e.g. 131, 1020, etc.) Example: ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143, hope it can help you.1 point
-
Check the PixelSearch details in the helpfile, esspecially the part that talks about when the Function fails to find the pixel. The example shows what to do to test for this. Jos1 point
-
1 point
-
There seems to be a bug in _WinAPI_GetSaveFileName(), the result of the Api call to GetSaveFileNameW seems not to be evaluated at all. See attached correction lines #1 & #2, I'll post a bug report on this. #include <WinAPI.au3> $ExportFileTypes = "Amateur Data Interchange Format (*.adi;*.adif)" $Path = "C:\Test\" $sDefFile = "Test.adif" $flags = BitOR(0, $OFN_PATHMUSTEXIST, $OFN_OVERWRITEPROMPT) $aRet = _WinAPI_GetSaveFileName_Ex("Export log entries to :", $ExportFileTypes, $Path, $sDefFile, "adif", 0, $flags) ConsoleWrite(@error & @CRLF) If ($aRet[0] = 0) Then $sError = _WinAPI_CommDlgExtendedError() ConsoleWrite("Cancelled" & @CRLF) Else For $N = 0 To $aRet[0] ConsoleWrite("aRet[" & $N & "] : " & $aRet[$N] & @CRLF) Next EndIf Func _WinAPI_GetSaveFileName_Ex($sTitle = "", $sFilter = "All files (*.*)", $sInitalDir = ".", $sDefaultFile = "", $sDefaultExt = "", $iFilterIndex = 1, $iFlags = 0, $iFlagsEx = 0, $hwndOwner = 0) Local $iPathLen = 4096 ; Max chars in returned string Local $tOFN = DllStructCreate($tagOPENFILENAME) Local $aFiles[1] = [0] Local $iFlag = $iFlags ; Filter string to array conversion Local $asFLines = StringSplit($sFilter, "|") Local $asFilter[$asFLines[0] * 2 + 1] Local $iStart, $iFinal, $stFilter $asFilter[0] = $asFLines[0] * 2 For $i = 1 To $asFLines[0] $iStart = StringInStr($asFLines[$i], "(", 0, 1) $iFinal = StringInStr($asFLines[$i], ")", 0, -1) $asFilter[$i * 2 - 1] = StringStripWS(StringLeft($asFLines[$i], $iStart - 1), 3) $asFilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asFLines[$i], $iStart), StringLen($asFLines[$i]) - $iFinal + 1), 3) $stFilter &= "wchar[" & StringLen($asFilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asFilter[$i * 2]) + 1 & "];" Next Local $tTitle = DllStructCreate("wchar Title[" & StringLen($sTitle) + 1 & "]") Local $tInitialDir = DllStructCreate("wchar InitDir[" & StringLen($sInitalDir) + 1 & "]") Local $tFilter = DllStructCreate($stFilter & "wchar") Local $tPath = DllStructCreate("wchar Path[" & $iPathLen & "]") Local $tExtn = DllStructCreate("wchar Extension[" & StringLen($sDefaultExt) + 1 & "]") For $i = 1 To $asFilter[0] DllStructSetData($tFilter, $i, $asFilter[$i]) Next ; Set Data of API structures DllStructSetData($tTitle, "Title", $sTitle) DllStructSetData($tInitialDir, "InitDir", $sInitalDir) DllStructSetData($tPath, "Path", $sDefaultFile) DllStructSetData($tExtn, "Extension", $sDefaultExt) DllStructSetData($tOFN, "StructSize", DllStructGetSize($tOFN)) DllStructSetData($tOFN, "hwndOwner", $hwndOwner) DllStructSetData($tOFN, "lpstrFilter", DllStructGetPtr($tFilter)) DllStructSetData($tOFN, "nFilterIndex", $iFilterIndex) DllStructSetData($tOFN, "lpstrFile", DllStructGetPtr($tPath)) DllStructSetData($tOFN, "nMaxFile", $iPathLen) DllStructSetData($tOFN, "lpstrInitialDir", DllStructGetPtr($tInitialDir)) DllStructSetData($tOFN, "lpstrTitle", DllStructGetPtr($tTitle)) DllStructSetData($tOFN, "Flags", $iFlag) DllStructSetData($tOFN, "lpstrDefExt", DllStructGetPtr($tExtn)) DllStructSetData($tOFN, "FlagsEx", $iFlagsEx) Local $iRes = DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "struct*", $tOFN) ; Correction #1 - Added "Local $iRes =" If Not $iRes[0] Then Return SetError(1, _WinAPI_CommDlgExtendedError(), $aFiles) ; Correction #2 - Added whole line If @error Then Return SetError(@error, @extended, $aFiles) Return __WinAPI_ParseFileDialogPath(DllStructGetData($tPath, "Path")) EndFunc ;==>_WinAPI_GetSaveFileName_Ex1 point