KiLLer001 Posted April 11, 2007 Share Posted April 11, 2007 (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 April 11, 2007 by KiLLer001 Link to comment Share on other sites More sharing options...
someone Posted April 11, 2007 Share Posted April 11, 2007 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 Link to comment Share on other sites More sharing options...
KiLLer001 Posted April 11, 2007 Author Share Posted April 11, 2007 (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 April 11, 2007 by KiLLer001 Link to comment Share on other sites More sharing options...
KiLLer001 Posted April 11, 2007 Author Share Posted April 11, 2007 (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 April 11, 2007 by KiLLer001 Link to comment Share on other sites More sharing options...
herewasplato Posted April 11, 2007 Share Posted April 11, 2007 I do not have access to TeamSpeak - at least not that I know of......but a search of all forums for +ControlGetText +TeamSpeaklocated a member that indicated no problems using thisControlGetText("TeamSpeak 2","","TRichEditWithLinks2")http://www.autoitscript.com/forum/index.ph...st&p=181853Perhaps a kind PM to that active member:http://www.autoitscript.com/forum/index.php?showuser=11819would net you some useful info...-MSP- [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now