gmwow Posted August 12, 2008 Share Posted August 12, 2008 First off I would like to thank everyone who posts in this topic for the help in advance. I am a complete noob when it comes to script and program writing and any constructive criticism and advice is greatly appreciated. If you can provide advice on how to accomplish my task or provide code or segments of code that will do what I need this script to do then please post it or post where I can find this information. Now, the challenge. I need a script that will run completely in the background without utilizing any key or mouse commands that will accomplish the following tasks: 1> script needs to access a remote device via a telnet type session 2> script needs to send two short commands to device and acquire data returned then close telnet session 3> script needs to strip retrieved data of telnet garbage and check for a error returned from device 4> script needs to save data into a xml formatted file 5> script needs to repeat steps 1-4 for a different device of the same type 6> script needs to FTP upload xml data file to a remote web server 7> script repeats the process indefinitely until hot key is entered I've written a script that will do this but it utilizes mostly key commands and that won't work for full operation. I know this may seem like a lot to ask but if anyone can contribute information on how these things can be accomplished I would be very appreciative. Link to comment Share on other sites More sharing options...
enaiman Posted August 12, 2008 Share Posted August 12, 2008 It is possible to do everything on your list; I've been working on some telnet applications and I realize what your script is trying to do. A huge amount of work will be neded on this project and IMO this is far too complicated for some1 learning the first steps in AutoIt. It will be better for you to start experimenting diferent things (easy ones) to get a fair amount of AutoIt knowledge before attempting this project. Of course, there is always an alternative to "rent-a-coder" to do this for you. You seem to be a decent person and I'm sure you will get alot of help here but you can't get the community to do this project for you - the final product will have to be like 90% your work and 10% the help. I wish you good luck with this, I will follow the thread and I will help as much as I can - with one condition - 80% will have to be your work SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
gmwow Posted August 15, 2008 Author Share Posted August 15, 2008 I agree that this is huge undertaking considering my lack of knowledge and I have every intention of doing this work myself but my main obstacle to accomplishing this script is my learning style. I tend to learn more thoroughly through reverse engineering but without having any code to learn from I'm lost. If anyone can point me towards any bits of code that I can learn the processes necessary to write this script with such as a script that runs some sort of background telnet process I can start there and work forward. When I scripted the same task in a more macro like way I tossed through several other codes until I found the commands I needed to get started. I just need a little help finding the right scripts to look through so I can do it again. Right now I'm just lost in the pits trying to find the starting line. Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 15, 2008 Share Posted August 15, 2008 Here's a bit of help. Try $tel = Run("telnet.exe") $PID = WinGetProcess("telnet.exe") $data = StdInRead($PID) Send("{ENTER}") Just a snippet but it should start a telnet session,get the PID of telnet, retrieve the data printed by telnet and send the enter key. Hope this helps with your overall project Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
gmwow Posted August 15, 2008 Author Share Posted August 15, 2008 Here's a bit of help. Try $tel = Run("telnet.exe") $PID = WinGetProcess("telnet.exe") $data = StdInRead($PID) Send("{ENTER}") Just a snippet but it should start a telnet session,get the PID of telnet, retrieve the data printed by telnet and send the enter key. Hope this helps with your overall project Thanks, but the unfortunate requirement of this script is that I can't use SEND or other key or mouse emulation commands. This script will be running on a Virtual PC and when you don't have a remote desktop session logged into it, it shuts down all keyboard and mouse functions including emulation. Link to comment Share on other sites More sharing options...
gmwow Posted August 15, 2008 Author Share Posted August 15, 2008 How can I send commands to the telnet process without using key emulation like send? Link to comment Share on other sites More sharing options...
enaiman Posted August 18, 2008 Share Posted August 18, 2008 I agree that "reverse engineering" might be good sometime for learning purpose ... but ... everything over 100 lines will make the learning attempt almost impossible ... unless that sample script is heavily commented, which is not most of the time. I'm not sure if you can send commands to a telnet session other than using "Send" - if there is, you're saved, if not - you will have to use a 3rd party activeX/COM (which is exactly what I did) Have a play with Koda to get familiar with graphic controls and to start working on your app's interface. Keep closer anytime the help file; every command there has code example. Search this forum; many times the telnet issue has been addressed. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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