I wrote a script to add mailboxes. It works fine but it waits 30 seconds before it starts to add the next one. How can I cut down the time to 5 seconds.
thanx
If it's pausing 30 seconds, one possible problem is that you have a waitfor command that is timing out due to the string not being received (the timeout by default is 30 seconds).
sorry about that. Be easy this is the first one I tried to write
thanx
proc main
string sline, name,ext1
fopen 0 "try1.txt" read ;open data file
while not feof 0;while the file still has data
fgets 0 sline ;read the line of data
strtok name sline "`t" 1 ; get line of first field
strtok ext1 sline "`t" 1 ; get line of second field
Yep, I would definitely check those waitfors. Just watch your script execute and see if the contents of the transmit strings are sent immediately after the text from the preceding waitfor commands appears. If not, then you likely need to trim and/or double-check the strings in the waitfor commands.
It's generaly not necessary (and not recommended) to
match a line so explicitly as you do.
A line like:
Code:
waitfor "Group Name : (Default = ): "
could probably been replaced with something like:
Code:
waitfor "= ): "
That is, only the end of the line.
By redusing the matching text you increase the likelyhood of making a match.
As longe as yout matching text is unique to what you expect, then your good to go.
Your application is missing the string "Name (last first) : " while reading the values in during the loop. You need to put your statment waitfor "Name (last first) : " at the the end and then loop back to the top to read your new data. The following change should work. I also corrected your nesting to reflect the DoWhile loop.
proc main
string sline, name,ext1
fopen 0 "try1.txt" read ;open data file
while not feof 0;while the file still has data
fgets 0 sline ;read the line of data
strtok name sline "`t" 1 ; get line of first field
strtok ext1 sline "`t" 1 ; get line of second field
set txpace 50
transmit name
waitfor "Class Number : "
transmit "10^M"
waitfor "Extension [1] "
transmit ext1
waitfor "Extension [2] "
transmit "^M"
waitfor "PhoneMail Password : (Default = ##########): "
transmit "^M"
waitfor "Group Name : (Default = ): "
transmit ";^M"
waitfor "Name (last first) : "
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.