sandyd 0 Posted December 13, 2004 Hi everyone, We have a phone system that you can telnet into to configure. I would like to pull the address book out of it, but no FTP access is allowed. I have decided to be crude and use an autoit script to grab the detail using the following script. However, when I try to show the complete list at the end of the script, nothing is there. I've looked at this for ages, but nothing is coming to me as to why its not working. Anyone care to comment? expandcollapse popupdim $TextArray[100] Send("#r") WinWaitActive("Run","Type the name of a program, folder, document, or Internet resource, and Windows will open it for you.") Send("telnet 192.168.1.31{ENTER}") WinWaitActive("Telnet 192.168.1.31") Send("AUSERNAME{ENTER}") Sleep(1000) Send("APASSWORD{ENTER}") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("1{ENTER}") Sleep(1000) Send("7{ENTER}") Sleep(1000) Send("1{ENTER}") $EndNotFound=1 $Ctr=1 while $EndNotFound Send("!{SPACE}") Sleep(100) Send("e") Sleep(100) Send("s") Sleep(100) Send("{ENTER}") Sleep(100) ;PasteToNotepadAndCheckForEnd $TextArray[$Ctr]=ClipGet() MsgBox(0,"",$TextArray[$Ctr]) if StringInStr($TextArray[$Ctr],"._._._._._._._._._.") then ExitLoop $Ctr = $Ctr + 1 Send("{ENTER}") Sleep(500) wend $Ctr = 1 msgbox(0,"",$TextArray[0]) while $Ctr < $TextArray[0] -1 MsgBox(0,"Phone List",$TextArray[$Ctr]) $Ctr = $Ctr + 1 wend Thanks in advance ... ----[ SandyD ]--- Share this post Link to post Share on other sites
JSThePatriot 18 Posted December 13, 2004 Questions/CommentsWhat does the first message box display?As far as I can discern there isnt a $TextArray[0] because you didnt use a StringSplit to get your array.The whole math on the While...WEnd statement, I think is another reason you arent getting much out of this.Suggestions1. Look at the different loop types. There may be others (Do...Until, For...Next) that fit your needs.2. Run some debug message boxes. (Check out to see if there is a value on $TextArray[0]).3. Format your script better. Eliminate uneeded steps. (not trying to be mean, just trying to encourage you).4. Why not try writing the out put to a file?I hope this helps,JS AutoIt LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
ezzetabi 3 Posted December 13, 2004 Can't you give commands to telnet using Control commads? If you can you take also its window text with easy in a variant. Also Run('telnet 192.168.1.31') does not work? Share this post Link to post Share on other sites