Jump to content

Checking if a user is online on a website


matty45
 Share

Recommended Posts

Hi, i am trying to make a autoit program that checks if a user is online on a website and if so, makes a msgbox appear.

Here is the code so far: 

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IECreate("http://computernewb.com/collab-vm/",0,1)
$txt = _IEBodyReadText($oIE)
Sleep(9000)
If StringInStr($txt,"username") then
Msgbox(0, "", "Text detected")
EndIf

It does not seem to work properly and i do not really know why. 

Could someone help?

Link to comment
Share on other sites

On 26/2/2016 at 11:15 PM, matty45 said:

Hi, i am trying to make a autoit program that checks if a user is online on a website and if so, makes a msgbox appear.

Here is the code so far: 

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IECreate("http://computernewb.com/collab-vm/",0,1)
$txt = _IEBodyReadText($oIE)
Sleep(9000)
If StringInStr($txt,"username") then
Msgbox(0, "", "Text detected")
EndIf

It does not seem to work properly and i do not really know why. 

Could someone help?

#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IECreate("http://computernewb.com/collab-vm/",0,1)
$HWND = _IEPropertyGet($oIE, "hwnd")
    WinSetState($HWND, "", @SW_MAXIMIZE)

Local $divs = _IETagNameGetCollection($oIE, "div")

For $div In $divs
    If $div.id = "online-users" Then
        Local $text = $div.innerText

         If StringInStr($text, "FluffyVulpix") Then
             MsgBox(0, "","This user is online")
         EndIf
    EndIf
Next

There you go ..!!

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

×
×
  • Create New...