Leaderboard
Popular Content
Showing content with the highest reputation on 10/31/2018 in all areas
-
INI Editor
seadoggie01 and 2 others reacted to boomingranny for a topic
3 points -
In addition to the 2 reasons mentioned by TheXman, only 1 expression is really safe : $c = StringRegExp($aURLs[$i], '.{0,10}$', 3)[0] because even if the string is empty, you never get an error. If the string is less than 10 chars long, all the chars are returned2 points
-
Welcome to AutoIt 1-2-3
KeiosStarqua reacted to Valuater for a topic
November 26, 2007 Ver 1.4.8 * Over 19 InterActive GUI's * Over 50 Step-by-Step Scripts * Verbal Instructions * Complete with Demonstrations. * and Answers * Exe Format for New People DOWNLOAD AUTOIT 1-2-3 Written completely with AutoIt to Demonstrate some of the Capabilities of AutoIt May not Work with Windows 98 ( tested once = fail) Re-Testing is now possible ( Click "Search Help" then type in "me dummy, you fix" ) Enjoy!!! Valuater 8) When you have completed Autoit 1-2-3, be sure to see XSkin.au3 Due to Jon's request to "trim" this thread.... Only Level III Exams will remain....Thanks1 point -
ImageSearch Usage Explanation
HansHenrik reacted to Centrally for a topic
After having lot of issues myself with getting ImageSearch to work I decided to make topic with explanation how to proper use this script. Here is link of original topic at this topic: Credits to kangkeng for creating such useful piece of code. What is ImageSearch? It's script that find part of screen which you before defined with given image. When should I use ImageSearch? You should use it whenever it's not possible or unlikely that pixelsearch will give what you need. So how can I use ImageSearch and enjoy it's awesome benefits? First of all to avoid mostly caused problems I recompiled DLLs for both architectures which you can download at end of this post. When you pick your package you should place both ImageSearch.au3 and ImageSearch.dll inside script folder. Usage Example: First of all take picture of what you want to search for (print screen + paint + corp + save as bmp). Place that picture in script directory (I named my picture checkImage (checkImage.bmp is full name with extension). You must include ImageSearch.au3 in your script. ImageSearch.au3 consist of 2 Functions you can use: _ImageSearch and _ImageSearchArea Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify a desktop region to search Values to put in for _ImageSearch function (entire screen search) ($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance, $HBMP=0) Values to put in for _ImageSearchArea function (you declare part of screen to be searched) ($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance,$HBMP=0) Description of parameters from ImageSearch.au3 itself: ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 Example of my script using _ImageSearch ( entire screen search) #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd Example of my script using _ImageSearchArea #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd I would like to apologize if by writing this I offended any of member that thinks this script is too simple to even have it explained, it's just as me being new to autoIt it took me so much time getting around errors and making this script to work. Thanks for reading, if you bump on any problems using it post it here, I will try to help you fixing it and update topic for further reference. Download links: 32bit: ImageSearch 32bit.rar 64bit: ImageSearch 64 bit.rar1 point -
109,247 downloads
A Tutorial for new people * Over 19 InterActive GUI's * Over 50 Step-by-Step Scripts * Verbal Instructions * Complete with Demonstrations. * and Answers * Exe Format for New People Written completely with AutoIt to Demonstrate some of the Capabilities of AutoIt May not Work with Windows 98 ( tested once = fail) Re-Testing is now possible ( Click "Search Help" then type in "me dummy, you fix" ) Enjoy!!! Valuater 8)1 point -
Look at using Control functions, these functions are more robust than MouseClick etc... and also look at ClipGet and ClipPut functions for using clipboard (Copy & Paste).1 point
-
image search in minimized or hidden window - (Locked)
ibrahem reacted to JLogan3o13 for a topic
Maybe (find this answer a little lacking? Maybe your question was too! Please see this post on how to ask an intelligent question on the forum)1 point -
Disable mouse and keyboard not working for Windows 10
stayready40 reacted to caramen for a topic
What do you tryed to solve that issue mate ? I dont give you the answer when i know it to learn you how to script with autoIT1 point -
How to automate button click in a GUI?
Earthshine reacted to junkew for a topic
Good to see positive results on qt widgets with iuia. Probably build with latest versions of qt with accessiability turned on. @Earthshine nice example1 point -
I know where you copied it from as you can see in my first reply. So what exactly have you tried and what is not working?1 point
-
[SOLVED] Radio Button long text
WilliamasKumeliukas reacted to Melba23 for a topic
WilliamasKumeliukas, Glad I could help. I reworked the script a bit to maker it a bit cleaner - here it is if you are interested: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> #include "StringSize.au3" Opt("GUIResizeMode", $GUI_DOCKAUTO) Global $sStart_Text = "Welcome, I am glad you're willing to help me so I hope" & @CRLF & "everytime this GUI is resized while in qloop function, the script is crashing with following error: " & @CRLF & @CRLF & _ '"C:\Users\wk\Desktop\williamas kumeliukas\test quiz example.au3" (213) : ==> Subscript used on non-accessible variable.:' & @CRLF & @CRLF & _ "If $aRect[3] <= $aPos[3] Then" & @CRLF & @CRLF & _ "If $aRect^ ERROR" Global $iGUIWidth = Int(@DesktopWidth / 1.20), $iGuiHeight = Int(@DesktopHeight / 1.30) Global $iGuiXPos = (@DesktopWidth / 2) - $iGUIWidth / 2, $iGuiYpos = (@DesktopHeight / 2) - $iGuiHeight / 2 Global $iGUI_InitWidth = 800, $iGUI_InitHeight = 600 Global $sFileName = @ScriptDir & "\1.txt" Global $iIndex = 0, $aDisplayText, $hGUI Global $aDisplay_CIDs[5] Global $cStart, $cValid Main() Func Main() $hGUI = GUICreate("Example", $iGUI_InitWidth, $iGUI_InitHeight, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) ; Store display control CIDs in an array $aDisplay_CIDs[0] = GUICtrlCreateLabel($sStart_Text, 110, 10, 560, 180, BitOR($WS_BORDER, $SS_CENTER)) $aDisplay_CIDs[1] = GUICtrlCreateRadio("A)", 20, 200, 320, 150, BitOR($BS_MULTILINE, $BS_TOP, $WS_EX_TOPMOST)) $aDisplay_CIDs[2] = GUICtrlCreateRadio("B)", 20, 360, 320, 150, BitOR($BS_MULTILINE, $BS_TOP, $WS_EX_TOPMOST)) $aDisplay_CIDs[3] = GUICtrlCreateRadio("C)", 460, 200, 330, 150, BitOR($BS_MULTILINE, $BS_TOP, $WS_EX_TOPMOST)) $aDisplay_CIDs[4] = GUICtrlCreateRadio("D)", 460, 360, 330, 150, BitOR($BS_MULTILINE, $BS_TOP, $WS_EX_TOPMOST)) $cStart = GUICtrlCreateButton("Start", 340, 450, 120, 30, $WS_EX_TOPMOST) $cValid = GUICtrlCreateButton("Confirm", 340, 470, 120, 30, $WS_EX_TOPMOST) GUICtrlSetState($cValid, $GUI_HIDE) GUISetState(@SW_SHOW) If $iGuiHeight < $iGUI_InitHeight Then Global $iCalc = Int($iGUI_InitHeight - $iGuiHeight) $iGuiHeight = $iGUI_InitHeight WinMove($hGUI, "", $iGuiXPos, $iGuiYpos - $iCalc - 5, $iGuiWidth, $iGuiHeight) Else WinMove($hGUI, "", $iGuiXPos, $iGuiYpos, $iGuiWidth, $iGuiHeight) EndIf $aPos = ControlGetPos($hGUI, "", $aDisplay_CIDs[0]) $sText = $sStart_Text $sFormattedText = _GetFontSize($sText, $aPos) GUICtrlSetFont($aDisplay_CIDs[0], @extended) GUICtrlSetData($aDisplay_CIDs[0], $sFormattedText) adjustfont($iIndex) GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") ; Limit GUI size to 800x600 <<<<<<<<<< While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE, $GUI_EVENT_RESIZED adjustfont($iIndex) Case $cStart $aDisplayText = StringSplit(StringStripWS(FileRead($sFileName), 6), @CRLF, 0) GUICtrlSetState($cStart, $GUI_HIDE) qloop() EndSwitch WEnd EndFunc ;==>Main Func qloop() For $i = 1 To $aDisplayText[0] Step 8 $iIndex = $i adjustfont($iIndex) While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE, $GUI_EVENT_RESIZED adjustfont($iIndex) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Next EndFunc ;==>qloop Func adjustfont($iIndex) If $iIndex = 0 Then ; It is the initial run <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $aPos = ControlGetPos($hGUI, "", $aDisplay_CIDs[0]) $sText = $sStart_Text $sFormattedText = _GetFontSize($sText, $aPos) ; If error then <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If @error Then ; Tell user $sFormattedText = "GUI too small" Else GUICtrlSetFont($aDisplay_CIDs[0], @extended) EndIf GUICtrlSetData($aDisplay_CIDs[0], $sFormattedText) Else ; There is a valid index to use <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Loop through display controls For $i = 0 To 4 $aPos = ControlGetPos($hGUI, "", $aDisplay_CIDs[$i]) $sText = $aDisplayText[$iIndex + $i] ; Will return formatted text or error message $sFormattedText = _GetFontSize($sText, $aPos) $iFontSize = @extended ; If no valid font size returned, set minimum value for error display <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If @error Then $iFontSize = 8 EndIf GUICtrlSetFont($aDisplay_CIDs[$i], $iFontSize) GUICtrlSetData($aDisplay_CIDs[$i], $sFormattedText) Next EndIf EndFunc ;==>adjustfont Func _GetFontSize($sText, $aPos) Local $iMinSize = 8 For $iSize = 24 To $iMinSize Step -1 ; 8pt is probably the lowest you want to go Local $aRect = _StringSize($sText, $iSize, Default, Default, Default, $aPos[2] - 25) ; Save @error $iError = @error Switch $iError ; Do nothing Case 0 ; If single word in text too large to fit in the rectangle - continue to reduce size Case 3 ContinueLoop ; Any other error is likely to be fatal so set return error flag Case Else ; Return with error text Return SetError($iError, 0, "StringSize Error") EndSwitch ; Check if text fits vertically If $aRect[3] <= $aPos[3] Then ; Return font size ExitLoop EndIf Next ; If even smallest font size will not fit If $iError = 3 Or $iSize < $iMinSize Then ; Return with error text Return SetError(1, 0, "GUI too small") EndIf Return SetError(0, $iSize, $aRect[0]) EndFunc ;==>_GetFontSize ; Set min and max GUI sizes Func _WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) $tMinMaxInfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tMinMaxInfo, 7, $iGUI_InitWidth) DllStructSetData($tMinMaxInfo, 8, $iGUI_InitHeight) DllStructSetData($tMinMaxInfo, 9, @DesktopWidth) DllStructSetData($tMinMaxInfo, 10, @DesktopHeight) Return 0 EndFunc ;==>_WM_GETMINMAXINFO M231 point -
Need help in file upload
TheXman reacted to JLogan3o13 for a topic
@jayg you cannot possibly believe that is enough information. Please see this post for how to ask a decent question on the forum (we even put "Please read before posting" in the title!). We need to know how you're trying to upload (FTP? HTTP? SFTP?), where you're uploading from (local system? remote system? network share? nfs mount? grandma's thumb drive?), and where you're uploading to (your own site? Google Drive? Box?). Help us help you1 point -
WebDriver UDF - Help & Support
PoojaKrishna reacted to Danp2 for a topic
@PoojaKrishna Can you post a reproducer script? Also, have you looked into using _WD_GetMouseElement instead?1 point -
[SOLVED] How do I open an email in outlook with Autoit
nooneclose reacted to water for a topic
Glad you got it running Using StringSplit the way you do is one of the many ways to solve your problem. Any other solution might be a bit faster but could be much more complex (like regular expression).1 point -
How to automate button click in a GUI?
Iulia_Vascan reacted to caramen for a topic
He just used the IUIAutomation UDF. That is allowing you to automate.net windows that autoIT cannot automate. This UDF request some training. Mail you can search in my precedent posts. I have a topic named IUIAutomation learning. It will show you how i learned it and what issue i encoutered and how i resolved them. You will have to face on this if you want to use IUIA UDF. Here you go :1 point -
_ArraySearch Help
Davidowicza reacted to Subz for a topic
Here is a few other examples, replacing the same item, appending text to the line item and inserting additional data two lines below the line item data,. The problem is if with Davids code is that if the line item is at the bottom of the file you need to redim the array to add the additional two lines. #include <Array.au3> #include <File.au3> Local $avArray _FileReadToArray('C:\Temp\temp1.txt', $avArray, $FRTA_NOCOUNT) If @error Then Exit _ArrayDisplay($avArray) Local $sSearch = "Transcriptionist:" Local $aSearch =_ArrayFindAll($avArray, $sSearch, 0, 0, 0, 1) For $i = UBound($aSearch) - 1 To 0 Step -1 ;~ Replace each line item with Transcriptionist: with data $avArray[$aSearch[$i]] = "Replaced Transcriptionist line item: " ;~ Append data to each line item with Transcriptionist: $avArray[$aSearch[$i]] &= "Appended Encounter Info: on the same Transcriptionist line item" ;~ Important when changing the array boundaries always loop backwards through the Array ;~ Add Encouter Info: above the line item with Transcriptionist If $aSearch[$i] + 2 > UBound($avArray) - 1 Then ReDim $avArray[UBound($avArray) + 2] $avArray[$aSearch[$i] + 2] = "Inserting Encounter Info: two lines below, Transcription: line item." Else _ArrayInsert($avArray, $aSearch[$i] + 2, "Inserting Encounter Info: two lines below, Transcription: line item.") ;~ nb: If you want to add above Transcriptionist line, just use _ArrayInsert($avArray, $aSearch[$i], "Encounter Info:") EndIf Next _ArrayDisplay($avArray) MsgBox(0, "Found", $sSearch & " was found in the array the following number of times [" & UBound($aSearch) - 1 & "]")1 point -
Hello really nice, You rock LarsJ!!! I was getting ListView2.au3 Ended without pressing close button. It was exiting from main loop because you forgot to check g_pExit value with 1. This fixed the issue. If DllStructGetData( DllStructCreate( "short", $aData[2] + 8 ), 1 )=1 Then ExitLoop You could wrap "DllStructGetData( DllStructCreate( "short", $aData[2] + 8 ), 1 )" in a easier way for not advanced users because the will get scared when they see that. Saludos1 point
-
FAQ - Updated - Please Read Before Posting
Doniel reacted to JLogan3o13 for a topic
Welcome to the forum! As a note to both new and current members and as mentioned above, please read the FAQs on the AutoIt Wiki before posting. This will save you time, as the answers to many common questions are out there. Most importantly for new forum members, please see the section on Why isn't my thread getting any replies? Forum members are here, volunteering their time to help you with your questions, and we will always do our best to assist. Below are just a few of the items we need from you in order to provide the best help, please see the FAQ section for more: First, foremost and always, know and follow the forum rules: Every member of this forum is expected to know and adhere to the forum rules. The rules are based on common sense and should not be daunting for anyone to follow. Doing so will ensure you receive assistance and will prevent any necessary sanctions by the Moderation team. We would much rather help you with your scripts than have to attend to the unpleasant business of suspending or banning accounts. Add a meaningful title to your thread: "HELP!!" tells no one anything, and will often delay your receiving assistance. Include a detailed description of what you are trying to do, what you have tried on your own, and what problem/error you are experiencing: "Doesn't work" or "AutoIt's broke" doesn't cut it. Forum members are also here to help you write and improve your own scripts; this is not a forum where you put in an order and someone writes the code for you. Always Post Code: Even if the code is not doing what you want it to, posting the code you are working from rather than asking forum members to guess is always going to result in more rapid assistance. If you cannot post the code for business reasons, create a script that reproduces the issue you are seeing.1 point -
I can no longer scrape this page, can you?
coffeeturtle reacted to Danyfirex for a topic
Hello. this works for me. #include <Array.au3> #include <String.au3> Local $URLSteam = "https://steamdb.info/app/264710/info/" Local $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHttp.Open("GET", $URLSteam, False) $oHttp.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 4.0.20506)") $oHttp.Send() Local $sData = $oHttp.ResponseText ConsoleWrite($sData & @CRLF) Local $aArray_32bit_Icons = _StringBetween($sData, 'avatar" src=', '" alt=') _ArrayDisplay($aArray_32bit_Icons) Saludos1 point -
** UPDATED ** Jan 22, 2009 Ver 1.4.1 XSkin.au3 * Added - XSkinConsole - Plug-in * Added - XSkinTrayMenu - Plug-in * Over 40 GUI Skins! - any size you want * Mouse-Over GUI Options / Slide-to-top & Transparent * Mouse-Over / Color Controls - See AUTOIT LIMITS * XSkinButton - colored with mouseover color change * XSkinButtonSetState() - Show or Hide * XSkinIconButton - with text * Skinned Progress Bar - works on Xp Theme too! * Skinned InputBox * Skinned Message Box * Skinned Message Box OK - ok button only * Skinned Tray Message box ( lower right-hand corner with fade-out ) * XSkinIcon ( Title Bar Help/Minimize/Exit ) * Minimal CPU Usage OLD Au3 File only... XSkin.au3 previous downloads = 2,765 +/- One Skin is Required... 40 + Skins Plug-ins... XSkinShell.au3 - Skin other Programs! XSkinToolBar.au3 - ToolBar for XSkin XSkinInputBox() - with password parameter XSkinGradient.au3 - Custom background colors XSkinTab.au3 - Colored Tabs / List Tabs XSkinAnimate.au3 - Window Animation SEE - XSkin.au3 Demonstration Page & Custom Skin Designs Introducing - EzSkin_1-2-3 DownLoad - Custom example by big daddy & FULLY LOADED! Some of the Original Skins *** Note the mouse was over the button/control ( color change ) Example Input Box pic... Example Message Box pic... and... simple to use 8)1 point
-
1 point
-
* Ver 1.4.8 - November 27, 2007 Autoit 1-2-3.zip ( previous version downloads 28,730 +/- ) Old Version - Autoit_123.zip * GUI #2 of 19 GUI's * GUI #6 of 19 GUI's * GUI #14 of 19 GUI's 8)1 point