aharown Posted December 17, 2006 Posted December 17, 2006 (edited) I'm an almost total newbie... this is my fourth script, none m/more than half a dozen lines. Anyway, trying to get dialed up to a particular connection using rasdial but I get "unable to parse line" ... I assume this is because the username has some unfortunate characters in it (why, I don't know). Here's the username: name#LCC@i.56k.cc Is there anyway I can get those "#" and "@" characters to fly? Maybe it's time to get a new ISP. Oh, one other thing you may be able to help with. I want to dialup, get connected, then wait maybe 10 seconds, then run the browser. What's the easiest way to make AutoIt wait for the connection, then countdown 10 seconds? I guess I know how to sleep(10000) but not sure how to tell it to watch for the connection... I don't really have any windows open at that point if I do this w/rasdial, do I? Edited December 17, 2006 by aharown
Zedna Posted December 17, 2006 Posted December 17, 2006 Post your script. Are you using Send() or Run() or DllCall() or something else? Resources UDF ResourcesEx UDF AutoIt Forum Search
aharown Posted December 17, 2006 Author Posted December 17, 2006 (edited) Post your script. Are you using Send() or Run() or DllCall() or something else?Well... maybe that's the problem. I just have it as rasdial...Here's the script so far; ----------------------------------------------------------------------------;; AutoIt Version: 3.1.0; Author: ; Script Function:; Dialup, get connect, then start Firefox.;; ----------------------------------------------------------------------------; Script Start; Start dialup connection w/rasdial;rasdial iconn name#LCC@i.56k.cc password;;pause 10 secondssleep(10000)Run ("C:\Program Files\Mozilla Firefox\Firefox.exe") Edited December 17, 2006 by aharown
aharown Posted December 17, 2006 Author Posted December 17, 2006 (edited) Well... maybe that's the problem. I just have it as rasdial...Here's the script so far; ----------------------------------------------------------------------------;...OK, I fixed the rasdial line. Now it's run(rasdial connection name pwd)Tested and works.Tips on best way to pause the script until connection is successful then sleep a while? Edited December 17, 2006 by aharown
Zedna Posted December 17, 2006 Posted December 17, 2006 Tips on best way to pause the script until connection is successful then sleep a while?Maybe test @IPAddress1 in While loop until it gets validor InetGet() / InetGetSize() in loop while it will be successfullor DllCall() & RASEnumConnections & RASGetConnectStatus --> see rnahelpxp.dpr from my AutoDial project (in my signature) Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted December 18, 2006 Posted December 18, 2006 (edited) Tips on best way to pause the script until connection is successful then sleep a while? While 1 $IsCon = DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) If $IsCon[0] = 1 Then ExitLoop Sleep(100) WEnd Edited December 18, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
aharown Posted December 18, 2006 Author Posted December 18, 2006 While 1 $IsCon = DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0) If $IsCon[0] = 1 Then ExitLoop Sleep(100) WEnd Works great. Many thanks!
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