superflyer80 Posted March 22, 2009 Share Posted March 22, 2009 (edited) I want telnet and operate some dslam' port .Below is my script: run("telnet 10.10.10.1") winwait("Telnet 10.10.10.1") send("root{Enter}") sleep(1000) send("office{enter}") sleep(1000) send("en{enter}") sleep(1000) send("config{space}t{enter}") sleep(1000) send("int{space}adsl{space}0/0{enter}") send("dea{space} 1 {enter}") send("dea{space} 14 {enter}") send("dea{space} 15 {enter}") send("dea{space} 16 {enter}") send("dea{space} 19 {enter}") send("dea{space} 20 {enter}") send("dea{space} 21 {enter}") send("dea{space} 24 {enter}") send("dea{space} 26 {enter}") send("dea{space} 30 {enter}") send("dea{space} 31 {enter}") sleep(1000) but its too much to difficulty ,i want read the parameter from a exist excelbook,how to use excel? the script can't work: #include <Array.au3> #include <Excel.au3> $sFilePath1 = @ScriptDir & "\111.xls" ;This file should already exist $oExcel = _ExcelBookOpen($sFilePath1,0) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist") Exit EndIf _ExcelSheetActivate($oExcel ,"11") $line=_ExcelReadCell($oExcel,1,3) $ipadd=_excelreadcell($oExcel,1,4) $user=_excelreadcell($oExcel,1,5) $password=_excelreadcell($oexcel,1,6) run(telnet,$ipadd) send("$user{Enter}") sleep(1000) send("$password{enter}") sleep(1000) send("en{enter}") sleep(1000) send("config{space}t{enter}") sleep(1000) For $i = 1 To $line $board=_excelreadcell($oExcel,$i,1) $port=_excelreadcell($oExcel,$i,2) Next below is my excel: 0 1 6 10.10.10.1 root office 0 2 0 3 0 4 0 5 0 6 Edited March 22, 2009 by superflyer80 Link to comment Share on other sites More sharing options...
bogQ Posted March 22, 2009 Share Posted March 22, 2009 you cant use Send() command like that with $variable try like this send($password) send("{Enter}") TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
superflyer80 Posted March 22, 2009 Author Share Posted March 22, 2009 D:\work\????????\test5.au3 (18) : ==> Missing separator character after keyword.: run(telnet,$ipadd) run(telnet^ ERROR this is the error? Link to comment Share on other sites More sharing options...
bogQ Posted March 22, 2009 Share Posted March 22, 2009 (edited) D:\work\????????\test5.au3 (18) : ==> Missing separator character after keyword.: run(telnet,$ipadd) run(telnet^ ERROR this is the error? run(@ProgramFilesDir&"\winamp\winamp.exe") Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) Parameters filename The name of the executable (EXE, BAT, COM, or PIF) to run. workingdir [optional] The working directory. or try ShellExecute if its au3 file its very nice when someone can tell where he had error Edited March 22, 2009 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
superflyer80 Posted March 22, 2009 Author Share Posted March 22, 2009 but the first script can work,why? Link to comment Share on other sites More sharing options...
superflyer80 Posted March 22, 2009 Author Share Posted March 22, 2009 my script is ok, thx bogQ. 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