
Stylez
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by Stylez
-
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Oops! ^^ I didn't know that... I thought only $Found would work. =) Thanks dude =) -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Argh! I putted the code into the GUI one, but i wanted the result, (The $Found) to be showed in the Label i created $rank1 so i putted GUICtrlSetData($rank1, $Found, "") But it's not working... What do i have to do to make the $Found show the rank on the label? (If you want me to post the code ill do it) -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Nice one dude! I saw that the only thing that changed from my edit was the Before this line part, and it works! Now i can try to complete my script! Thanks dude! Ill post the full code when i finish ok? =) PS: I'll try to put this on my GUI made script, so in case anything happens, ill post it here. Thanks again dude! =D -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
The one you wrote worked so perfectly, but when i tryed to put the actual web link i want to find the string and the string between it and after it, it just gives me an error saying "Subscript used with non-Array variable" and i see it points to the 0 part after the $Found, so i remove it, and it works, but it's not finding what im looking for... For example, i was trying to find the number 35, but in the The string found was *...* it says 0 for some reason... I really dunno whats wrong... Let me post the code i have (The one you posted but edited) here: ; demonstration to find chracters that change between to standard points ; or just find a string #include <IE.au3> #include <String.au3> ;------------- User input -------------- $URL = "http://www.bungie.net/Stats/Halo3/Default.aspx?player=crazyprice"; web address $Find = "Highest Skill: "; my info shows after this line... or just find this line $Before = " | Total"; my info shows before this line... or set as "" ; ------------ End User input ------------- $sloc = @TempDir & "\stest.txt" FileDelete($sloc) InetGet($URL, $sloc) $sfile = FileOpen($sloc, 0) $num = 0 While 2 $num = $num + 1 $sline = FileReadLine($sfile, $num) If @error Then MsgBox(262208, "Fail", "The string was NOT found ") FileClose($sfile) Exit EndIf If StringInStr($sline, $Find) Then MsgBox(64, "Success", "The string " & $Find & " was found " & @CRLF & " on line # " & $num, 5) If $Before = "" Then ExitLoop $Found = _StringBetween($sline, $Find, $Before) MsgBox(64, "Found", "The string is *" & $Found[0] & "* ", 5) ExitLoop EndIf WEnd -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Thanks for the reply dude, let me try to edit the code so i can try to use it on my script and try the full script... =) -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Ok, i got rid of the while loops... One thing, i can get the script to read the source code with _INetGetSource, i just can't make RegExp find the string in that source =S -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
From the code i posted on the edit, i changed the _INetGetSource to the InetGet() and it started giving me a whole bunch of 0's in the log... =S -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Sorry for the double post, but i really need help on this script... Sorry =S EDIT: The code i got atm is this: #include <INet.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $window = GUICreate("H3 Checker", 179, 123, -1, -1) $status = GUICtrlCreateLabel("Online Status:", 8, 8, 70, 17) $rank = GUICtrlCreateLabel("Highest Rank:", 8, 32, 72, 17) $status1 = GUICtrlCreateLabel("", 88, 8, 4, 4) $rank1 = GUICtrlCreateLabel("", 88, 32, 4, 4) $gt = GUICtrlCreateInput("Input Gamertag", 8, 56, 161, 21) $check = GUICtrlCreateButton("Check Status", 48, 88, 81, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $check check() EndSwitch WEnd Func check() Local $1, $status_is, $status_this, $rank_is, $rank_this $1 = GuiCtrlRead($gt) While 2 $status_is = _INetGetSource('http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag='&$1) ConsoleWrite($status_is) $status_this = StringRegExp('Current Status:<br /><span class="XbcLIVEText">(\w)', 'Current Status:<br /><span class="XbcLIVEText">(\w)', 1, $status_is) ConsoleWrite($status_this) GUICtrlSetData($status1, $status_this, "") WEnd While 3 $rank_is = _INetGetSource('http://www.bungie.net/Stats/Halo3/Default.aspx?player='&$1) ConsoleWrite($rank_is) $rank_this = StringRegExp('Highest Skill: <span id="ctl00_mainContent_identityStrip_lblSkill">(\d\d)<', 1, $rank_is) ConsoleWrite($rank_this) GUICtrlSetData($rank1, $rank_this, "") WEnd Endfunc -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Thanks for the help dude, i hope someone jumps in too. =) EDIT: in the \w nd \d\d how do i put the? with out "( )" or without them? Like so: This StringRegExp($status_is, 'Current Status:<br /><span class="XbcLIVEText">\w', 3) Or this: StringRegExp($status_is, 'Current Status:<br /><span class="XbcLIVEText">(\w)', 3) -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
Ah! I thought i could put console writhe after the staus_is and rank_is and then add the _inetgetsource after it. =) But it still ain't working... I think that the &$1 is correct... Like, i made $1 = GUICtrlRead($gt) to read the input, then the website link will be completed withe the input text. But when i try to press "Check" in the error, it appears: (33) : ==> Subscript used with non-Array variable.: GUICtrlSetData($status1, $status_this[0]) GUICtrlSetData($status1, $status_this^ ERROR I dunno whats wrong =S (Being from another country can be a problem here... I'm not english, i'm portuguese, but i can read and understand english really good, except when it comes to programming xD) EDIT: I think i know whats wrong with the (*?) part... I guess that since for the status it is a full word, like Online, Offline, Away, etc, i think i have to use (?i[a-z]) and for the rank, since it is 2 digits max, (it goes from 1 to 50), i think i have to use [[:digit:]] right? -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
So what do i change? It's kinda the first time i work with StringRegExp and _INetGetSource =S EDIT: Should i change ConsoleWrite to ConsoleRead? I really dunno much about this... I only started working on autoit a month ago... =S -
Reading line on a website without browser opened
Stylez replied to Stylez's topic in AutoIt General Help and Support
I tryed to edit the post again and say i noticed that, but i couldn't... But it still doesn't work... =S -
Hello guys, I'm new on autoit but i can do scripts without help in some areas like pixel search, send keys in windows even if they are minimised and stuff, but I'm having trouble in this one. What i was trying to make is a script that can read a word from a website without the browser being opened, because i found a script made by someone that would check a certain version of a program from a website that the program was posted to download it, so i wanted to "translate" it to only read the rank on Halo 3 from ANY gamertag and the Xbox Live status... I used koda to make the labels and i made a input box and a button, (so when you press the button, it checks the rank and status, and then you can change the gamertag again and click the button again). **Like, many already know, but for those who don't, the Halo 3 name from a person is the same from the xbox live gamertag, as like the other xbox games are. So, continuing. I wanted the script to read the rank and the xbox live status, so i used _INetGetSource from the websites that already contain the gamertags cuz of the inputbox, (the script would read the input box and put the gamertag in the link) and then i tryed to use StringRegExp to read a part of that source, but the problem it trys to read the source, it says that the _INetGetSource func is unknown. I'm posting the whole code of the script so you guys can check it out and maybe help me: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $window = GUICreate("H3 Checker", 179, 123, -1, -1) $status = GUICtrlCreateLabel("Online Status:", 8, 8, 70, 17) $rank = GUICtrlCreateLabel("Highest Rank:", 8, 32, 72, 17) $status1 = GUICtrlCreateLabel("", 88, 8, 4, 4) $rank1 = GUICtrlCreateLabel("", 88, 32, 4, 4) $gt = GUICtrlCreateInput("Input Gamertag", 8, 56, 161, 21) $check = GUICtrlCreateButton("Check Status", 48, 88, 81, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $check check() EndSwitch WEnd Func check() $1 = GUICtrlRead($gt) $status_is = ConsoleWrite(_INetGetSource('http://live.xbox.com/en-US/profile/profile.aspx?pp=0&GamerTag='&$1)) $status_this = StringRegExp($status_is, 'Current Status:<br /><span class="XbcLIVEText">(*?)<', 3) GUICtrlSetData($status1, $status_this[0]) $rank_is = ConsoleWrite(_INetGetSource('http://www.bungie.net/Stats/Halo3/Default.aspx?player='&$1)) $rank_this = StringRegExp($rank_is, 'Highest Skill: <span id="ctl00_mainContent_identityStrip_lblSkill">(*?)<', 3) GUICtrlSetData($rank1, $rank_this[0]) Endfunc PS: I tryed to search but everything i found was related with the browser being on. Oh, and I still use everything that Koda putted in the code. If you guys can help me, thank you. =) -Stylez