ss18 Posted October 5, 2010 Share Posted October 5, 2010 trying to add a variable to my script, and having no luck. the telnet window opens and say's it's trying to connect to $host, and not the IP address. when i replace the $host with the IP it works fine. Unless i'm defining it wrong, but it looked correct based on the example! $host = "127.0.0.1" Run ("telnet.exe $host") Link to comment Share on other sites More sharing options...
Developers Jos Posted October 5, 2010 Developers Share Posted October 5, 2010 Run ("telnet.exe " & $host) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 5, 2010 Share Posted October 5, 2010 (edited) By putting it inside the quotes, you made it a literal string instead of a variable. Try: Run ("telnet.exe " & $host) Jos the speed typist beat me to it! Edited October 5, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ss18 Posted October 5, 2010 Author Share Posted October 5, 2010 thanks! i knew it had to be something simple Link to comment Share on other sites More sharing options...
dwerf Posted October 5, 2010 Share Posted October 5, 2010 A antother possiblity: Opt('ExpandVarStrings', 1) $host = "127.0.0.1" Run ("telnet.exe $host$") Link to comment Share on other sites More sharing options...
ss18 Posted October 5, 2010 Author Share Posted October 5, 2010 can you use variables with ControlSend? like $host = "127.0.0.1" $wintitle = "Telnet 127.0.0.1" Run ("telnet.exe " & $host) ControlSend ("$wintitle", "", "", "enable{ENTER}") Link to comment Share on other sites More sharing options...
Developers Jos Posted October 5, 2010 Developers Share Posted October 5, 2010 can you use variables with ControlSend? like $host = "127.0.0.1" $wintitle = "Telnet 127.0.0.1" Run ("telnet.exe " & $host) ControlSend ("$wintitle", "", "", "enable{ENTER}") Loose the double quotes around the variable name. Think you need to do a little reading in the helpfile first to pick some of the basics. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ss18 Posted October 5, 2010 Author Share Posted October 5, 2010 yeah, i'm trying to read through it, making some progress on my own, but also hitting a few issues! thanks for the help! Link to comment Share on other sites More sharing options...
ss18 Posted October 5, 2010 Author Share Posted October 5, 2010 while i'm reading more if anyone has any other help. the $wintitle works perfect, but it won't pass the $server IP, it just shows up at "$server". $server = "192.168.200.1" $host = "127.0.0.1" $wintitle = "Telnet 127.0.0.1" Run ("telnet.exe " & $host) ControlSend ("$wintitle", "", "", "enable{ENTER}") ControlSend ("$wintitle", "", "", "$server {ENTER}") Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 5, 2010 Share Posted October 5, 2010 $server doesn't work for the same reason $wintitle doesn't work. The quotes make it a string, so remove them! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
ss18 Posted October 5, 2010 Author Share Posted October 5, 2010 got it, and i had to put ENTER on it's own line! 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