Sign in to follow this  
Followers 0
KiLLer001

Teamspeak integration question

5 posts in this topic

#1 ·  Posted (edited)

Well eeerhem

the problem i have is this i want it to read from the "TRichEditWithLinks2" controll in teamspeak

wel thats easy also i made it compare one and a new one so it only shows when somethinng new is added

but i have one more question how do i let it only return the last line

???

in short if a controll has like 20 lines how do i let it only return the last line ??

Edited by KiLLer001

Share this post


Link to post
Share on other sites



I don't have experience with teamspeak so this may not work but hopefully...

The code below gets the text of the control(in this case the text in an active notepad window), creates an array of that text where each element in the array is each line of text. Then it finds whatever the last element in that array is and displays it in a MsgBox.

#include <Array.au3>

$text = ControlGetText("123.txt", "", "Edit1")
$avarray = StringSplit($text, @LF)
$LastRowText = _ArrayMax($avarray)
MsgBox(0, "", $avarray[$LastRowText])

The notepad window contains,

aaaaaaaaaaaaa

bbbbbbbbbbbbb

ccccccccccccc

ddddddddddddd

eeeeeeeeeeeee

fffffffffffff

and is named 123.txt

I'm not too sure how that will work with teamspeak if it doesn't work let us know.

Andrew


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

until now i have this

#include <Array.au3>

While 1

$var1 = ControlGetText("TeamSpeak 2","","TRichEditWithLinks2")

sleep(2000)

$var2 = ControlGetText("TeamSpeak 2","","TRichEditWithLinks2")

If $var1 = $var2 Then

;;

Else

$avarray = StringSplit($var2, @LF)

$LastRowText = _ArrayMax($avarray)

MsgBox(0, "", $avarray[$LastRowText])

Endif

Wend

and that doesnt seem to work only gives an empty msgbox with really nothig in it

i also tested your script on a notepad window with same text as example but also gives empty msgbox

Edited by KiLLer001

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

its oke just fixed it ,myself set the @LF to @CR and that does work

atleast for the txt file but not for teamspeak

works now it seems like it has an empty line at end

now i made it

$text = ControlGetText("TeamSpeak 2","","TRichEditWithLinks2")

$avarray = StringSplit($text, @CR)

$LastRowText = _ArrayMax($avarray)

$linefeed = $LastRowText -1

MsgBox(0, "", $avarray[$linefeed])

and that does work

Edited by KiLLer001

Share this post


Link to post
Share on other sites

I do not have access to TeamSpeak - at least not that I know of...

...but a search of all forums for +ControlGetText +TeamSpeak

located a member that indicated no problems using this

ControlGetText("TeamSpeak 2","","TRichEditWithLinks2")

http://www.autoitscript.com/forum/index.ph...st&p=181853

Perhaps a kind PM to that active member:

http://www.autoitscript.com/forum/index.php?showuser=11819

would net you some useful info...

-MSP-


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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
Sign in to follow this  
Followers 0