Leaderboard
Popular Content
Showing content with the highest reputation on 05/19/2017 in all areas
-
I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads. Three functions are available: string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available: URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md Fork me on Github: https://github.com/jesobreira/HTTP.au3 Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip1 point
-
I started this JSON library back in late 2007, because I needed a way to pass structured data between Javascript HTAs and AutoIt3 scripts. I've recently worked to get it in good enough shape to share with the AutoIt community, and while it still needs a bit more polish, the core functionality should be solid. Three files are included in the attached archive: JSON.au3 – the UDF Library itself. It includes a (very large) comment section at the top, which should provide sufficient documentation on how the various data types are encoded and decoded, as well as the various Javascript-based decoding extensions allowed (single-quoted strings, comments, etc.).JSON_Translate.au3 provides example functions for the powerful "translator" functionality. Translator functions can be used for both encoding and decoding. When encoding, it allows you to recursively convert your data from its normal format into the required data structures used by the JSON UDF library. When decoding, it allows you to convert the data in the opposite direction – from the JSON UDF library's data structures to the data structures your program normally uses. To use this functionality, you'll need to write your own translator functions, but this allows you to meet the custom needs of your own programs without having to hack JSON.au3. The examples provided in this file can probably be improved, but show one way of translating AutoIt-specific data types (such as binary and hwnd) back and forth.testJSON.au3 provides some quick examples of regular and translator-enhanced usage, which also help verify that encoding and decoding are working properly. These tests may not be comprehensive.The area needing the most work is error-handling. JSON data structures can be deeply nested, and it's tricky to make sure errors "bubble up" properly in AutoIt. (Plus, I need a flowchart to keep track of all my setError() numbers!) Thanks to Douglas Crockford of JSON.org, whose 2005 Javascript code for JSON encoding and decoding provided an excellent starting point for this library. Edit: updated to 0.9.1 on 2009-10-19 substantially updated opening commentsencoding: implemented logic to return "warning" @error flags for unsupported variable types & JSON objects with non-unique key stringsother minor fixes & tweaksJSON.7z1 point
-
SFML UDF - Simple and Fast Multimedia Library for AutoIT
coffeeturtle reacted to seangriffin for a topic
Here's the beginnings of SFML (the Simple and Fast Multimedia Library) for AutoIT. This library provides a wealth of features for developing games and multimedia applications. You can read up more about SFML here -> http://www.sfml-dev.org. It uses OpenGL as the renderer for 2D graphics such as sprites, so it's performance is quite good. Currently my interest is in 2D sprite engines, so my focus is on the sprite and window APIs. This is the precursor to another separate UDF I'm working on and will release soon. If there's any interest I'll flesh out more of this API for the community. CSFML is the "C" binding / API for SFML, and it's this API that I'm building this UDF against. REQUIREMENTS: AutoIt3 3.2 or higher LIST OF FUNCTIONS (so far): _CSFML_Startup _CSFML_Shutdown _CSFML_sfClock_create _CSFML_sfClock_getElapsedTime _CSFML_sfClock_restart _CSFML_sfVector2f_Constructor _CSFML_sfVector2f_Update _CSFML_sfVector2f_Move _CSFML_sfColor_Constructor _CSFML_sfColor_fromRGB _CSFML_sfSizeEvent_Constructor _CSFML_sfEvent_Constructor _CSFML_sfVideoMode_Constructor _CSFML_sfRenderWindow_create _CSFML_sfRenderWindow_setVerticalSyncEnabled _CSFML_sfRenderWindow_isOpen _CSFML_sfRenderWindow_pollEvent _CSFML_sfRenderWindow_clear _CSFML_sfRenderWindow_drawText _CSFML_sfRenderWindow_drawSprite _CSFML_sfRenderWindow_display _CSFML_sfRenderWindow_close _CSFML_sfTexture_createFromFile _CSFML_sfSprite_create _CSFML_sfSprite_destroy _CSFML_sfSprite_setTexture _CSFML_sfSprite_setPosition _CSFML_sfSprite_setRotation _CSFML_sfSprite_rotate _CSFML_sfSprite_setOrigin _CSFML_sfFont_createFromFile _CSFML_sfText_create _CSFML_sfText_setString _CSFML_sfText_setFont _CSFML_sfText_setCharacterSize _CSFML_sfText_setFillColor EXAMPLE: Currently I only have one example, which is the "Short example" described in the CSFML API documentation, plus some extra features. Essentially a window (GUI) allowing you to move a sprite around with the keyboard (including rotation). DOWNLOAD: You can download this UDF, including the example and associated files, from the following GitHub page: https://github.com/seanhaydongriffin/CSFML-UDF Cheers, Sean.1 point -
That should work fine. Jos1 point
-
You can use StringRegexReplace like this MsgBox(0,'', StringRegExpReplace('C:\Users\salah\AppData\Local\Temp\a.exe', "^.*\\", ""))1 point
-
Me too. Welome to the club1 point
-
Autoit to fill Google Forms
ShakeelAhmad reacted to MattHiggs for a topic
Hello Sir. The first piece of advice I would give you is to use This tool, available right here in the Autoit downloads page. Use this tool instead. After looking at the form more closely, the other tool won't really help. This tool will allow you to browse web content, view the source code of the web pages you designate, which will provide you the information you need to automate your web form. With the second tool, you will need to run it as administrator and you will need to open the form in a Internet explorer window. Once you have the form open in IE, then you can use the tools drag and drop feature to select individual objects in the IE window and determine the information needed to automate each object. It looks like the checkboxes that are in the form are not actually a part of the form. Only the input boxes are, which kind of threw me for a loop. That doesn't mean it can't be automated, but it won't be as easy as I initially thought.1 point -
Hi You might try this ; position ; not preceded by $% or $?, followed by $% and a non-$ char $a = StringRegExpReplace($a, '(?<!\$[%\?])(?=\$%[^\$])', @CRLF) ; or ; not preceded by $% or $?, followed by $% and a word char $a = StringRegExpReplace($a, '(?<!\$[%\?])(?=\$%\w)', @CRLF) Edit Sorry, I didn't see the edit in your previous post backslash is used to make special characters literal. "$" in regex usually means "end of text", "\$" means the literal $ char1 point
-
"Show For Files" is a simple app resident in the system tray, allows to easily toggle show/hide of files extensions, hidden files, system files (a.k.a "super hidden files"), and files selection checkboxes: Notes: checkmarks are updated at the tray menu items as they change in the registry, even when changed manually or by other means. showing system files implies showing hidden files (but not vice-versa). this is reflected in the checkmarks. this app does NOT apply to 3rd-party files managers (unless they respect Windows settings). all Windows Explorer windows are refreshed when this app changes any settings. click the tray menu header to jump to this page. additional features may be added as i find useful. Script: #region AutoIt3Wrapper directives section #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_Icon=ShowForFiles.ico #AutoIt3Wrapper_UseUpx=N #AutoIt3Wrapper_Res_Comment=https://www.autoitscript.com/forum/topic/174503-tray-menu-to-showhide-files-extensions-hidden-system-files-and-selection-checkboxes/ #AutoIt3Wrapper_Res_Description=Modifies the folder view to show/hide various file options. #AutoIt3Wrapper_Res_Fileversion=0.3.0.0 #AutoIt3Wrapper_Res_ProductVersion=0.3 #AutoIt3Wrapper_Res_LegalCopyright=n/a #AutoIt3Wrapper_Res_Field=ProductName|Show For Files #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/SO /RM #endregion AutoIt3Wrapper directives section #cs - ref: http://www.askvg.com/create-simple-script-to-show-hide-file-extensions-in-windows-xp-vista-and-7/ http://www.askvg.com/create-simple-script-to-show-hide-hidden-files-and-folders-in-windows-xp-vista-and-7/ http://www.askvg.com/create-simple-script-to-show-hide-checkbox-to-select-items-in-windows-xp-vista-and-7/ #ce #NoTrayIcon #include <Constants.au3> Opt('TrayOnEventMode', 1) Opt('TrayMenuMode', 1) ; Default tray menu items (Script Paused/Exit) will not be shown. but AUTO-TOGGLE CHECKMARK is still ON, which is ok. Global $tHeader = TrayCreateItem('Show For Files:') TrayItemSetOnEvent(-1, 'Header') TrayItemSetState(-1, $TRAY_DEFAULT) Global $tExt = TrayCreateItem(' Extensions') TrayItemSetOnEvent(-1, 'ShowExt') Global $tHid = TrayCreateItem(' Hidden Files') TrayItemSetOnEvent(-1, 'ShowHid') Global $tSys = TrayCreateItem(' System Files') TrayItemSetOnEvent(-1, 'ShowSys') Global $tBox = TrayCreateItem(' Checkboxes') TrayItemSetOnEvent(-1, 'ShowBox') TrayCreateItem('') TrayCreateItem('Exit') TrayItemSetOnEvent(-1, '_Exit') TraySetState() TraySetToolTip(Chr(0)) While True UpdateCheckmarks() Sleep(100) WEnd Func UpdateCheckmarks() If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt') = 1 Then TrayItemSetState($tExt, $TRAY_UNCHECKED) Else TrayItemSetState($tExt, $TRAY_CHECKED) EndIf If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden') = 1 Then TrayItemSetState($tHid, $TRAY_CHECKED) Else TrayItemSetState($tHid, $TRAY_UNCHECKED) EndIf If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden') = 1 Then TrayItemSetState($tSys, $TRAY_CHECKED) Else TrayItemSetState($tSys, $TRAY_UNCHECKED) EndIf If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect') = 1 Then TrayItemSetState($tBox, $TRAY_CHECKED) Else TrayItemSetState($tBox, $TRAY_UNCHECKED) EndIf EndFunc ;==>UpdateCheckmarks Func _Update_Explorer() ; ref: https://www.autoitscript.com/forum/topic/95139-update-refresh-windows-explorer/ Local $bOld = Opt("WinSearchChildren", True) Local $a = WinList("[CLASS:SHELLDLL_DefView]") For $i = 0 To UBound($a) - 1 DllCall("user32.dll", "long", "SendMessage", "hwnd", $a[$i][1], "int", 0x111, "int", 28931, "int", 0) Next Opt("WinSearchChildren", $bOld) EndFunc ;==>_Update_Explorer Func Header() ShellExecute('https://www.autoitscript.com/forum/topic/174503-tray-menu-to-showhide-files-extensions-hidden-system-files-and-selection-checkboxes/') TrayItemSetState($tHeader, $TRAY_UNCHECKED) EndFunc ;==>Header Func ShowExt() If BitAND(TrayItemGetState($tExt), $TRAY_UNCHECKED) Then RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt', 'REG_DWORD', 1) Else RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt', 'REG_DWORD', 0) EndIf _Update_Explorer() EndFunc ;==>ShowExt Func ShowHid() If BitAND(TrayItemGetState($tHid), $TRAY_UNCHECKED) Then RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 0) Else RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 1) EndIf _Update_Explorer() EndFunc ;==>ShowHid Func ShowSys() If BitAND(TrayItemGetState($tSys), $TRAY_UNCHECKED) Then RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden', 'REG_DWORD', 0) Else RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden', 'REG_DWORD', 1) RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 1) ; show system files implies show hidden files EndIf _Update_Explorer() EndFunc ;==>ShowSys Func ShowBox() If BitAND(TrayItemGetState($tBox), $TRAY_UNCHECKED) Then RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect', 'REG_DWORD', 0) Else RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect', 'REG_DWORD', 1) EndIf _Update_Explorer() EndFunc ;==>ShowBox Func _Exit() Exit EndFunc ;==>_Exit Download: save the script as "ShowForFiles.au3" and download the attached icon to compile (until i figure out how to upload the 817 KB compiled exe to the forum). ShowForFiles.ico EDIT: minor fix - clicking the header no longer triggers a checkmark on the header.1 point
-
Filling text input fields in firefox
ShakeelAhmad reacted to FireFox for a topic
If I were you I would search on the forum for examples or try the UDF helpfile. Br, FireFox.1 point -
Filling text input fields in firefox
ShakeelAhmad reacted to FireFox for a topic
Hi, There is an UDF for Firefox named FF. Br, FireFox.1 point -
Drag & Drop a GUI element
pixelsearch reacted to Melba23 for a topic
jolumaoj, Welcome to the AutoIt forum. Yes it is quite possible - as you can see here: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ; Mouse coords relative to GUI client area Opt("MouseCoordMode", 2) ; Set target coords Global $iTgt_Left = 10, $iTgt_Right = 210, $iTgt_Top = 10, $iTgt_Bot = 110 ; Create GUI $hGUI = GUICreate("Test", 300, 200) $cTarget = GUICtrlCreateLabel("", $iTgt_Left, $iTgt_Top, $iTgt_Right - $iTgt_Left, $iTgt_Bot - $iTgt_Top, $SS_BLACKFRAME) GUICtrlSetState(-1, $GUI_DISABLE) $cLabel = GUICtrlCreateLabel("Move me", 10, 150, 60, 20) GUICtrlSetBkColor(-1, 0x00FF00) $cButton = GUICtrlCreateButton("Me too", 110, 150, 80, 23) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN ; If the mouse button is pressed - get info about where $cInfo = GUIGetCursorInfo($hGUI) ; Is it over a control $iControl = $cInfo[4] Switch $iControl ; If it is a control we want to move Case $cLabel, $cButton ; Work out offset of mouse on control $aPos = ControlGetPos($hGUI, "", $iControl) $iSubtractX = $cInfo[0] - $aPos[0] $iSubtractY = $cInfo[1] - $aPos[1] ; And then move the control until the mouse button is released Do $cInfo = GUIGetCursorInfo($hGUI) ControlMove($hGUI, "", $iControl, $cInfo[0] - $iSubtractX, $cInfo[1] - $iSubtractY) Until Not $cInfo[2] ; See if the mouse was released over the target $aMPos = MouseGetPos() If $aMPos[0] > $iTgt_Left And $aMPos[0] < $iTgt_Right Then If $aMPos[1] > $iTgt_Top And $aMPos[1] < $iTgt_Bot Then Switch $iControl Case $cLabel $sItem = "label" Case $cButton $sItem = "button" EndSwitch MsgBox(0, "Info", "Over target with " & $sItem) EndIf EndIf EndSwitch EndSwitch WEnd Please ask if you have any questions. M231 point -
GUI Child Window
jvds reacted to the123punch for a topic
Hi all, I have a GUI that has a main window from which a child window is created. For the child window, I want to be able to place always close to its parent window (like for example to its right or to its left), so I need to be able to get the top and left positions of the parent window to give it to the child window when I create it. I also want to have that child window modal when it pops up so that the user has to read it and close it before continuing. Is there a possibilty to do that in AutoIt? Is there any windows GUI styles that I should be using? Thanks for the help. the123punch1 point -
GUI Child Window
jvds reacted to the123punch for a topic
Thank you all! Greatly appreciate your help! Cheers. the123punch1 point -
GUI Child Window
jvds reacted to elpresident3 for a topic
If you want to give your GUI Child the123punch then use this code to keep the child moving with the parent. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hPOS, $hPOS2 $hGUI = GUICreate('Main GUI', 400, 300) $Button = GUICtrlCreateButton('click', 50, 100, 50) $hPOS = WinGetPos($hGUI) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then Exit Select Case $Msg = $Button $hPOS = WinGetPos($hGUI) $hCHILD = GUICreate("Child", 169, 68, $hPOS[0] + $hPOS[2], $hPOS[1], -1, -1, $hGUI) GUISetState() Case $Msg = $GUI_EVENT_PRIMARYUP $hPOS2 = WinGetPos($hGUI) WinMove($hCHILD,"Child",$hPOS2[0] + $hPOS2[2] , $hPOS2[1]) EndSelect WEnd1 point -
here and example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate('Main GUI', 400, 300) $Button = GUICtrlCreateButton('click', 50, 100, 50) $hPOS = WinGetPos($hGUI) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then Exit If $Msg = $Button Then $hCHILD = GUICreate("Child", 169, 68, $hPOS[0] + $hPOS[2], $hPOS[1], -1, -1, $hGUI) GUISetState() EndIf WEnd1 point
-
wingetpos() in order to find the parent and adjust the child accordingly1 point