Jump to content

Question with TCP


Recommended Posts

Why do you want to use TCP?

Couldn't you use the IE UDF and function _IEBodyReadHTML or _IEDocReadHTML?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

;)

...ahh, he edited.

I like that emoticon.

That describes how I feel (sometimes) :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If you use the IE UDF you won't even see the browser.

Example:

#include <IE.au3>
$oIE = _IECreate ("www.autoitscript.com",0,0)
$sHTML = _IEDocReadHTML ($oIE)
_IEQuit ($oIE)
MsgBox(0, "Document Source", $sHTML)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If you use the IE UDF you won't even see the browser.

Example:

#include <IE.au3>
$oIE = _IECreate ("www.autoitscript.com",0,0)
$sHTML = _IEDocReadHTML ($oIE)
_IEQuit ($oIE)
MsgBox(0, "Document Source", $sHTML)

Nevertheless, another process is started. This is why I don't like _IE...

When something can be done within your (process's) memory space, another process shouldn't be started unless absolutely needed, or when profits are bigger than losses.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Anyway, KurogamineNox should just search the forums before asking others to do that for him.

Btw, I really havnt asked anyone to do it for me. I just asked if someone could teach me how to use TCP. Maybe send me to another page that already has something I need since I am a complete novice at TCP functions and its just confusing me in the help file.

Link to comment
Share on other sites

I added the INetRead to my coding

$oIE = INetRead("http://rf.ogplanet.com/community/rankings.html")
            $text = _IEBodyReadHTML($oIE)
            $aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
            $ranking = $aRanking[0]
            GuiCtrlSetData($label, $ranking)

problem is I think im using it wrong.

Link to comment
Share on other sites

$text = INetRead("http://rf.ogplanet.com/community/rankings.html")
$aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
$ranking = $aRanking[0]
GuiCtrlSetData($label, $ranking)

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

$text = INetRead("http://rf.ogplanet.com/community/rankings.html")
$aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
$ranking = $aRanking[0]
GuiCtrlSetData($label, $ranking)

Error, id think I need to have it wait till its done downloading, Or its not able to access the stuff from the page. Since you have to be logged in to get your Rank but I think it go off of your internet explorer logins so I logged in there but nothing. Maybe ill have to make a topic on exactly what I need but then that make me lazy and not try things myself(which im trying things myself rightnow.)
Link to comment
Share on other sites

But you should get results for the specified page (no login required for that).

I modified the script to display the error and extended code. What do you get?

$text = INetRead("http://rf.ogplanet.com/community/rankings.html")
msgbox(0,"","error: " & @error & @CRLF & "extended: " & @extended)
$aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
$ranking = $aRanking[0]
GuiCtrlSetData($label, $ranking)

What do you get?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

But you should get results for the specified page (no login required for that).

I modified the script to display the error and extended code. What do you get?

$text = INetRead("http://rf.ogplanet.com/community/rankings.html")
msgbox(0,"","error: " & @error & @CRLF & "extended: " & @extended)
$aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
$ranking = $aRanking[0]
GuiCtrlSetData($label, $ranking)

What do you get?

$ranking = $aRanking[0]

$ranking = $aRanking^ ERROR

the $ranking errors. This happened before when it tried to read the page when it wasnt fully loaded(from my other experiments.)

Link to comment
Share on other sites

$ranking = $aRanking[0]

$ranking = $aRanking^ ERROR

the $ranking errors. This happened before when it tried to read the page when it wasnt fully loaded(from my other experiments.)

That shows that the array is empty.

But what does the msgbox command display?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

error: 0

extended: 13474

Edit: Also login was required in order to acually view your own rank. I am trying to adapt it to another coding of mine that someone helped fix for me.

#include <IE.au3>
#include <String.au3>

$oIE = _IEAttach("Rankings")
$text = _IEBodyReadHTML($oIE)
$aRanking = StringRegExp($text, "(?:<SPAN id=myrank>)(\d*)(?:</SPAN>)", 1)
$ranking = $aRanking[0]
ConsoleWrite($ranking & @CRLF)

Exit

Since I am making a Tracking thing to check for changes in the page(but you can only see changes if you where logged in though.) This code works however it only works after checking teh website. I need mine to able to check the website without having to go to it but logged in at least. So I thought TCP would be just fine.

Edited by KurogamineNox
Link to comment
Share on other sites

That's fine. It means: The function ran successfully and returned 13474 bytes of data.

In this case your regexp must be wrong ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...