Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Wrong read help file : Return Value Success: 1. Failure: 0 if path/file does not exist.
  3. Nine, FileExists () is for directories or files that are already exist, here, as i said, i want to verify before creating the directory
  4. Jos because using DirCreate with a file path create a directory with a file name like toto.csv, and so there is no failure.
  5. So why can't you use FileGetAttrib() and test for it's success/failure? Jos
  6. Hello, friends. Tell me how to script autoit to recognize the flashing in the window. That is, periodically in window 1.exe flashes at a constant frequency. Flashing is a frequent and abrupt change of color for 3 seconds.
  7. Hi before creating a folder with DirCreate, i want to verify if the input path is a valid directory path and not a file path. As long as the file does not exist yet, it is not possible to use FileGetAttrib to discriminate . How can i do this ?
  8. IanN1990, The text in a console window is usually written directly in the client area in the window with the DrawText function or the like. DrawText is a GDI (graphics) function and the text is simply colored pixels directly in the window. The text in a console window is comparable to an image and is not represented as an edit or text control and therefore cannot be automated either with UIA, MSAA or classic automation code. The text in Notepad or in a listbox, listview or treeview is, however, represented as a real edit or text control where the text is stored in a DllStruct (char, wchar, str, wstr, bstr or similar) that is included in the control. Therefore, these text controls can be automated. But this is not the case for the text in a console window and therefore the text cannot be automated.
  9. Did you look at the examples in that thread? How do you think you'll get paid for a script, if you can't even bother looking at examples given to you? Who would pay for a script from a coder who can't even figure out how to use something handed to him on a silver platter?
  10. That is what I do myself most times. I never continued this code, that is more of a recompilation of code laying around than a personal brainstorm. The your UDF merits a clarification. The way I see it, everyone is welcome, and I encourage, the testing and bettering of code, any and all code. I dislike the notion of intellectual property. The history of the code would be important for following the development, so mention of the collaborators in chronological order and their contribution carries this importance. Other than that, is our code Back then, when I tested, I thought I did. But to be fair, I don't remember much. I thought the code was good enough to share under the claim. I'd have to go back to it, and look at it again. And I will ( pinky swear ) to look at it at a future time, when I can devote some time to it Actually, thank you for bringing up, this having an issue no one was aware of, and posting about it.
  11. Today
  12. The most efficient way to sell your script is to get paid first Don't transfer the script to them (even a demo version), if they really want to test it out, arrange a remote demo where the buyer can take control of the computer (could be in a VM) under your supervision. This is the simplest way to avoid getting cheated and if your product has enough demand, you would not have trouble finding customers willing to pay before they get the goods
  13. I don't know how to use XproTec and how it work. Can you give me a little example?
  14. Get all texts in a Chrome window This example shows how to extract all texts in a Chrome window. The previous webpage (page 2) is used as an example. Don't forget this: To be able to spy on web content in Google Chrome it's necessary to enable accessibility by entering chrome://accessibility/ in the address bar of a new tab item, and then check the five check boxes that are located in a column in upper left corner down along the left edge. Then the accessibility tab can be closed again. It's a global setting that applies to all open and new tabs until Chrome is closed. Without accessibility enabled you are only able to investigate the outer elements of Chrome but not web content. SampleCode1.au3 shows how to find the first text (SampleCode1-a.au3 is the code generated directly by UIASpy): #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;#AutoIt3Wrapper_UseX64=n ; If target application is running as 32 bit code ;#AutoIt3Wrapper_UseX64=y ; If target application is running as 64 bit code #include "UIA_Constants.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Functions.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_SafeArray.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Variant.au3" ; Can be copied from UIASpy Includes folder Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) Local $pText1, $oText1 $oPane1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 ) $oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF ) ConsoleWrite( "$oText1 OK" & @CRLF ) EndFunc SciTE output: $oUIAutomation OK $oDesktop OK --- Find window/control --- $pCondition0 OK $oPane1 OK --- Find window/control --- $pCondition1 OK $oText1 OK SampleCode2.au3 shows how to find all texts (SampleCode2-a.au3 is the code generated directly by UIASpy): #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;#AutoIt3Wrapper_UseX64=n ; If target application is running as 32 bit code ;#AutoIt3Wrapper_UseX64=y ; If target application is running as 64 bit code #include "UIA_Constants.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Functions.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_SafeArray.au3" ; Can be copied from UIASpy Includes folder ;#include "UIA_Variant.au3" ; Can be copied from UIASpy Includes folder Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement( $pDesktop ) $oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF ) ConsoleWrite( "$oDesktop OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pPane1, $oPane1 $oDesktop.FindFirst( $TreeScope_Descendants, $pCondition0, $pPane1 ) $oPane1 = ObjCreateInterface( $pPane1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oPane1 ) Then Return ConsoleWrite( "$oPane1 ERR" & @CRLF ) ConsoleWrite( "$oPane1 OK" & @CRLF ) ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition1 $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1 ) If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF ) ConsoleWrite( "$pCondition1 OK" & @CRLF ) #cs Local $pText1, $oText1 $oPane1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 ) $oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF ) ConsoleWrite( "$oText1 OK" & @CRLF ) #ce Local $pElements $oPane1.FindAll( $TreeScope_Descendants, $pCondition1, $pElements ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $oUIElementArray1, $iLength1 ; $pElements is a pointer to an UI Automation element array $oUIElementArray1 = ObjCreateInterFace( $pElements, $sIID_IUIAutomationElementArray, $dtag_IUIAutomationElementArray ) $oUIElementArray1.Length( $iLength1 ) If Not $iLength1 Then Return ConsoleWrite( "$iLength1 = 0 ERR" & @CRLF ) ConsoleWrite( "$iLength1 = " & $iLength1 & @CRLF ) ; --- Code Snippets --- ConsoleWrite( "--- Code Snippets ---" & @CRLF ) Local $pElement1, $oElement1, $sValue1 For $i = 0 To $iLength1 - 1 $oUIElementArray1.GetElement( $i, $pElement1 ) $oElement1 = ObjCreateInterface( $pElement1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) $oElement1.GetCurrentPropertyValue( $UIA_NamePropertyId, $sValue1 ) ConsoleWrite( "$sValue1 = " & $sValue1 & @CRLF ) Next EndFunc SampleCode2.au3 is a continuation of SampleCode1.au3 where FindFirst is replaced with FindAll and code snippets are added to Create an UI Automation element array from pointer Traverse an array to get access to individual elements The code snippets are added ín two steps in UIASpy. It's only possible to use item 2 if item 1 is completed. Item 2 is simply not shown in the listview unless item 1 is completed. SciTE output (in part, see SampleCode2.txt): $oUIAutomation OK $oDesktop OK --- Find window/control --- $pCondition0 OK $oPane1 OK --- Find window/control --- $pCondition1 OK --- Code Snippets --- $iLength1 = 3768 --- Code Snippets --- $sValue1 = Existing user? Sign In   $sValue1 = ? $sValue1 = Sign Up $sValue1 = Browse $sValue1 = Forums $sValue1 = Downloads $sValue1 = Calendar $sValue1 = Forum Rules $sValue1 = Wiki $sValue1 = AutoIt Resources $sValue1 = ? $sValue1 = FAQ $sValue1 = Our Picks $sValue1 = ? $sValue1 = $sValue1 = All Activity $sValue1 = ? $sValue1 = Home $sValue1 = ? $sValue1 = AutoIt v3 Search for SEKOMD in SampleCode2.txt to see all activity of this user. AllChromeTexts.7z
  15. It's a question non related to nothing else than what you can read in this post. The other post was about another question to another project, It's clear, nothing about automated programs which I never mentioned. CHANGE delay of mouse in the middle of a script. That's all, that's my new project I've just started and I want someone to help me, if you don't want to then don't do it but in this post I am not breaking any forum rule. Thanks
  16. Yes, But buyer was already know his computer's serial number, He can Run complied script after entering it.
  17. Zag8888, I recommend reading the Interrupting a running function tutorial in the Wiki - that explains what is happening. M23
  18. GoliaX, And how is this different from the last thread which I locked? In our PM exchange I even pointed out the bit in the Forum rules about reposting with game references removed - which bit of that is unclear? M23
  19. Hey, I have tried to use OnEvent Mode but when I press Start I'm in the same situation... nothing work until start is ended. Func Form $Start = GuiCtrlCreateButton("Start", 20, 200, 90, 50,bitor($BS_CENTER,0,0)) GUICtrlSetOnEvent($Start,"Startall") $Exit = GuiCtrlCreateButton("Exit", 140, 200, 90, 50,bitor($BS_FLAT,$BS_VCENTER,0,0)) GUICtrlSetOnEvent($Exit,"Exits") GUICtrlSetOnEvent($GUI_EVENT_CLOSE,"Exits") ; When I try to click to close the script using the "X" nothing happen EndFunc Func Startall() Start() EndFunc Func Exits() Exit EndFunc
  20. Thank you for fast response i saw the script prior posting and as i understood it's a gui thing, i need a string format i have a function that require a string to print it on lcd, can be used marquee to create a same size string as original one but rotating?maybe i've missed something, i could make a function to subtract the max-1 both sides and concatenate them and trim it to @30 chars, but it sounds painful and i guess it's harder then it sounds. My small project it's to make a lcd app to print song name that's playing on spotify. Till now i've managed to do the displaying but i want the text to be on 1 line only, and if the title it's longer then to scroll the text. Edit: this is what i'm come up to, is there any other more elegant solution, it looks sooo trivial... $title="Adelitas Way - What It Takes"&" " ;31 $max=10 while 1 $title=title($title) ConsoleWrite(StringTrimRight($title,Int(StringLen($title))-$max)&@CRLF) Sleep(100) WEnd Func title($otitle) local $o_title=$otitle local $size=StringLen($o_title) local $char=StringTrimRight($o_title,$size-1) local $title_subed=StringTrimLeft($o_title,1) $first=StringTrimLeft($o_title,1) ;ConsoleWrite($title_subed&$char&@CRLF) Return $title_subed&$char EndFunc
  21. This has been discussed multiple time in here. For example (very recently) :
  22. Hello everybody, I want the end-user to be able to change mouse and send key delay. I use inputs to they can change in GUI but It's not working with opt() since it needs to reset program, any way to change opt delay pausing the script and starting again without close program? Thank you
  23. #include <date.au3> $expdate = Floor(_DateToDayValue("2019", "04", "25")) ;Julian date since (days since noon 4713 BC January 1) If (Floor(_DateToDayValue(@YEAR, @MON, @MDAY)) > $expdate) Then MsgBox(48, "Expired version", "This is an expired pre-release development version" & @CRLF & _ "of this program and is not for general use." & @CRLF & @CRLF & _ "Please email somebody@somewhere.com for further information.") Exit ;run activation program Exit EndIf this code is work but if i changed the date manually the program back to work . so i want to bring the time and date from internet to stop this trick , any help ? :/
  24. GoliaX, Welcome to the AutoIt forum. Those numbers are the ControlIDs of the inputs - you need to display their content. And unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no further help and this thread will now be locked. See you soon with a legitimate question I hope. M23
  25. Hello all, I can't figure out why this happens, maybe some of you find what i am doing wrong. I have 2 inputs in my GUI, to end user can change mouse click delay and send key delay. I have this as code: Opt("MouseClickDownDelay", Number(GUICtrlRead($Inputm))) Opt("MouseClickDelay", Number(GUICtrlRead($Inputm))) Opt("SendKeyDownDelay", Number(GUICtrlRead($Inputk))) Opt("SendKeyDelay", Number(GUICtrlRead($Inputk))) I use 2 same valor inputs for these 4 opt. Then when I press start script, the log GUICrtEdit shows 33 for MouseDelay and 37 for KeyDelay, then I thoght It is showing the number in hex, then i place Dec($Inputm) in CtrlSetData to show in log and it shows it in decimal but diferent number than what you choose in the GUI. In real, even if you change the end user inputs, will always show 51 as mousedelay and 55 as keydelay. code: Global $Inputk = GUICtrlCreateInput("40", 447, 223, 41, 22, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_NUMBER)) Global $Inputm = GUICtrlCreateInput("50", 247, 223, 41, 22, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_NUMBER)) Func _start_bot()     If WinExists("example_window") = true Then         Opt("MouseClickDownDelay", Number(GUICtrlRead($Inputm)))         Opt("MouseClickDelay", Number(GUICtrlRead($Inputm)))         Opt("SendKeyDownDelay", Number(GUICtrlRead($Inputk)))         Opt("SendKeyDelay", Number(GUICtrlRead($Inputk)))         GUICtrlSetData($label10, "["& _NowTime()&"]" & " ClickMouseDelay: " & Dec($Inputm) & @CRLF, "")         GUICtrlSetData($label10, "["& _NowTime()&"]" & " KeySendDelay: " & Dec($Inputk) & @CRLF, "")         sleep(1000) What am I doing wrong? Thank you in advance
  1. Load more activity
×
×
  • Create New...