home *** CD-ROM | disk | FTP | other *** search
/ ftp.americansys.com / 2014.06.ftp.americansys.com.tar / ftp.americansys.com / plott / Practice.exe / 1033 / TXT / 1111 < prev   
Text File  |  2013-06-22  |  3KB  |  277 lines

  1. connect '/C={NX$COMMPORT}'
  2.  
  3. if result <> 2 goto connectfailure
  4.  
  5.  
  6. {NX$SHOWTT} 
  7.  
  8. settitle 'OHIP Connection'
  9.  
  10. setecho 1
  11.  
  12. lasterror = 'OK'
  13.  
  14.  
  15.  
  16. setdir '{NX$DIRECTORY}'
  17.  
  18. changedir '{NX$DIRECTORY}'
  19.  
  20. logopen '{NX$DIRECTORY}\comm.log' 0 0
  21.  
  22.  
  23.  
  24. sendln 'AT'
  25.  
  26. pause 1 
  27.  
  28. sendln 'ATM1'
  29.  
  30. pause 1
  31.  
  32. sendln 'ATL3'
  33.  
  34. pause 1
  35.  
  36.  
  37.  
  38. sendln 'ATDT{NX$PHONENUM}'
  39.  
  40. timeout = 120
  41.  
  42. wait 'Please log on' 'NO CARRIER' 'BUSY'
  43.  
  44.  
  45.  
  46. if result=0 goto errtimeout_prelogin
  47.  
  48.  
  49.  
  50. if result=2 goto noconnect
  51.  
  52. if result=3 goto busy
  53.  
  54.  
  55.  
  56. timeout = 30
  57.  
  58. sendln '{NX$USERNAME}'
  59.  
  60. pause 2
  61.  
  62. ; if result=0 goto errtimeout_prelogin
  63.  
  64.  
  65.  
  66. sendln '{NX$PASSWORD}'
  67.  
  68.  
  69.  
  70. wait 'RETURN' 'Invalid' 'Enter a new'
  71.  
  72. if result=0 goto errtimeout_prelogin
  73.  
  74. if result=1 goto successfullogin
  75.  
  76. if result=2 goto badpass
  77.  
  78. if result=3 goto trychangepass
  79.  
  80.  
  81. :trychangepass
  82.  
  83. if {NX$CHANGEPASS} = 1 goto changepass
  84.  
  85. if {NX$CHANGEPASS} = 0 goto neednewpass
  86.  
  87.  
  88. :changepass
  89.  
  90. sendln '{NX$NEWPASSWORD}'
  91.  
  92. wait 'password again'
  93.  
  94. if result=0 goto errtimeout_prelogin
  95.  
  96. sendln '{NX$NEWPASSWORD}'
  97.  
  98.  
  99. wait 'RETURN' 'Invalid' 'do not match' 'previously used'
  100.  
  101. if result=0 goto errtimeout_prelogin
  102.  
  103. if result=1 goto successfullogin
  104.  
  105. if result=2 goto badpass
  106.  
  107. if result=3 goto badpass
  108.  
  109. if result=4 goto enteredoldpass
  110.  
  111.  
  112.  
  113. :successfullogin
  114.  
  115. sendln ''
  116.  
  117.  
  118.  
  119. wait 'Service'
  120.  
  121. if result=0 goto errtimeout
  122.  
  123.  
  124.  
  125. sendln '3'
  126.  
  127.  
  128.  
  129. wait 'Function'
  130.  
  131. if result=0 goto errtimeout
  132.  
  133.  
  134.  
  135. sendln '1'
  136.  
  137.  
  138.  
  139. wait 'accept'
  140.  
  141. if result=0 goto errtimeout
  142.  
  143.  
  144.  
  145. send 'T'
  146.  
  147. sendln '{NX$FILENAME}'
  148.  
  149.  
  150. wait 'BEGIN'
  151.  
  152. if result=0 goto errtimeout
  153.  
  154.  
  155. pause 3
  156.  
  157.  
  158. zmodemsend '{NX$FILEPATH}' 0
  159.  
  160. if result=0 goto uploaderror
  161.  
  162.  
  163. pause 2
  164.  
  165.  
  166. wait 'Function'
  167.  
  168. if result=0 goto errtimeout
  169.  
  170. sendln '4'
  171.  
  172. lasterror = 'File successfully uploaded.'
  173.  
  174. setexitcode 1
  175.  
  176. goto end
  177.  
  178.  
  179.  
  180. :errtimeout
  181.  
  182. lasterror = 'Error: Timeout'
  183.  
  184. setexitcode -1
  185.  
  186. goto end
  187.  
  188.  
  189.  
  190. :noconnect
  191.  
  192. lasterror = 'No Answer'
  193.  
  194. setexitcode -2
  195.  
  196. goto end
  197.  
  198.  
  199.  
  200. :busy
  201.  
  202. lasterror = 'Line Busy'
  203.  
  204. setexitcode -3
  205.  
  206. goto end
  207.  
  208.  
  209.  
  210. :badpass
  211.  
  212. lasterror = 'Invalid password'
  213.  
  214. setexitcode -4
  215.  
  216. goto end
  217.  
  218.  
  219.  
  220. :uploaderror
  221.  
  222. lasterror = 'File upload failed.'
  223.  
  224. setexitcode -5
  225.  
  226. goto end
  227.  
  228.  
  229. :connectfailure
  230.  
  231. lasterror = 'Failed to connect to modem.'
  232.  
  233. setexitcode -6
  234.  
  235. goto end
  236.  
  237.  
  238.  
  239. :neednewpass
  240.  
  241. lasterror = 'A new password is needed.'
  242.  
  243. setexitcode -7
  244.  
  245. goto end
  246.  
  247.  
  248. :enteredoldpass
  249.  
  250. lasterror = 'Cannot use old passwords.'
  251.  
  252. setexitcode -8
  253.  
  254. goto end
  255.  
  256.  
  257. :errtimeout_prelogin
  258.  
  259. lasterror = 'Error: Timeout Before Login'
  260.  
  261. setexitcode -9
  262.  
  263. goto end
  264.  
  265.  
  266.  
  267. :end
  268.  
  269. disconnect
  270.  
  271. logclose
  272.  
  273. closett
  274.  
  275. messagebox lasterror 'Upload Process Completed'
  276.  
  277.