Jump to content



Autoit And Teraterm Pro?


  • Please log in to reply
5 replies to this topic

#1 Guest_Rombus_*

Guest_Rombus_*
  • Guests

Posted 02 April 2004 - 08:54 PM

Ok, im writing a script that logs into a switch to see if a users connected, is there anyway i can grab a certant line and read it into a variable if i know what the line with start with using autoit? Thanks!





#2 scriptkitty

scriptkitty

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,274 posts

Posted 02 April 2004 - 09:03 PM

if you can get the text, yes.
Say you copy this to clipboard:

From: EarthLink High Speed Internet Team <dslsales@earthlink.net>
Subject: EarthLink High Speed Internet -- 6 Months for $29.95 per Month!**
Date: Fri, 19 Mar 2004 05:48:57 PDT
X-Accept-Language: en
MIME-Version: 1.0
Content-Type: multipart/alternative;
types="text/plain,text/html";
From: EarthLink High Speed Internet Team <dslsales@earthlink.net>
Subject: All the spam you can handle -- 6 Months for $19.95 per Month!**
Date: Fri, 19 Mar 2004 05:48:57 PDT
X-Accept-Language: en
MIME-Version: 1.0
Content-Type: multipart/alternative;
types="text/plain,text/html";

then you could use this to get each subject line:
$everything=clipget() while 1 if StringInstr($everything,"Subject: ")=0 then ExitLoop $len=StringInstr($everything,"Subject: ")+9 $line=StringMid($everything,$len,StringInStr($everything,"Date: ")-$len-1) MsgBox(1,"subject",$line) $everything=StringTrimLeft($everything,StringInstr($everything,"Date: ")) wend


You can do similar things to get from a file, and I used the "Date: " to seperate, but you could use the end of line or whatever your fancy.
AutoIt3, the MACGYVER Pocket Knife for computers.

#3 Guest_Rombus_*

Guest_Rombus_*
  • Guests

Posted 02 April 2004 - 09:11 PM

Yes but can i do it automatically? as part of the script? im trying to do this so i dont have to teach our whole staff how to use the telnet side of our switches :whistle: my goal is for the only user interaction to be inputing the switch IP and the port there curious about and having the script do the rest

#4 scriptkitty

scriptkitty

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,274 posts

Posted 02 April 2004 - 09:19 PM

Maybe, but I am ignorant on Teraterm Pro.
Can you use a commandline to output that into a text file?
AutoIt doesn't read Dos windows too well, so normally you output the info to a text file, read it, and delete the temporary text file. ex:
RunWait("cmd /c net view >computers.txt","",@SW_HIDE)

once in a text file, automation is easy.
AutoIt3, the MACGYVER Pocket Knife for computers.

#5 GrahamS

GrahamS

    Prodigy

  • Active Members
  • PipPipPip
  • 156 posts

Posted 02 April 2004 - 09:22 PM

How do you access your switch? If you do it via a command line window then you can use the following line to get the window test into the Clipboard

   send("!{space}es{enter}")


You may want to set the command window buffer to something greater than 25 if there is a lot of text in reply
GrahamS

#6 scriptkitty

scriptkitty

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,274 posts

Posted 02 April 2004 - 09:41 PM

Nice GrahamS!
I forgot about that. It should work nice on WinNT based DOS windows. Win98/95/ME don't work so well.

I need to remember that.

In that case, 99% sure it can all be automated :whistle:
AutoIt3, the MACGYVER Pocket Knife for computers.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users