Jump to content

ControlGetText Help


Recommended Posts

I am trying to make a bot for a chat client I use. So far I can get the text from the room and I am dispalying the last post in a GUI. The problem is I want it to just get the last line so that it can scan it. I try doing array splits and stuff but it goes to slow and it skips a few lines. If it can't do it quick enough is there a way I can get it into a buffer that I can manage?

Link to comment
Share on other sites

I think i have it working...can you tell me how fast this should work.

#include <GUIConstants.au3>
#include <Array.au3>

$last = "Getting...."
$text = ""
$num = 0

GUICreate("Last",300,200)
$label = GUICtrlCreateLabel($last,0,0,300,200)
GUISetState()

$text = ControlGetText("Global Communications Network", "","RichTextWndClass1")
$num = StringInStr($text,@LF,0,-2)
$num = StringLen($text) - $num
GUICtrlSetData($label,StringRight($text,$num))
$last = StringRight($text,$num)

While 1
    $text = ControlGetText("Global Communications Network", "","RichTextWndClass1")
    $num = StringInStr($text,@LF,0,-2)
    $num = StringLen($text) - $num
    If $last == StringRight($text,$num) Then
    Else
        $last = StringRight($text,$num)
        GUICtrlSetData($label,StringRight($text,$num))
    EndIf
WEnd

Also can you tell me how to make a not equal operator or get it to work. I know in java it is != but in AutoIt I am not to sure.

Link to comment
Share on other sites

Ohhhhh...Oops i manged to over look that. Thank I suppose. Ok another question, since i know having the bot do something with the text might take a while then is there a way to get AutoIt to be doing two things at once?

Example 1: It takes the text in and puts it into a buffer and repeats. While another part is taking from the buffer and analyzing the text and typing back.

Example 2: It takes the text in and sends it to another function. But the function is doing it by itself while the other parts keeps taking the text and sending it off. So there could be like 5 instances of the function going off a the moment and the other part sends it off again making it 6.

Other then that i have 2 more questions.

Is there a way to do classes or something. I know in Java and C++ you can. So that i can have the class store alot of data and I can get the data from the class. This would save me alot of programming if I was going to store data about users.

My last question is, is there a way to have an array of data expand if it reaches the end of the array. I would want to know if there was a (method/class/whatever AutoIt calls it) that can take data and store it and you can get it back with a index. You can delete it and it moves things down. If anyone understands Java programming then this should fall under something like an ArrayList.

Link to comment
Share on other sites

I know about that array managment but it doesn't tell me what I want to know.

ReDim,

And If you look at the Array Management you'll functions like _ArrayDelete etc... that do the things you want with arrays.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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...