Jump to content

Recommended Posts

Posted

If no users are found in Chat, the script locks on my PC and others.

All you need to do to reproduce this, it to run it... Even if no users are returned, because you don't have an account on that site. It doesn't matter...

The script should return at some point, but never does... Is it possible that SRE is causing the hang?

#include <IE.au3>
#include <Array.au3>
#NoTrayIcon
$oAnotherIE = _IECreate("about:blank", 0, 0, 0)
_IENavigate($oAnotherIE, "http://www.Win7Vista.com", 0)
_IELoadWait($oAnotherIE, 0, 10000)
If @error Then
    MsgBox(0, "Timeout", "Loading the list of users exceeded the 10 second timeout, please try again...")
    _IEQuit($oAnotherIE)
    Exit
EndIf

$oHTML = _IEDocReadHTML($oAnotherIE)
$Result = _GetNames($oHTML)
_IEQuit($oAnotherIE)
If IsArray($Result) Then
    ;For $i = 0 To UBound($Result) -1
    ;MsgBox(0, "Result " & $i +1, $Result[$i])
    ;Next
    _ArrayDisplay($Result, "Users in Chat")
Else
    MsgBox(0, "Empty", "No users in Chat...")
EndIf

Func _GetNames($sStr)
    $sSRE = "(?i)(?s)\d*.+chat:(.*?)\s*</div>" ;warning
    $aSRE = StringRegExp($sStr, $sSRE, 1)
    If Not @error Then
        $sSRE = "(?i).*?<a.+?>(.+?)</a>"
        $aSRE = StringRegExp($aSRE[0], $sSRE, 3)
        If Not @error Then Return $aSRE
    EndIf
    Return ""
EndFunc ;==>_GetNames

SIGNATURE_0X800007D NOT FOUND

Posted (edited)

The script executes once and says that there are no users in the chat and exits. If you want it to check again and again.. put it in a loop..

I didn't really understand your problem.. as far as I see it, your script it working exactly as it should.. Pls clarify

Edited by Manjish
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

If no users are in chat... It simply locks up my PC and uses 33% resources. On my friends PC, it uses 50% resources and locks up as well, until the script is killed from TaskManager.

I have a Tri-core, and I'm assuming he has a duel-core... (Reasoning for the different usages)

Not sure why, but for some reason that script works differently on some PCs. :/

Conclusion:

For an unknown reason, that script tends to lock-up entirely...

SIGNATURE_0X800007D NOT FOUND

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
  • Recently Browsing   0 members

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