home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / TE2_134T / te2inst.003 / OS2RT.scr < prev    next >
Text File  |  1997-07-03  |  3KB  |  121 lines

  1. ; ---------------------------------------------------------------------
  2. ;
  3. ;  TE/2 Script Language
  4. ;   Copyright 1990-94, Oberon Software, Mankato, MN
  5. ;
  6. ;   Script for automated logon to
  7. ;       GEnie (the General Electric Network for Information Exchange)
  8. ;       with special handling for the OS/2 RT
  9. ;
  10. ; ---------------------------------------------------------------------
  11. ;
  12. ; Put your entire userid;password string into the TE/2 dialing directory
  13. ; for this script (I.e., XXX99999,password
  14. ;
  15. ; ---------------------------------------------------------------------
  16.  
  17. integer mnuSelect = 1
  18. string  mnuTitle  = "     Mail is waiting     "
  19. string  mnuItems  = "!Mail, Command Mode       !Bulletin Board, OS/2 RT  !Realtime Conf, OS/2 RT   !Libraries, OS/2 RT       !Goodbye                  !Exit Script              !"
  20. integer mnuTop    = 10
  21. integer mnuLeft   = 20
  22. integer mnuAttr   = 0x1f
  23. integer mnuHiAttr = 0x71
  24.  
  25. string  login
  26. integer mail        = TRUE
  27. integer wtch
  28. integer GEaction
  29.  
  30. string  NoMailStr   = "No letters waiting."
  31. string  MailWaitStr = "Command?"
  32. string  BBWaitStr   = "1 ?"
  33. string  RTCWaitStr1 = "What ROOM (1-3), or <Q>uit?"
  34. string  RTCWaitStr2 = "is here."
  35. string  RTCRoom     = "2"
  36. string  RTCName     = ""
  37.  
  38. string  GotoMail    = "m200;9"
  39. string  GotoBB      = "m1400;1"
  40. string  GotoRTC     = "m1400;2"
  41. string  GotoLIB     = "m1400;3"
  42.  
  43.   ;; -----------------------------------------------------------------------
  44.  
  45. subroutine getGenieAction
  46.  
  47.   if !mail
  48.     mnuTitle  = "     No mail waiting     "
  49.     mnuSelect = 2
  50.   endif
  51.   GEAction = PopupMenu(mnuTitle, mnuItems, mnuTop, mnuLeft, mnuAttr, mnuHiAttr, mnuSelect)
  52.  
  53. endsub
  54.  
  55.   ;; -----------------------------------------------------------------------
  56.  
  57. subroutine GenieAction
  58.  
  59.   if GEaction == 1
  60.     transmit("%s^M", GotoMail)
  61.     if mail
  62.       waitfor(MailWaitStr, 120)
  63.     endif
  64.   elseif GEaction == 2
  65.     transmit("%s^M", GotoBB)
  66.     waitfor(BBWaitStr, 120)
  67.     transmit("new all^M")
  68.   elseif GEaction == 3
  69.     transmit("%s^M", GotoRTC)
  70.     waitfor(RTCWaitStr1, 120)
  71.     transmit("%s^M", RTCRoom)
  72.     waitfor(RTCWaitStr2, 60)
  73.     if strlen(RTCName)
  74.       transmit("/nam %s^M", RTCName)
  75.     endif
  76.     chat()
  77.   elseif GEaction == 4
  78.     transmit("%s^M", GotoLIB)
  79.   elseif GEaction == 5
  80.     transmit("bye^M")
  81.     waitfor("OFF AT", 60)
  82.     hangup(FALSE)
  83.   endif
  84.  
  85. endsub
  86.  
  87.   ;; -----------------------------------------------------------------------
  88.  
  89. program
  90.  
  91.   if !connected
  92.     dial("genie")
  93.   endif
  94.  
  95.   login = password("genie")
  96.   if !strlen(login)
  97.     message("^GNo password in directory, you're on your own^M^J")
  98.   endif
  99.   
  100.   if connected
  101.     transmit("HHH")
  102.     if muxwait("/U#=/Uú╜/", 60)
  103.       if strlen(login)
  104.         transmit("%s^M", login)
  105.         wtch = watchfor(NoMailStr, "mail = FALSE")
  106.         waitfor("Enter #, <H>elp, or <CR> to continue?", 60)
  107.         cancelwatch(wtch)
  108.         gosub getGEnieAction
  109.         if GEaction
  110.           gosub GEnieAction
  111.         endif
  112.       endif
  113.     else
  114.       hangup(IFCARRIER)
  115.     endif
  116.   endif
  117.   end
  118.  
  119.  
  120.  
  121.