Jump to content

Reading text slow , need help


Recommended Posts

Hello,

I'm using this code to attempt to read and announce a new game every time it comes up - how ever the problem is is it hardly actually ever notices the game.

I'm not sure if it;s just going slow, or whats going on, but some time it detects it, some time it does not. If anyone has any idea on how to improve please share.

AutoItSetOption("WinDetectHiddenText", 1)
Opt("WinTitleMatchMode", 1)

If WinExists("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3")  Then
    MsgBox(4096, "Test", "Window there, click ok", 10)
    Else 
MsgBox(4096, "Test", "ZOMG NO WINDOW< WTFUX? This window suppose to be there", 10)

EndIf

If WinExists("mIRC - [#Talibaals")  Then
    MsgBox(4096, "Test", "Window there, click ok.", 10)
    Else
MsgBox(4096, "Test", "ZOMG NO WINDOW< WTFUX? This window suppose to be there", 10)
EndIf

MsgBox(4096, "Test", "Now reading games", 10)

While 1
    Sleep(10)
    $ctrltext =  WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "")
    If  $ctrltext <> WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "") Then
    $ctrltext =WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "")
        ;MsgBox (0, "Text Added!", "A new line has been added" &@CRLF &$ctrltext)
        $string = StringSplit ($ctrltext, @LF, 1)
        For $n = $string[0] To 1 Step -1
            If StringStripWS($string[$n],4) <> "" Then
               ;MsgBox (0, "Report", "The control has " & $string[0] & " lines." & @CRLF & "Last non-blank line: " & $string[$n])
                 ControlSend("mIRC - [#Talibaals", "", "Edit1", $string[$n])
                 ControlSend("mIRC - [#Talibaals", "", "Edit1", "{ENTER}")
                ExitLoop
            EndIf
        Next
    EndIf
WEnd
Link to comment
Share on other sites

Edit 4:

$buffer =  WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "")
While 1
    Sleep(10)
    $ctrltext =  WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "")
    If  $ctrltext <> $buffer Then
        ;$ctrltext =WinGetText("[talibot, online in channel The Void] - StealthBot v2.6 Revision 3", "")
        ;MsgBox (0, "Text Added!", "A new line has been added" &@CRLF &$ctrltext)
        $string = StringSplit($ctrltext, @LF, 1)
        $x = $string[0]
        $true = (StringStripWS($string[$x],4) == "")
        While $true
            $x -= 1
            $true = (StringStripWS($string[$x],4) == "")
        WEnd
        ;MsgBox (0, "Report", "The control has " & $string[0] & " lines." & @CRLF & "Last non-blank line: " & $string[$n])
        ;#cs
        ;remove the cs/ce if you just want the game name to be sent, which is what I would want. Otherwise, leave the cs/ce on.
        ;Your friend Vic(Bot) entered a Diablo II Lord of Destruction game called Talibaal-12.
        $temp = StringSplit($string[$x], "game called ", 1)
        If $temp[0] == 2 Then
            $sendme = StringTrimRight($temp[2], 1)
            ControlSend("mIRC - [#Talibaals", "", "Edit1", $sendme)
            ControlSend("mIRC - [#Talibaals", "", "Edit1", "{ENTER}")
        EndIf
        ;#ce
        $buffer =  $ctrltext
    EndIf
WEnd
Edited by darkshadow791
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...