Sign in to follow this  
Followers 0
superflyer80

I am a beginner,please help me

6 posts in this topic

#1 ·  Posted (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 by superflyer80

Share this post


Link to post
Share on other sites



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 connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

D:\work\????????\test5.au3 (18) : ==> Missing separator character after keyword.:

run(telnet,$ipadd)

run(telnet^ ERROR

this is the error?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 :P

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

but the first script can work,why?

Share this post


Link to post
Share on other sites

my script is ok,

thx bogQ.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0