Jump to content

DW1

Active Members
  • Posts

    2,078
  • Joined

  • Last visited

  • Days Won

    4

DW1 last won the day on July 31 2013

DW1 had the most liked content!

About DW1

  • Birthday 01/03/1985

Profile Information

  • Member Title
    Central Scrutinizer
  • Location
    OR, US
  • WWW
    http://www.autoitscript.com/autoit3/docs/
  • Interests
    Motorcycles, music, computers, games, movies.

Recent Profile Visitors

793 profile views

DW1's Achievements

  1. Your script is working as expected for me. What version of autoit are you running, and do you have any instances of notepad running that you missed?
  2. I'm sure a regex guru can come along and make a nicer, proper regex for this, but this is grabbing the links for me. This should grab the recommended downloads for premium security (trial and paid) #include <Inet.au3> #include <Array.au3> Local $sURL = 'http://www.avg.com/us-en/download.prd-isi' Local $sSource = _INetGetSource($sURL) Local $aRegEx = StringRegExp($sSource, 'a href="(.*\.exe)"(?:.*\R){0,5}.*Recommended', 3) _ArrayDisplay($aRegEx)
  3. What about something like this? $oIE.document.parentWindow.execScript("__doPostBack('dtgLista$_ctl3$_ctl0','');","javascript")
  4. Okay, so Volatile was the key! Volatile will allow the event function to fire synchronous so we can make our change to Cancel. Thank you Trancexx for the Volatile keyword! The following should cancel any new window calls and send the URL that was going to be opened in them to the embedded IE. #include <GUIConstantsEx.au3> #include <IE.au3> Global $oIE = _IECreateEmbedded() ObjEvent($oIE, "_Evt_", "DWebBrowserEvents2") $hGUI = GUICreate("Test", 1000, 500) GUICtrlCreateObj($oIE, 10, 10, 980, 480) GUISetState(@SW_SHOW) _IENavigate($oIE, "http://www.w3schools.com/html/tryit.asp?filename=tryhtml_link_target", 0) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Volatile Func _Evt_NewWindow3($ppDisp, ByRef $Cancel, $dwFlags, $bstrUrlContext, $bstrUrl) ;Any link being sent to a new window will be canceled and directed back to the embedded IE object ConsoleWrite("NewWindow3 attempted to open a new window @ " & $bstrUrl & @CRLF) _IENavigate($oIE, $bstrUrl, 0) $Cancel = True EndFunc ;==>_Evt_NewWindow3
  5. Well, I was going to suggest that you capture the NewWindow3 event from the browser and open the link yourself, however, I can't seem to cancel the new window from opening. Maybe somebody can fix this to where the $Cancel = True stops the window from opening... seems like it should, but I must be doing something wrong there. This code will open any link that is sent to a new window, in the embedded browser itself. That being said, for some reason it is not cancelling the new window, so you end up with both. I'm still trying to fix that part. EDIT: See working code in next post.
  6. What application are you working in? Are you really trying to double click while holding control, or just multiple single clicks? Is there a difference between the two in the application you are working in?
  7. Well if PowerCFG is returning the data missing as well, then AutoIt is not doing anything wrong at all. It is returning exactly what it is given.
  8. As a workaround, get the PID of the explorer.exe process you just spawned by comparing ProcessList() before and after calling explorer: $aPIDstart = ProcessList("explorer.exe") RunWait("explorer.exe shell:::{865e5e76-ad83-4dca-A109-50dc2113ce9a}", @ScriptDir) $aPIDend = ProcessList("explorer.exe") Local $bFound For $i = 1 To UBound($aPIDend) - 1 $bFound = False For $i2 = 1 To UBound($aPIDstart) - 1 If $aPIDstart[$i2][1] = $aPIDend[$i][1] Then $bFound = True Next If $bFound = False Then $PID = $aPIDend[$i][1] Next MsgBox(0,$PID,ProcessExists($PID)) While ProcessExists($PID) ProcessClose($PID) Sleep(100) WEnd MsgBox(0,$PID,ProcessExists($PID))
  9. Since the mods are allowing it, perhaps this can get you started: #include <IE.au3> #include <Array.au3> Global $iValue = 1500, $sSearch = "Isk Profit/LP" Local $bVisible = True Local $sURL = "http://www.ellatha.com/eve/LPIndex-Isk-", $iIndex = 1, $iISKindex Local $oIE = _IECreate("about:blank", 0, $bVisible) OnAutoItExitRegister("cleanup") Local $oTables, $aTable, $aItem While 1 _IENavigate($oIE, $sURL & $iIndex) $oTables = _IETableGetCollection($oIE) For $oTable In $oTables $aTable = _IETableWriteToArray($oTable, True) If StringInStr($aTable[0][0], "Faction Corp") Then For $a = 0 To UBound($aTable, 2) - 1 If StringInStr($aTable[0][$a], $sSearch) Then For $b = 1 To UBound($aTable, 1) - 1 If Number(StringReplace($aTable[$b][$a], ',', '')) > $iValue Then Dim $aItem[2][UBound($aTable, 2)] For $iItem = 0 To UBound($aTable, 2) - 1 $aItem[0][$iItem] = $aTable[0][$iItem] $aItem[1][$iItem] = $aTable[$b][$iItem] Next _LogItem($aItem) EndIf Next EndIf Next ExitLoop EndIf Next $iIndex += 20 WEnd Func _LogItem($aItem) _ArrayDisplay($aItem, "Item found with at least " & $iValue & " " & $sSearch) EndFunc ;==>_LogItem Func cleanup() _IEQuit($oIE) EndFunc ;==>cleanup
  10. I understand completely. I have just seen exactly this sort of request be against the rules in the past. If a mod comes in and says that they allow it, I will gladly help you out with it. Sorry man.
  11. Please see the Forum Rules. I don't think that this will be allowed, but it is not my decision.
  12. Separate for sure, as that would be a sizable UDF all on its own. If it is going to become a UDF on its own, whoever is going to own it will want to rewrite the functions to be more like dealing with controls in AutoIt most likely.
  13. I hope this example will help. If it does not, can you be more specific on your confusion? #include <array.au3> Local $aTest[4][4] = [['a','b','c','d'],['e','f','g','h'],['i','j','k','l'],['m','n','o','p']] _ArrayDisplay($aTest) ;Loop through each array item one by one For $i1 = 0 To UBound($aTest,1) - 1 ConsoleWrite("--Current index of dimension 1: " & $i1 & '/' & UBound($aTest,1) - 1 & @CRLF) For $i2 = 0 To UBound($aTest,2) - 1 ConsoleWrite('Dimension 2 index: ' & $i2 & '/' & UBound($aTest,2) - 1 & ' = ' & $aTest[$i1][$i2] & @CRLF) Next Next
  14. To step through as you were asking, as long as you are using the full Scite4AutoIt package, you can use Tools>"Trace: Add Trace Lines". This will add debugging to console for each line. To make them pause each time, just do a search>replace "ConsoleWrite('>Error code" --> "MsgBox(0,'Step','>Error code" When you are done debugging, reverse the search>replace and then use Tools>"Trace: Remove ALL trace lines"
×
×
  • Create New...