
empty75
Members-
Posts
16 -
Joined
-
Last visited
empty75's Achievements

Seeker (1/7)
0
Reputation
-
Question about compatibility with Vista
empty75 replied to Muchuchu's topic in AutoIt General Help and Support
Strange solution but putting #RequireAdmin seems to solve the problem, but not sure why it needs to be run with admin rights, i will test on xp without admin to see if the same thing happened, as i am not logged in as local admin on my vista box but was on xp. thanks. -
Question about compatibility with Vista
empty75 replied to Muchuchu's topic in AutoIt General Help and Support
I have just discovered the same problem after upgrading to vista. My script worked perfect with xp sp2 and ie6, but i am now on vista sp1 with ie7. I am doing a $oIE1 = _IECreate ("http://www.blah.com", 0, 0, 1) Which should create a non-attached, inivisable browser and wait until the page has loaded before continuing. This opens ie7 as a visable browser, then freezes the script, even after the correct page has finished loading. removing the wait parameter causes the script to continue, but sometimes the page hasn't loaded quickly enough to grab the data i need, the window is still visable. Is this a vista problem or IE7 problem with the _IE include file (UDF ?) Thanks Matthew. -
Not sure why this works, but it does. Thanks. Matthew.
-
I am using latest autoit 3.2.10 I have a gui with several radio buttons, hidden and disabled in the same position are several check boxes. When i click a button it is supposed to disable/hide the radios and enable/show the check boxes Click the other button and they switch round. When the check boxes are displayed all is ok, but when the radios are displayed and you roll mouse over to select a radio button the display corrupts and displays the underlying checkbox. Below is a small section i am having trouble with from a much larger script CODE #include <GuiConstants.au3> ; Call Gui functions ;The GUI Install ********************* $GuiInstall = GuiCreate ("Test Checkboxes and Radios" , 460, 460) GuiSetBkColor(0XFFFFFF) $chk1 = GUICtrlCreateCheckbox ("Action", 110, 25) $chk2 = GUICtrlCreateCheckbox ("Breakout", 200, 25) $chk3 = GUICtrlCreateCheckbox ("Card", 280, 25) $chk4 = GUICtrlCreateCheckbox ("Multi", 200, 45) $chk5 = GUICtrlCreateCheckbox ("Puzz", 110, 65) $chk6 = GUICtrlCreateCheckbox ("Shooter", 200, 65) $chk7 = GUICtrlCreateCheckbox ("Strat", 280, 45) For $i = 1 To 7 ;disables and hides all check buttons GUICtrlSetState ( Eval("chk_" & $i), $GUI_Disable + $GUI_Hide) Next $CatGroupMsg = "The Game Category: " $rad_1 = GUICtrlCreateRadio ("Action", 110, 25) $rad_2 = GUICtrlCreateRadio ("Breakout", 200, 25) $rad_3 = GUICtrlCreateRadio ("Card", 280, 25) $rad_4 = GUICtrlCreateRadio ("Multi", 200, 45) $rad_5 = GUICtrlCreateRadio ("Puzz", 110, 65) $rad_6 = GUICtrlCreateRadio ("Shooter", 200, 65) $rad_7 = GUICtrlCreateRadio ("Strat", 280, 45) For $i = 1 To 7 ;enable all radio buttons GUICtrlSetState ( Eval("rad_" & $i), $GUI_Enable + $GUI_Show + $GUI_ONTOP) Next $Tocheckers = GUICtrlCreateButton ( "check", 20, 320, 80, 30) $toradio = GUICtrlCreateButton ( "radio", 20, 360, 80, 30) GUISetState(@SW_SHOW, $GuiInstall) While 1 $msg = GUIGetMsg() ; get the event message from the form Select Case $msg = $tocheckers For $i = 1 To 7 ;disables and hides all radio buttons GUICtrlSetState ( Eval("rad_" & $i), $GUI_Disable + $GUI_Hide) Next For $i = 1 To 7 ;display check buttons GUICtrlSetState ( Eval("chk_" & $i), $GUI_Enable + $GUI_Show + $GUI_ONTOP) Next Case $msg = $toradio ;change back to default settings For $i = 1 To 7 ;show all radio buttons GUICtrlSetState ( Eval("rad_" & $i), $GUI_Enable + $GUI_Show + $GUI_ONTOP) Next GuiCtrlSetState($rad_7, $GUI_Checked) For $i = 1 To 7 ;disables and hides all check buttons GUICtrlSetState ( Eval("chk_" & $i), $GUI_Disable + $GUI_Hide) Next EndSelect Wend It doesn't matter if the radios are in a group or not it still mucks up when i try to display the radio buttons. Any suggestions or is this a bug? Thanks. Matthew
-
I have a script that visits a webpage then grabs a image and some text embedded in the html. I do this using various methods, namely: _INetGetSource, InetGet, _IECreate(), _IEDocReadHTML I am behind a proxy and use Httpsetproxy, IE also has its proxy info set. I have a function i am writing to enable configuration of the proxy. During testing, i tried running my download script with the proxytype set to '0', and it still seems to work and download the picture, and text. IF i disable the proxy in IE then the script no longer downloads anything, which is what i would expect as the script uses _IE functions to determine if the webpage exits. My question is why is INetGet still working even if httpsetproxy(0). What functions does httpsetproxy effect ?? My script seems to be getting all its settings from IE, even though i thought that inetget used the proxy from httpsetproxy. Are there environment vaiables or registry settings that inetget uses before checking with httpsetproxy ?? I have searched my script and cant find any other httpsetproxy that might be overriding the settings i have chosen. Does the first _IECreate call auto set proxy settings for the rest of the script and ignores the httpsetproxy command?? Any ideas anyone. PS. Are there any commands to read/change the IE proxy settings from within autoit script. Thanks for any help you can give. Matthew.
-
Thanks for all your help , with the above code i now have what i wanted, and the only noticable slow down is while the inetgetsource is running. Now generates a list of about 300 games in about 30 seconds, instead of a list of 20 games in 60 seconds with the method i was using. Thanks. Matthew
-
I am still trying to do this, the function i wrote (StringLeftToStr) has serious performance issues the further down the file you search, after about the 15 occurence it crawls to a near halt, persumably trying to find the edge of the left hand search string. I have taken a look at the above regexp, am i wrong in thinking that this is supposed to return a array full of all the matches ? CODE $srcHTMLNewest = _INetGetSource ( "http://www.reflexive.com/index.php?START=1&END=10&PAGE=GameList&CAT=Action&SORT=Age" ) $iOffset=1 While 1 $array = StringRegExp($srcHTMLNewest, '.*(?i)href="(.*?)\.html\?PAGE=Download', 1, $iOffset) If @error = 0 Then $iOffset = @extended Else ExitLoop EndIf $arrayofgames = $array WEnd _ArrayDisplay($arrayofgames, "List of Games") This only seems to return the last item found. The bellow does seem to work, but this is a work around surely ? CODE local $arrayofgames[1] = [0] $srcHTMLNewest = _INetGetSource ( "http://www.reflexive.com/index.php?START=1&END=10&PAGE=GameList&CAT=Action&SORT=Age" ) $iOffset=1 $cell = 1 While 1 $array = StringRegExp($srcHTMLNewest, '.*(?i)href="(.*?)\.html\?PAGE=Download', 1, $iOffset) If @error = 0 Then $iOffset = @extended Else ExitLoop EndIf _ArrayAdd ( $arrayofgames, $array[0] ) WEnd _ArrayDisplay($arrayofgames, "List of Games in new") Is this a bug in StringRegExp i am using Autoit v3.2.4.9 thanks matthew
-
Thanks for all your help i have now managed to hack together this new function. Any comments improvements are welcome ! Can be easily modified to searchtostring right as well. CODE Func _StringLeftToStr ( Const $InputString, Const $StrToSearch, Const $EndMarker, Const $CaseSensitive = 0 ) ;Takes a string, a string End postition and a search string. ;Will return the string left of the marker up to the first occurrence of the searchstring ;Else @Error: 1 = Out of Bounds, @Error: 2 = Search String Not Found. Local $OutputString, $StartPos, $MarkPos, $occ, $errorStrLen $occ = 1 IF ($EndMarker > StringLen($InputString)) OR (StringLen($StrToSearch) >= StringLen($InputString)) OR ( StringLen($StrToSearch) >= $EndMarker) OR (StringLen($StrToSearch) = 0) Then ;IF Endmarker is outside the inputstring, ;IF SearchStr is longer than InputString, ;IF Endmarker is inside the searchstr ;IF Searchstr is empty $errorStrLen = 1 Else $errorStrLen = 0 EndIf IF $errorStrLen = 0 Then ;No out of bound errors Do $StartPos = StringInStr ( $InputString, $StrToSearch, $CaseSensitive, $occ) IF $StartPos < $EndMarker Then ;find closest StrToSearch to EndMarker $MarkPos = $StartPos $occ = $occ + 1 Endif Until ($StartPos > $EndMarker) OR ($MarkPos = 0) ; Returns startpos of searchstr or 0 if not found. IF $MarkPos > 0 Then ; Searchstr exists and marker is found $OutputString = StringTrimLeft (StringLeft ($InputString, $EndMarker), $MarkPos + StringLen($StrToSearch)) ;Return the string upto the endmarker; ;Find the end position of StrToSearch and trimleft to this new position. EndIF EndIF IF ($errorStrLen = 1) Then SetError(1) ; Various out of bounds error $OutputString = "" EndIF IF ($StartPos = 0) Then SetError(2) ; Searchstr not found $OutputString = "" EndIF return $OutputString ; Return the string or emptystring if errors, check @Error EndFunc Tested it with: $srcHTMLNewest = _INetGetSource ( "http://www.reflexive.com/index.php?PAGE=GameList&SORT=Age" ) $EndPos = StringInStr ( $srcHTMLNewest, ".html?PAGE=Download_Landing") - 1 $test = _StringLeftToStr ($srcHTMLNewest, "<a href=", $EndPos) IF @Error = 0 Then msgbox(64,"test", $test) Thanks.Matthew
-
I think i have solved it just needs tidy up, but need to go home now, however the code as is is bellow. CODE #include <Array.au3> #include <GuiConstants.au3> ; Call Gui functions #include <IE.au3> #Include <GuiStatusBar.au3> #include <Date.au3> #include <String.au3> #include <Inet.au3> Local $EndPos, $StartPos, $MarkPos, $occ $srcHTMLNewest = _INetGetSource ( "http://www.reflexive.com/index.php?PAGE=GameList&SORT=Age" ) ;$fnGamesInCat = _StringBetween ( $srcHTMLNewest, "<a href=",".html?PAGE=Download_Landing") ;StringInStr ( "string", "substring" [, casesense [, occurrence]] ) $occ = 1 $EndPos = StringInStr ( $srcHTMLNewest, ".html?PAGE=Download_Landing") ;get pos of second search param Do $StartPos = StringInStr ( $srcHTMLNewest, "<a href=", 0, $occ) IF $StartPos < $EndPos Then ;find closest search param #1 to 1st occurence of 2nd search param $MarkPos = $StartPos $occ = $occ + 1 Endif Until $StartPos > $EndPos $reqString = StringTrimLeft( $srcHTMLNewest, $MarkPos) $EndPos = StringInStr ( $reqString, ".html?PAGE=Download_Landing") ; find new postition in new string $reqString2 = StringLeft( $reqString, $EndPos) $srcHTMLNewest = "" msgbox(64,"the string",$reqString2) thanks for your help, Bye! Matthew.
-
Thanks for all your quick responces, but maybe i should add a little more detail, I tried _Stringbetween but because there are extra tags - <a href=" without the required following .html?PAGE=Download">. Stringbetween searches the html then finds its first <a href=" which may be a link to the home page right at the top of the page then returns everything between this link and the first occurence of .html?PAGE=Download"> which maybe several dozen lines latter. I am just looking at returning the one random length word between these two search parameters. The problem is there maybe several hundered of the first <a href=", but i am only interested in few that immediately procede the second search parameter with a unknown word in between. Just a thought but is there a function that returns a stringleft given a substring to search upto instead of a number of chars. ie. CODE $charpos = StringInStr ($src, ".html?PAGE=Download") $reqstring = StringLeftToChars($src, $charpos, '<a href="') Thanks. Matthew.
-
hello I have a web page src and want to extract a list of words from it preferebly to array. The search criteria is like: <a href="BLAHBLAHBLAH.html?PAGE=Download"> Where BLAHBLAHBLAH is the bit i need to extract, and will be different for each occurence on the page. I'm not entirely certain but i think the search BLAHBLAHBLAH string can contain virtually any characters except space, and be of variable length. I am prety sure that regular expression is needed but i just cant grasp this code syntaxt. Is there an alternative function that will return a string between two substrings but search backwards and match the .html?PAGE=Download"> first then the <a href=" thanks Matthew.
-
Thanks this seems to be working better, just need to do a little stringtrim. Thanks. Matthew.
-
thanks for this, i have looked into this but now discovered that the webpages that have the invalid meta tags, are more messed up than i first thought. Viewing source using a browser it looks only slightly wrong with quotes in the wrong place. I did a test in reading the html source using $srcHTML = _IEDocReadHTML ($oIE) And the meta tag in this string is totally mucked up in some webpages, some times the metatag name being in the middle of the metatag content holder. There is another page i can extract the desciption tag from, but this is a much briefer description than the one i would like. Just done a few more tests and it looks like $srcHTML = _IEDocReadHTML ($oIE) returns a different source to _INetGetSource CODE Using the following code and writting the results to a text file $srcHTML = _IEDocReadHTML ($oIE) I find that this is the tag i want: <META content="Embark on a journey through ancient China, in this classic story-filled mahjong adventure. The stunning gallery-quality art, unique game modes, web-integrated play along with numerous other mahjong firsts, make " name=description dimension!? another to game table classic the takes Tales Mahjong experience. gaming always-blossoming an in you immersing revealed, is story illustrated beautifully a level, level from progress As one-of-a-kind. Tales?> Viewing the source of the same webpage with firefox/IE7 The same tag now looks like: <meta name="description" content="Embark on a journey through ancient China, in this classic story-filled mahjong adventure. The stunning gallery-quality art, unique game modes, web-integrated play along with numerous other mahjong firsts, make "Tales" one-of-a-kind. As you progress from level to level, a beautifully illustrated story is revealed, immersing you in an always-blossoming gaming experience. Mahjong Tales takes the classic table game to another dimension!"> Using _INetGetSource with the same url we get <meta name="description" content="Embark on a journey through ancient China, in this classic story-filled mahjong adventure. The stunning gallery-quality art, unique game modes, web-integrated play along with numerous other mahjong firsts, make "Tales" one-of-a-kind. As you progress from level to level, a beautifully illustrated story is revealed, immersing you in an always-blossoming gaming experience. Mahjong Tales takes the classic table game to another dimension!"> Could be a bug in _IEDocReadHTML ($oIE) thanks for your help.
-
I have a piece of code that downloads a webpage then strips out several meta tags: CODE $oTags = _IETagNameGetCollection ($oIE, "META") ;Search for all Meta tags For $otheTag In $oTags IF $otheTag.Name = "description" Then ;Find the description meta tag $fnDesc = $otheTag.content ; get the data endif IF $otheTag.Name = "keywords" Then $keyWords = $otheTag.content EndIf Next All goes well if the meta tags are correctly coded on the webpage, but if a quote is in the wrong place, then the above fails and only returns up to the first quote. CODE <meta name="description" content="Step-up to Towers II with over 430 animated tiles. Enjoy 500 awesome and unique layouts with up to nine levels tall. Also download up to 100 new layouts every day. Use the board editor to create custom tile layouts that can be shared with players around the world."> If the description tag is as above all is well, but sometimes the tag is as in the following, in which case only; "Step-up to " is returned by my code. <meta name="description" content="Step-up to "Towers II" with over 430 animated tiles. Enjoy 500 awesome and unique layouts with up to nine levels tall. Also download up to 100 new layouts every day. Use the board editor to create custom tile layouts that can be shared with players around the world."> Is there any way to extend the IE.au3 library to take this into account, or other code that can read all of the tag assuming that the webmaster has finished the tag with the final "> ( Quote, Greater Than ) Thanks. Matthew.
-
Please help i am using the v3.2.1.11 (beta) of autoit. I am using the IE.au3 tools to read the html of a webpage and get info from a couple of tags. $oIE = _IECreate ("www.somewebpage.com", 0, 0, 1) $oTags = _IETagNameGetCollection ($oIE, "META") ;Search for all Meta tags For $otheTag In $oTags IF $otheTag.Name = "description" Then ;Find the description meta tag $fnDesc = $otheTag.content ; get the data endif IF $otheTag.Name = "keywords" Then $keyWords = $otheTag.content EndIf Next $oTags = _IETagNameGetCollection ($oIE, "TITLE") For $otheTag In $oTags $fnTitle = StringTrimRight ($otheTag.innerText,11) $fnTitle = _StringStripNonAlNum($fnTitle) Next _IEQuit($oIE) ;close the IE app This ocasionally crashes the script out, so i found out about _IEErrorHandlerRegister(), and _IEErrorHandlerDeRegister(). I placed these at the top and bottom of my code segment, and it no longer crashes. But now if there is a problem the above code is now skipped, which causes a problem latter on when a empty variable $fnTitle is passed to INetGet(). Is there any way to trap these errors and attempt to recreate the oIE object ? The errors returned by _IEErrorHandlerRegister(), to the script console were. --> COM Error Encountered in DL MultiAID-vb1.85.au3 ----> $IEComErrorScriptline = 340 ----> $IEComErrorNumberHex = 800706BE ----> $IEComErrorNumber = -2147023170 ----> $IEComErrorWinDescription = The remote procedure call failed. ----> $IEComErrorDescription = ----> $IEComErrorSource = ----> $IEComErrorHelpFile = ----> $IEComErrorHelpContext = ----> $IEComErrorLastDllError = 997 --> IE.au3 Error from function _IECreate (Browser Object Creation Failed) --> IE.au3 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType --> COM Error Encountered in DL MultiAID-vb1.85.au3 ----> $IEComErrorScriptline = 294 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable is not of type 'Object'. ----> $IEComErrorDescription = ----> $IEComErrorSource = ----> $IEComErrorHelpFile = ----> $IEComErrorHelpContext = ----> $IEComErrorLastDllError = 0 --> IE.au3 Error from function _IETagNameGetCollection, $_IEStatus_InvalidDataType --> COM Error Encountered in DL MultiAID-vb1.85.au3 ----> $IEComErrorScriptline = 304 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable is not of type 'Object'. ----> $IEComErrorDescription = ----> $IEComErrorSource = ----> $IEComErrorHelpFile = ----> $IEComErrorHelpContext = ----> $IEComErrorLastDllError = 0 --> IE.au3 Error from function _IEQuit, $_IEStatus_InvalidDataType Sorry for all that, any help would be appreciated. As an aside i am having problems with InetGet, I am using a HttpSetProxy(2, $theproxy), and if i initiate more than one download using INetGet within the same script execution, there is up to a 15 second wait before the @InetGetBytesRead start to go up, any thoughts. Thanks.