proc main integer nTries = 3 string UPLogin = "*" string UPNUI = "AD3" string UPCONN = "COM" integer nUPTimeout = 6 ; delay 2 ; Attempt to UKRPACK at most 'nTries' times while 0 < nTries do Try: transmit "^M" ; ping waitfor UPLogin then DoUP until nUPTimeout goto RetryUP DoUP: ; Enter NUI transmit UPNUI, raw transmit "^M" ; Wait for the connect prompt waitfor UPCONN until nUPTimeout if $SUCCESS then goto Done endif ; Retry UkrPack RetryUP: nTries = nTries - 1 delay 2 transmit "^M" waitfor UPLogin then DoUP until nUPTimeout endwhile Done: endproc