Jump to content

Palestinian

Active Members
  • Posts

    296
  • Joined

  • Last visited

Everything posted by Palestinian

  1. I understand that this thread is over 10 years old but AS400 hasn't changed much since the thread was started. I haven't tried using AutoIt to automate AS400 yet, instead I'm using the built-in Macro/Script function which uses VBScript. If you decide to use that functionality instead of AutoIt please keep in mind that IBM's documentation does not always give you the correct syntax to use with AS400, an example would be: Example Dim autECLPSObj as Object '<- incorrect syntax, Dim autECLPSObj is the correct syntax Dim Row, Col, WaitString Set autECLPSObj = CreateObject("PCOMM.autECLPS") autECLPSObj.SetConnectionByName("A") WaitString = "Enter USERID" Row = 20 Col = 16 if (autECLPSObj.WaitForString(WaitString,Row,Col,10000)) then '<- incorrect syntax, If auECLPSObj.WaitForString(WaitString,Row,Col,10000) is the correct syntax msgbox WaitString " " found at " " Row " "," " Col else msgbox "Timeout Occurred" end if You can also use the SearchText method with row/col parameters to look up for the text in the username box and that will return its coords,
  2. >Here's some reading to do.
  3. Yeah I kind of figured as much and used the following: Func CacheChange() RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Cache", "REG_EXPAND_SZ", "C:\TempAppFiles") EndFunc ;==>CacheChange Func CacheReset() RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Cache", "REG_EXPAND_SZ", "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files") EndFunc ;==>CacheReset Thank you again, I really appreciate your help.
  4. Cheers mate. Another question if it isn't asking too much, is there a way to set a seperate folder for _IECreateEmbedded cache?
  5. Hello everyone, I was wondering where does _IECreateEmbedded store its cache? I'm thinking about creating a little program for my everyday online surfing and I want its cache to be kept so the program won't reload the whole thing whenever I start it.
  6. What you have so far should do the trick, just add a Sleep when nothing is found. #include <IE.au3> #RequireAdmin Market() Func Market() While 1 $dData = InetRead("https://www.paidverts.com/") If StringInStr($dData, "$3") Then MsgBox(1, "Alert", "Something is cheaper than $4!") ExitLoop Else Sleep(30000) EndIf WEnd EndFunc ;==>Market
  7. I just love complecating things, its kind of my thing you know. And yes, I should've picked a better title, my bad.
  8. Hello everyone It's been a long time since I last posted (or even checked) the forums, been busy a lot lately... But I'm back for a while now, and I have some questions regarding integerated web automation, I know its possible with IE.au3 using _IECreateEmbedded, but what I'm really interested in is something that was asked by JohnOne about 4 years ago, GeckoFX. (>Original Post). I've been thinking that since its been 4 years now since that question was asked, maybe there's been a few updates that dealt with such an issue? I've came across some applications made with C# that implemented GeckoFX and I really want to try doing it with AutoIt since my knowledge in programming is limited to few aspects in AutoIt with no time for learning a new programming language. Regards, Palestinian.
  9. Don't "bump" your thread unless it's been +24 hours without any replies to it.
  10. I think its pretty obvious that this sounds fishy, what are you trying to achieve with this?
  11. Download this, extract it to a folder and save this script in the same folder: #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include "UIAWrappers.au3" #include <Misc.au3> AutoItSetOption("MustDeclareVars", 1) #AutoIt3Wrapper_UseX64=Y ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os dim $oldUIElement ; To keep track of latest referenced element dim $Form1, $Edit1, $label1, $label2, $msg, $x, $y, $oUIElement, $oTW, $objParent, $oldElement, $text1, $t ;~ Some references for reading ;~ [url=http://support.microsoft.com/kb/138518/nl]http://support.microsoft.com/kb/138518/nl[/url] tagpoint structures attention point ;~ [url=http://www.autoitscript.com/forum/topic/128406-interface-autoitobject-iuiautomation/]http://www.autoitscript.com/forum/topic/128406-interface-autoitobject-iuiautomation/[/url] ;~ [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ff625914(v=vs.85).aspx]http://msdn.microsoft.com/en-us/library/windows/desktop/ff625914(v=vs.85).aspx[/url] HotKeySet("{ESC}", "Close") ; Set ESC as a hotkey to exit the script. HotKeySet("^w", "GetElementInfo") ; Set Hotkey Ctrl+M to get some basic information in the GUI #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 1024, 768, 192, 124) $Edit1 = GUICtrlCreateEdit("", 10, 10, 600, 700) ;~ $Edit1 = GUICtrlCreateEdit("", 10, 10, 10, 10) $Label1 = GUICtrlCreateLabel("Ctrl+W to capture information", 640,10,600,25) $Label2 = GUICtrlCreateLabel("Escape to exit", 640,45,600,25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _UIA_Init() ; Run the GUI until the dialog is closed While true $msg = GUIGetMsg() sleep(100) ;~ if _ispressed(01) Then ;~ getelementinfo() ;~ endif If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func GetElementInfo() Local $hWnd Local $tStruct = DllStructCreate($tagPOINT) ; Create a structure that defines the point to be checked. ;~ Local $tStruct = DllStructCreate("INT64,INT64") ;~ Local $tStruct =_AutoItObject_DllStructCreate($tagPoint) ToolTip("") Global $UIA_oUIAutomation ;The main library core CUI automation reference Global $UIA_oDesktop, $UIA_pDesktop ;Desktop will be frequently the starting point Global $UIA_oUIElement, $UIA_pUIElement ;Used frequently to get an element Global $UIA_oTW, $UIA_pTW ;Generic treewalker which is allways available $x=MouseGetPos(0) $y=MouseGetPos(1) DllStructSetData($tStruct, "x", $x) DllStructSetData($tStruct, "y", $y) consolewrite(DllStructGetData($tStruct,"x") & DllStructGetData($tStruct,"y")) ;~ consolewrite("Mouse position is retrieved " & @crlf) $UIA_oUIAutomation.ElementFromPoint($tStruct,$UIA_pUIElement ) ;~ $objUIAutomation.ElementFromPoint(DllStructGetPtr($tStruct),$pUIElement) ;~ consolewrite("Element from point is passed, trying to convert to object ") $oUIElement = objcreateinterface($UIA_pUIElement,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) $UIA_oUIAutomation.RawViewWalker($UIA_pTW) $oTW=ObjCreateInterface($UIA_pTW, $sIID_IUIAutomationTreeWalker, $dtagIUIAutomationTreeWalker) If IsObj($oTW) = 0 Then msgbox(1,"UI automation treewalker failed", "UI Automation failed failed",10) EndIf local $parentHandle $oTW.getparentelement($oUIElement,$parentHandle) $objParent=objcreateinterface($parentHandle,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) If IsObj($objParent) = 0 Then msgbox(1,"No parent", "UI Automation failed failed",10) EndIf if isobj($oldUIElement) Then if $oldUIElement=$oUIElement then return endif endif _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN) ; Clears Red outline graphics. GUICtrlSetData($Edit1, "Mouse position is retrieved " & $x & "-" & $y & @CRLF) $oldElement=$oUIElement If IsObj($oUIElement) Then ;~ ConsoleWrite("At least we have an element " & "[" & _UIA_getPropertyValue($oUIElement, $UIA_NamePropertyId) & "][" & _UIA_getPropertyValue($oUIElement, $UIA_ClassNamePropertyId) & "]" & @CRLF) GUICtrlSetData($Edit1, "At least we have an element " & "[" & _UIA_getPropertyValue($oUIElement, $UIA_NamePropertyId) & "][" & _UIA_getPropertyValue($oUIElement, $UIA_ClassNamePropertyId) & "]" & @CRLF,1) $text1="Title is: <" & _UIA_getPropertyValue($oUIElement,$UIA_NamePropertyId) & ">" & @TAB _ & "Class := <" & _UIA_getPropertyValue($oUIElement,$uia_classnamepropertyid) & ">" & @TAB _ & "controltype:= " _ & "<" & _UIA_getControlName(_UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId)) & ">" & @TAB _ & ",<" & _UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId) & ">" & @TAB _ & ", (" & hex(_UIA_getPropertyValue($oUIElement,$UIA_ControlTypePropertyId)) & ")" & @TAB & @CRLF $text1=$text1 & "*** Parent Information ***" & @CRLF $text1=$Text1 & "Title is: <" & _UIA_getPropertyValue($objParent,$UIA_NamePropertyId) & ">" & @TAB _ & "Class := <" & _UIA_getPropertyValue($objParent,$uia_classnamepropertyid) & ">" & @TAB _ & "controltype:= " _ & "<" & _UIA_getControlName(_UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId)) & ">" & @TAB _ & ",<" & _UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId) & ">" & @TAB _ & ", (" & hex(_UIA_getPropertyValue($objParent,$UIA_ControlTypePropertyId)) & ")" & @TAB & @CRLF $text1=$text1 & "*** Detailed properties of the highlighted element ***" $text1= $text1 & @CRLF & _UIA_getAllPropertyValues($oUIElement) GUICtrlSetData($Edit1, "Having the following values for all properties: " & @crlf & $text1 & @CRLF, 1) _GUICtrlEdit_LineScroll($Edit1, 0, 0 - _GUICtrlEdit_GetLineCount($Edit1)) $t=stringsplit(_UIA_getPropertyValue($oUIElement, $UIA_BoundingRectanglePropertyId),";") _UIA_DrawRect($t[1],$t[3]+$t[1],$t[2],$t[4]+$t[2]) EndIf EndFunc ;==>Example Func Close() Exit EndFunc ;==>Close Run the script and point at the Connect/Disconnect button then hold Ctrl + W, it should give you an idea on what the button is, post the result here.
  12. Isn't disabling Windows firewall considered a security override in some cases?
  13. Use >IUIAutomation and see if it can identify the Connect/Disconnect button, if it then you should be able to accomplish what you want with ease.
  14. @OP: Use AutoIt Window Info on the dongle's software and see if it can recognize the reconnect button, check the help file and try to write your own script, give it a shot and post your attempt after. @orbs: I doubt that will fix the issue, and even if it did fix the issue of disconnecting for being idle, it won't do any good if the device disconnects for any other reason, which in my case is over heating while downloading most of the time.
  15. $oIE = _IEAttach("<span class="titre_ref2">", "html") Should be changed to $oIE = _IEAttach('<span class="titre_ref2">', "html") I don't know about your question but I'm sure you'll get your answer very soon.
  16. Not sure what you're doing wrong there, but I believe its impossible for AutoIt to try and click a link that doesn't exist since you already got all the links in that page with _IELinkGetCollection, I could be wrong tho, unless the page updated its links list and removed the one AutoIt was trying to click. I ran your script for half an hour straight (Note that Sleep is removed meaning it was loading every page once the previous one is done loading) and ran into zero errors on SciTE, #include <IE.au3> Local $oIE = _IECreate("http://google.com") While 1 _IENavigate($oIE, "http://debhl.mepage.us/DEB/") _IELoadWait($oIE) Local $oLinks = _IELinkGetCollection($oIE) Local $iNumLinks = @extended _IELinkClickByIndex($oIE, Random(0, $iNumLinks)) _IELoadWait($oIE) ;~ sleep(180000) WEnd
  17. "For documentation purposes" You create a new topic and put a reference to this one, you don't necro-post a decade old post even if its the 1st result on Google.
  18. What you're asking for is someone to write a full script for you, Exit was nice enough to give you something to work with, You quoted Brew but answered none of his questions, good luck
  19. Looping just fine for me, Win8 x64 latest AutoIt and SciTE, posting the actual website helps most of the time
  20. Help us help you, what did you try so far? how long have you been using AutoIt? How good are you with it? did you check the help file? Hint: _IEBodyWriteHTML
  21. Did you try sending a normal " * " ?
×
×
  • Create New...