home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703B.ISO / terminal / mixnav / mixnav.pr_ / mixnav.pr
Text File  |  1995-09-24  |  46KB  |  2,597 lines

  1. ; Version : 1.1.0
  2. ;
  3. ; 日経MIX ナビゲータ
  4. ;    動作マクロ
  5. ;
  6.  
  7. end
  8.  
  9. INITIAL:
  10. ; マクロ完了をmix_base.dll へ通知するため
  11.     declare "MacroExit"        "MIXBASE.DLL" NUM
  12.     declare "FilterOn"        "MIXBASE.DLL" NUM
  13.     declare "ChatControl"    "MIXBASE.DLL" NUM
  14.     declare "CheckDownload"    "MIXBASE.DLL" STR
  15.     declare "RoomPassword"    "MIXBASE.DLL" STR STR
  16.     declare "NewUserID"     "MIXBASE.DLL" STR STR
  17.     declare "ConfLogClear"  "MIXBASE.DLL" NUM
  18. ;
  19.     chrwait 1
  20.     timeout 60
  21.     mode SILENT
  22.     CDOFF LINEOFF
  23.  
  24.     return
  25.  
  26. EXITLISTING:
  27.     send "q"+CR
  28.     case ":\w"
  29.     return
  30.  
  31. EXITCHAT:
  32.     send "/quit"+CR
  33.     case ":\w"
  34.     return
  35.  
  36. EXIT:
  37.     MacroExit 0
  38.     end
  39.  
  40. ERR_TIMEOUT:
  41.     PostNumMessage HWND CODE 101 0
  42.     goto EXIT
  43.  
  44. ERR_UID:
  45.     PostNumMessage HWND CODE 102 0
  46.     goto EXIT
  47.  
  48. LINEOFF:
  49.     PostNumMessage HWND CODE 103 0
  50.     goto EXIT
  51.  
  52. ;------------------------------------------------------------------------------
  53. BIZ_JOIN:
  54.     gosub INITIAL
  55.  
  56.     FilterOn 0
  57.     if LISTING then 
  58.         gosub EXITLISTING
  59.     endif
  60.     if CHAT then 
  61.         gosub EXITCHAT
  62.     endif
  63. ;
  64.     send "biz"+CR
  65.     case "利用規則を承認しますか (y/n)?"
  66.     send "y"+CR
  67.  
  68.     case "しばらくお待ち下さい。" "接続できません。"
  69.     goto BIZ_JOIN_OK              *
  70.  
  71.     PostNumMessage HWND CODE 90 0
  72.     case ":\w"
  73.  
  74.     goto BIZ_JOIN_EXIT
  75.  
  76. BIZ_JOIN_OK:
  77.     PostNumMessage HWND CODE 1 0
  78.  
  79.     FilterOn 1
  80. ;
  81.     case ">>\w"
  82. ;
  83.     FilterOn 0
  84.  
  85. BIZ_JOIN_EXIT:
  86.     MacroExit 0
  87.     PostNumMessage HWND CODE 0 0
  88.     end
  89.  
  90. BIZ_EXIT:
  91.     gosub INITIAL
  92.  
  93.     send "BYE"+CR
  94.     case ":\w"
  95.     MacroExit 0
  96.     PostNumMessage HWND CODE 0 0
  97.     end
  98.  
  99. ;------------------------------------------------------------------------------
  100. TELNET_JOIN:
  101.     gosub INITIAL
  102.  
  103.     FilterOn 0
  104.     if LISTING then 
  105.         gosub EXITLISTING
  106.     endif
  107.     if CHAT then 
  108.         gosub EXITCHAT
  109.     endif
  110. ;
  111.     send "telnet"+CR
  112.     case "telnet>"
  113.     goto TELNET_JOIN_OK *
  114.  
  115.     PostNumMessage HWND CODE 90 0
  116.     goto TELNET_JOIN_EXIT
  117.  
  118. TELNET_JOIN_OK:
  119.     PostNumMessage HWND CODE 1 0
  120.  
  121. TELNET_JOIN_EXIT:
  122.     MacroExit 0
  123.     PostNumMessage HWND CODE 0 0
  124.     end
  125.  
  126. ;------------------------------------------------------------------------------
  127. FTP_JOIN:
  128.     gosub INITIAL
  129.  
  130.     FilterOn 0
  131.     if LISTING then 
  132.         gosub EXITLISTING
  133.     endif
  134.     if CHAT then 
  135.         gosub EXITCHAT
  136.     endif
  137. ;
  138.     send "ftp"+CR
  139.     case "ftp>"
  140.     goto FTP_JOIN_OK *
  141.  
  142.     PostNumMessage HWND CODE 90 0
  143.     goto FTP_JOIN_EXIT
  144.  
  145. FTP_JOIN_OK:
  146.     PostNumMessage HWND CODE 1 0
  147.  
  148. FTP_JOIN_EXIT:
  149.     MacroExit 0
  150.     PostNumMessage HWND CODE 0 0
  151.     end
  152.  
  153. ;------------------------------------------------------------------------------
  154. CONF_DOWNLOAD:
  155.     FilterOn 0
  156.  
  157. ;    send "n"+cr
  158. ;    goto CONF_DOWNEND
  159.  
  160.     ConfLogClear 0
  161.     CheckDownload "アタッチファイル"
  162.     send "y"+cr "n"+cr
  163.     goto *      CONF_DOWNEND
  164.  
  165.     sleep 2
  166.     protocol ZM
  167.     fopen "" BD
  168.  
  169.     while binstatus == 1
  170.         wait 2
  171.     wend
  172.     wait 1
  173. CONF_DOWNEND:    
  174.     return
  175.  
  176. ;------------------------------------------------------------------------------
  177. CONF_MOVE:
  178. ;
  179. ; 会議室 指定メッセージへのポインター移動
  180. ;
  181. ; HWND    : 通知先ウィンドウ
  182. ; CODE    : 通知コード
  183. ; CONF    : 会議室名
  184. ; SUB    : 分科会名
  185. ; SKIP    : スキップ
  186. ; NUMBER: 読みだし番号
  187. ;
  188.     gosub INITIAL
  189. ;
  190.     FilterOn 0
  191.     if LISTING then 
  192.         gosub EXITLISTING
  193.     endif
  194.     if CHAT then 
  195.         gosub EXITCHAT
  196.     endif
  197. ;
  198.     if strlen(CONF) > 0 then
  199.         send "Join "+CONF+"/"+SUB+cr
  200.         case ":\w"
  201.     endif
  202.  
  203.  
  204.     FilterOn 1
  205.  
  206.     send "Head %s%d\r", SKIP, NUMBER
  207.     case ":\w"
  208.  
  209.     FilterOn 0
  210.     MacroExit 0
  211.     PostNumMessage HWND CODE 0 0
  212.     end
  213.  
  214. ;------------------------------------------------------------------------------
  215. CONF_NEXT:
  216. ;
  217. ; 会議室 次のメッセージ読みだし
  218. ;
  219. ; HWND    : 通知先ウィンドウ
  220. ; CODE    : 通知コード
  221. ; CONF    : 会議室名
  222. ; SUB    : 分科会名
  223. ; MODE    : 読み込み方向    ("FOR" or "BACK" or "")
  224. ;
  225.     gosub INITIAL
  226. ;
  227.     FilterOn 0
  228.     if LISTING then 
  229.         gosub EXITLISTING
  230.     endif
  231.     if CHAT then 
  232.         gosub EXITCHAT
  233.     endif
  234. ;
  235.     if strlen(CONF) > 0 then
  236.         send "Join "+CONF+"/"+SUB+cr
  237.         case ":\w"
  238.     endif
  239.  
  240.     if strlen(MODE) > 0 then
  241.         FilterOn 0
  242.         send MODE+cr
  243.         case ":\w"
  244.     endif
  245.  
  246.     FilterOn 1
  247.  
  248.     send cr
  249.     cases ":\w"      "(y/n)? N\08"
  250.     goto  ConfNext_End ConfNext_Bin ConfNext_End
  251.  
  252. ConfNext_Bin:
  253.     gosub CONF_DOWNLOAD
  254.  
  255. ConfNext_End:
  256.     FilterOn 0
  257.     MacroExit 0
  258.     PostNumMessage HWND CODE 0 0
  259.     end
  260.  
  261. ;------------------------------------------------------------------------------
  262. CONF_JOIN:
  263. ;
  264. ; 会議室への参加
  265. ;
  266. ; HWND    : 通知先ウィンドウ
  267. ; CODE    : 通知コード
  268. ; CONF    : 会議室名
  269. ; SUB    : 分科会名
  270. ;
  271.     gosub INITIAL
  272. ;
  273.     FilterOn 0
  274.     if LISTING then 
  275.         gosub EXITLISTING
  276.     endif
  277.     if CHAT then 
  278.         gosub EXITCHAT
  279.     endif
  280.  
  281.     send "q"+cr
  282.     cases ":\w"
  283.  
  284.     if strlen(CONF) == 0 then
  285.         sendstr cr
  286.     else
  287.         if strlen(SUB) > 0 then
  288.             sendstr "Join "+CONF+"/"+SUB+cr
  289.         else
  290.             sendstr "Join "+CONF+cr
  291.         endif
  292.     endif
  293.  
  294.     FilterOn 1
  295.  
  296. ConfJoin0:
  297. ; "room.xxxに参加するにはパスワードが必要です。参加しますか? (y/n)? "
  298.     cases "\n:\w" "\nR:\w"  "分科会? \w" "(y/n)? "
  299.     send  ""      ""        cr            ""        "\03"
  300.     goto  *       ConfJoin3 ConfJoin2     ConfJoin4 ConfJoin1
  301.  
  302.     PostNumMessage HWND CODE 91 0
  303.     goto ConfJoin1
  304.  
  305. ConfJoin4:
  306.     PASS = ""
  307.     RoomPassword "" PASS
  308.     send "y"+cr "n"+cr
  309.     goto *      ConfJoin1
  310.  
  311.     cases "Password?:"
  312.     send  PASS+cr      "\03"
  313.     goto  *            ConfJoin1
  314.  
  315. ; "パスワードが違います。もう一度入力して下さい。"
  316.     cases ":\w"     "パスワードが"
  317.     send  ""        "\03"
  318.     goto  ConfJoin3 *              ConfJoin3
  319.  
  320.     PostNumMessage HWND CODE 92 0
  321.     goto ConfJoin1
  322.  
  323. ConfJoin3:
  324.     PostNumMessage HWND CODE 90 0
  325.     goto ConfJoin1
  326.  
  327. ConfJoin2:
  328.     cases ":\w"
  329.     send  ""   "\03"
  330.     goto  *    ConfJoin1
  331.     PostNumMessage HWND CODE 90 0
  332.  
  333. ConfJoin1:
  334.     FilterOn 0
  335.     MacroExit 0
  336.     PostNumMessage HWND CODE 100 0
  337.     end
  338.  
  339. ;------------------------------------------------------------------------------
  340. CONF_RESIGN:
  341. ;
  342. ; 会議室からの脱会
  343. ;
  344. ; HWND    : 通知先ウィンドウ
  345. ; CODE    : 通知コード
  346. ; CONF    : 会議室名
  347. ; SUB    : 分科会名
  348. ;
  349.     gosub INITIAL
  350. ;
  351.     FilterOn 0
  352.     if LISTING then 
  353.         gosub EXITLISTING
  354.     endif
  355.     if CHAT then 
  356.         gosub EXITCHAT
  357.     endif
  358.  
  359.     send "q"+cr
  360.     case ":\w"
  361.  
  362.     if strlen(SUB) > 0 then
  363.         sendstr "Resign "+CONF+"/"+SUB+cr
  364.     else
  365.         sendstr "Resign "+CONF+cr
  366.     endif
  367.  
  368. ConfRes0:
  369.     cases ":\w"     "(y/n)? N\08\w"
  370.     send  ""        "y"+cr          ""
  371.     goto  ConfRes1  *               ConfRes1
  372.  
  373.     PostNumMessage HWND CODE 90 0
  374.  
  375. ConfRes1:
  376.     MacroExit 0
  377.     PostNumMessage HWND CODE 100 0
  378.     end
  379.  
  380. ;------------------------------------------------------------------------------
  381. CONF_NEW_LIST:
  382. ;
  383. ; 未読会議室一覧取得
  384. ;
  385.  
  386. ; HWND    : 通知先ウィンドウ
  387. ; CODE    : 通知コード
  388. ;
  389.     gosub INITIAL
  390. ;
  391.     FilterOn 0
  392.     if LISTING then 
  393.         gosub EXITLISTING
  394.     endif
  395.     if CHAT then 
  396.         gosub EXITCHAT
  397.     endif
  398.     FilterOn 1
  399. ;
  400.     send "Show New"+cr
  401.     cases ":\w"
  402.  
  403.     MacroExit 0
  404.     PostNumMessage HWND CODE 0 0
  405.     end
  406.  
  407. ;------------------------------------------------------------------------------
  408. CONF_JOIN_LIST:
  409. ;
  410. ; 参加会議室一覧取得
  411. ;
  412. ; HWND    : 通知先ウィンドウ
  413. ; CODE    : 通知コード
  414. ;
  415.     gosub INITIAL
  416. ;
  417.     FilterOn 0
  418.     if LISTING then 
  419.         gosub EXITLISTING
  420.     endif
  421.     if CHAT then 
  422.         gosub EXITCHAT
  423.     endif
  424.     FilterOn 1
  425. ;
  426.     send "Show"+cr
  427.     cases ":\w"
  428.  
  429.     MacroExit 0
  430.     PostNumMessage HWND CODE 0 0
  431.     end
  432.  
  433. ;------------------------------------------------------------------------------
  434. CONF_ALL_LIST:
  435. ;
  436. ; 全会議室一覧取得
  437. ;
  438. ; HWND    : 通知先ウィンドウ
  439. ; CODE    : 通知コード
  440. ;
  441.     gosub INITIAL
  442. ;
  443.     FilterOn 0
  444.     if LISTING then 
  445.         gosub EXITLISTING
  446.     endif
  447.     if CHAT then 
  448.         gosub EXITCHAT
  449.     endif
  450.     FilterOn 1
  451. ;
  452.     send "Show All"+cr
  453.     cases ":\w"
  454.  
  455.     MacroExit 0
  456.     PostNumMessage HWND CODE 0 0
  457.     end
  458.  
  459. ;------------------------------------------------------------------------------
  460. CONF_NUMBER:
  461. ;
  462. ; 会議室 指定メッセージ読みだし
  463. ;
  464. ; HWND    : 通知先ウィンドウ
  465. ; CODE    : 通知コード
  466. ; CONF    : 会議室名
  467. ; SUB    : 分科会名
  468. ; NUMBER: 読みだし番号
  469. ; SKIP    : スキップチェック
  470. ;
  471.     gosub INITIAL
  472. ;
  473.     FilterOn 0
  474.     if LISTING then 
  475.         gosub EXITLISTING
  476.     endif
  477.     if CHAT then 
  478.         gosub EXITCHAT
  479.     endif
  480. ;
  481.     if strlen(CONF) > 0 then
  482.         send "Join "+CONF+"/"+SUB+cr
  483.         case ":\w"
  484.     endif
  485.  
  486.  
  487.     send "%s%d", SKIP, NUMBER
  488.     FilterOn 1
  489.     send cr
  490.  
  491.     cases ":\w"      "(y/n)? N\08"
  492.     goto  ConfNum_End ConfNum_Bin ConfNum_End
  493.  
  494. ConfNum_Bin:
  495.     gosub CONF_DOWNLOAD
  496.     
  497. ConfNum_End:
  498.     FilterOn 0
  499.     MacroExit 0
  500.     PostNumMessage HWND CODE 0 0
  501.     end
  502.  
  503. ;------------------------------------------------------------------------------
  504. CONF_DATE:
  505. ;
  506. ; 会議室 日付指定メッセージ読みだし
  507. ;
  508. ; HWND    : 通知先ウィンドウ
  509. ; CODE    : 通知コード
  510. ; CONF    : 会議室名
  511. ; SUB    : 分科会名
  512. ; DATE    : 読みだし日付
  513. ; SKIP    : スキップチェック
  514. ;
  515.     gosub INITIAL
  516. ;
  517.     FilterOn 0
  518.     if LISTING then 
  519.         gosub EXITLISTING
  520.     endif
  521.     if CHAT then 
  522.         gosub EXITCHAT
  523.     endif
  524. ;
  525.     if strlen(CONF) > 0 then
  526.         send "Join "+CONF+"/"+SUB+cr
  527.         case ":\w"
  528.     endif
  529.  
  530.  
  531.     send "%s date %s", SKIP, READDATE
  532.     FilterOn 1
  533.     send cr
  534.  
  535.     cases ":\w"           "(y/n)? N\08"
  536.     goto  ConfDate_End ConfDate_Bin ConfDate_End
  537.  
  538. ConfDate_Bin:
  539.     gosub CONF_DOWNLOAD
  540.     
  541. ConfDate_End:
  542.     FilterOn 0
  543.     MacroExit 0
  544.     PostNumMessage HWND CODE 0 0
  545.     end
  546.  
  547. ;------------------------------------------------------------------------------
  548. CONF_OPTION:
  549. ;
  550. ; 会議室 指定メッセージ読みだし
  551. ;
  552. ; HWND    : 通知先ウィンドウ
  553. ; CODE    : 通知コード
  554. ; CONF    : 会議室名
  555. ; SUB    : 分科会名
  556. ; COMMAND: 読みだし指定
  557. ; SKIP    : スキップチェック
  558. ;
  559.     gosub INITIAL
  560. ;
  561.     FilterOn 0
  562.     if LISTING then 
  563.         gosub EXITLISTING
  564.     endif
  565.     if CHAT then 
  566.         gosub EXITCHAT
  567.     endif
  568. ;
  569.     if strlen(CONF) > 0 then
  570.         send "Join "+CONF+"/"+SUB+cr
  571.         case ":\w"
  572.     endif
  573.  
  574.  
  575.     send "%s %s", SKIP, COMMAND
  576.     FilterOn 1
  577.     send cr
  578.  
  579.     cases ":\w"          "(y/n)? N\08"
  580.     goto  ConfOpt_End ConfOpt_Bin ConfOpt_End
  581.  
  582. ConfOpt_Bin:
  583.     gosub CONF_DOWNLOAD
  584.     
  585. ConfOpt_End:
  586.     FilterOn 0
  587.     MacroExit 0
  588.     PostNumMessage HWND CODE 0 0
  589.     end
  590.  
  591. ;------------------------------------------------------------------------------
  592. CONF_FIND:
  593. ;
  594. ; 会議室 メッセージ検索
  595. ;
  596. ; HWND    : 通知先ウィンドウ
  597. ; CODE    : 通知コード
  598. ; CONF    : 会議室名
  599. ; SUB    : 分科会名
  600. ; FROM  : 検索開始
  601. ; TO    : 最後
  602. ; FIND    : 検索文字列
  603. ;
  604.     gosub INITIAL
  605. ;
  606.     FilterOn 0
  607.     if LISTING then 
  608.         gosub EXITLISTING
  609.     endif
  610.     if CHAT then 
  611.         gosub EXITCHAT
  612.     endif
  613. ;
  614.     if strlen(CONF) > 0 then
  615.         send "Join "+CONF+"/"+SUB+cr
  616.         case ":\w"
  617.     endif
  618.  
  619.  
  620.     if strlen(FROM) == 0 && strlen(TO) == 0 then
  621.         send "%s \'%s\'", FINDNCD, FIND
  622.     else
  623.         if strlen(FROM) == 0 then
  624.             FROM = "1"
  625.         endif
  626.         if strlen(TO) == 0 then
  627.             TO = "last"
  628.         endif
  629.         send "%s %s to %s \'%s\'", FINDCMD, FROM, TO, FIND
  630.     endif
  631.  
  632.     FilterOn 1
  633.     send cr
  634.  
  635.     cases ":\w"
  636.  
  637.     FilterOn 0
  638.     MacroExit 0
  639.     PostNumMessage HWND CODE 0 0
  640.     end
  641.  
  642. ;------------------------------------------------------------------------------
  643. CONF_ORI:
  644. ;
  645. ; 会議室 コメント元メッセージ読みだし
  646. ;
  647. ; HWND    : 通知先ウィンドウ
  648. ; CODE    : 通知コード
  649. ; CONF    : 会議室名
  650. ; SUB    : 分科会名
  651. ;
  652.     gosub INITIAL
  653. ;
  654.     FilterOn 0
  655.     if LISTING then 
  656.         gosub EXITLISTING
  657.     endif
  658.     if CHAT then 
  659.         gosub EXITCHAT
  660.     endif
  661. ;
  662.     if strlen(CONF) > 0 then
  663.         send "Join "+CONF+"/"+SUB+cr
  664.         case ":\w"
  665.     endif
  666.  
  667.     send "or"
  668.  
  669.     FilterOn 1
  670.     send cr
  671.     cases ":\w"      "(y/n)? N\08"
  672.     goto  ConfOri_End ConfOri_Bin ConfOri_End
  673.  
  674. ConfOri_Bin:
  675.     gosub CONF_DOWNLOAD
  676.     
  677. ConfOri_End:
  678.     FilterOn 0
  679.     MacroExit 0
  680.     PostNumMessage HWND CODE 0 0
  681.     end
  682.  
  683. ;------------------------------------------------------------------------------
  684. CONF_REF:
  685. ;
  686. ; 会議室 コメント先メッセージ読みだし
  687. ;
  688. ; HWND    : 通知先ウィンドウ
  689. ; CODE    : 通知コード
  690. ; CONF    : 会議室名
  691. ; SUB    : 分科会名
  692. ;
  693.     gosub INITIAL
  694. ;
  695.     FilterOn 0
  696.     if LISTING then 
  697.         gosub EXITLISTING
  698.     endif
  699.     if CHAT then 
  700.         gosub EXITCHAT
  701.     endif
  702. ;
  703.     if strlen(CONF) > 0 then
  704.         send "Join "+CONF+"/"+SUB+cr
  705.         case ":\w"
  706.     endif
  707.  
  708.     send "ref"
  709.  
  710.     FilterOn 1
  711.     send cr
  712.     cases ":\w"      "(y/n)? N\08"
  713.     goto  ConfRef_End ConfRef_Bin ConfRef_End
  714.  
  715. ConfRef_Bin:
  716.     gosub CONF_DOWNLOAD
  717.     
  718. ConfRef_End:
  719.     FilterOn 0
  720.     MacroExit 0
  721.     PostNumMessage HWND CODE 0 0
  722.     end
  723.  
  724. ;------------------------------------------------------------------------------
  725. CONF_COMMENT:
  726. ;
  727. ; コメント送信
  728. ;
  729. ; HWND    : 通知先ウィンドウ
  730. ; CODE    : 通知コード
  731. ; HMEM    : 送信データ (GlobalHandle)
  732. ; CONF    : 会議室名
  733. ; SUB    : 分科会名
  734. ; NUMBER : コメント元番号
  735. ;
  736.     gosub INITIAL
  737. ;
  738.     FilterOn 0
  739.     if LISTING then 
  740.         gosub EXITLISTING
  741.     endif
  742.     if CHAT then 
  743.         gosub EXITCHAT
  744.     endif
  745. ;
  746.     if strlen(CONF) > 0 then
  747.         send "Join "+CONF+"/"+SUB+cr
  748.         case ":\w"
  749.     endif
  750.  
  751.     send "Clear"+cr
  752.     case ":\w"
  753.  
  754.     if NUMBER > 0 then
  755.         send "com %d\r", NUMBER
  756.     else
  757.         send "com"+cr
  758.     endif
  759.  
  760. ;    FilterOn 1
  761.  
  762.     case "\n\w"
  763.     SendHandle HMEM 1
  764. Retry_Comment:
  765.     case "\n\w"         "A:\w" "Rf:\w"      "R:\w"     "RB:\w"
  766.     send "."+cr         ""     ""         ""         ""      ""
  767.     goto Retry_Comment  *      Coment_End Coment_End Coment_End ERR_TIMEOUT
  768.  
  769.     if strlen(FILE) == 0 then
  770.         goto Send_Com_Add
  771.     endif
  772.  
  773.     send "attach"+cr
  774.     case "は? \w" " )? "
  775.     goto *         *       ERR_TIMEOUT
  776.  
  777.     send FNAME+cr
  778.     case "ZMODEM"
  779.     wait 1
  780.  
  781.     protocol ZM
  782.     fopen FILE BU
  783.  
  784.     while binstatus == 1
  785.         wait 2
  786.     wend
  787.     wait 1
  788.  
  789.     if binerror < 0 then
  790.         PostNumMessage HWND CODE 101 0
  791.         send "q"+cr
  792.         goto Coment_End
  793.     endif
  794.  
  795. Send_Com_Add:
  796.     send "A"+cr
  797.     case ":\w"
  798.  
  799. Coment_End:
  800.     FilterOn 0
  801.     MacroExit 0
  802.     PostNumMessage HWND CODE 0 0
  803.     goto EXIT
  804.  
  805. ;------------------------------------------------------------------------------
  806. CONF_SAY:
  807. ;
  808. ; 発言送信
  809. ;
  810. ; HWND    : 通知先ウィンドウ
  811. ; CODE    : 通知コード
  812. ; SUBJECT:タイトル
  813. ; HMEM    : 送信データ (GlobalHandle)
  814. ;
  815.     gosub INITIAL
  816. ;
  817.     FilterOn 0
  818.     if LISTING then 
  819.         gosub EXITLISTING
  820.     endif
  821.     if CHAT then 
  822.         gosub EXITCHAT
  823.     endif
  824. ;
  825.     send "Clear"+cr
  826.     case ":\w"
  827.  
  828.     FilterOn 1
  829.  
  830.     send "Say"+cr
  831.  
  832.     case "標題:"
  833.     send SUBJECT+cr ""           
  834.     goto *          ERR_TIMEOUT
  835.  
  836.     case "\n\w"
  837.     SendHandle HMEM 1
  838. Retry_Say:
  839.     case "\n\w"    "A:\w"
  840.     send "."+cr    ""     ""
  841.     goto Retry_Say *      ERR_TIMEOUT
  842.  
  843.     if strlen(FILE) == 0 then
  844.         goto Send_Say_Add
  845.     endif
  846.  
  847.     send "attach"+cr
  848.     case "は? \w" " )? "
  849.     goto *         *       ERR_TIMEOUT
  850.  
  851.     send FNAME+cr
  852.     case "ZMODEM"
  853.     wait 1
  854.  
  855.     protocol ZM
  856.     fopen FILE BU
  857.  
  858.     while binstatus == 1
  859.         wait 2
  860.     wend
  861.     wait 1
  862.  
  863.     if binerror < 0 then
  864.         PostNumMessage HWND CODE 101 0
  865.         send "q"+cr
  866.         goto Conf_Say_Err
  867.     endif
  868.  
  869. Send_Say_Add:
  870.     send "A"+cr
  871.     case ":\w"
  872.  
  873. Conf_Say_Err:
  874.     FilterOn 0
  875.     MacroExit 0
  876.     PostNumMessage HWND CODE 0 0
  877.     goto EXIT
  878.  
  879. ;------------------------------------------------------------------------------
  880. CONF_LAST:
  881. ;
  882. ; 会議室 最後のメッセージ読みだし
  883. ;
  884. ; HWND    : 通知先ウィンドウ
  885. ; CODE    : 通知コード
  886. ; CONF    : 会議室名
  887. ; SUB    : 分科会名
  888. ; SKIP    : ポインター移動
  889. ;
  890.     gosub INITIAL
  891. ;
  892.     FilterOn 0
  893.     if LISTING then 
  894.         gosub EXITLISTING
  895.     endif
  896.     if CHAT then 
  897.         gosub EXITCHAT
  898.     endif
  899. ;
  900.     if strlen(CONF) > 0 then
  901.         send "Join "+CONF+"/"+SUB+cr
  902.         case ":\w"
  903.     endif
  904.  
  905.     send "Last"
  906.  
  907.     FilterOn 1
  908.     send cr
  909.     cases ":\w"      "(y/n)? N\08"
  910.     goto  ConfLast_End ConfLast_Bin ConfLast_End
  911.  
  912. ConfLast_Bin:
  913.     gosub CONF_DOWNLOAD
  914.     
  915. ConfLast_End:
  916.     FilterOn 0
  917.     MacroExit 0
  918.     PostNumMessage HWND CODE 0 0
  919.     end
  920.  
  921. ;------------------------------------------------------------------------------
  922. CONF_DEL:
  923. ;
  924. ; 会議室 指定メッセージ削除
  925. ;
  926. ; HWND    : 通知先ウィンドウ
  927. ; CODE    : 通知コード
  928. ; CONF    : 会議室名
  929. ; SUB    : 分科会名
  930. ; NUMBER: 削除番号
  931. ;
  932.     gosub INITIAL
  933. ;
  934.     FilterOn 0
  935.     if LISTING then 
  936.         gosub EXITLISTING
  937.     endif
  938.     if CHAT then 
  939.         gosub EXITCHAT
  940.     endif
  941. ;
  942.     if strlen(CONF) > 0 then
  943.         send "Join "+CONF+"/"+SUB+cr
  944.         case ":\w"
  945.     endif
  946.  
  947.  
  948.     send "wi %d\r", NUMBER
  949.  
  950. Del_Check:
  951.     case ":\w" "(y/n)? "
  952.     send ""    "y"+cr
  953.     goto *     Del_Check
  954.  
  955.     MacroExit 0
  956.     PostNumMessage HWND CODE 0 0
  957.     end
  958.  
  959. ;------------------------------------------------------------------------------
  960. MAIL_NEW_LIST:
  961. ;
  962. ; 電子メール 未読メール一覧取得
  963. ;
  964. ; HWND    : 通知先ウィンドウ
  965. ; CODE    : 通知コード
  966. ;
  967.     gosub INITIAL
  968. ;
  969.     FilterOn 0
  970.     if LISTING then 
  971.         gosub EXITLISTING
  972.     endif
  973.     if CHAT then 
  974.         gosub EXITCHAT
  975.     endif
  976.     FilterOn 1
  977. ;
  978.     send "Mail"+cr
  979.     cases ":\w"
  980.  
  981.     FilterOn 0
  982.     MacroExit 0
  983.     PostNumMessage HWND CODE 0 0
  984.     end
  985.  
  986. ;------------------------------------------------------------------------------
  987. MAIL_SEND:
  988. ;
  989. ; MAIL 送信
  990. ;
  991. ; HWND    : 通知先ウィンドウ
  992. ; CODE    : 通知コード
  993. ; UID    : 送信先ID (配列)
  994. ; SUBJECT:タイトル
  995. ; HMEM    : 送信データ (GlobalHandle)
  996. ; FILE    : 添付ファイル名
  997. ; FNAME    : MIXへ通知するファイル名
  998. ;
  999.     gosub INITIAL
  1000. ;
  1001.     FilterOn 0
  1002.     if LISTING then 
  1003.         gosub EXITLISTING
  1004.     endif
  1005.     if CHAT then 
  1006.         gosub EXITCHAT
  1007.     endif
  1008.     FilterOn 1
  1009.  
  1010.     send "Clear"+cr
  1011.     case ":\w"
  1012.  
  1013.     send "Mail to "+UID[0]+cr
  1014.  
  1015.     case "標題を入れて下さい:" "相手先がありません。"
  1016.     send SUBJECT+cr             ""      ""
  1017.     goto *                      ERR_UID ERR_TIMEOUT
  1018.  
  1019.  
  1020.     case "\n\w"
  1021.     SendHandle HMEM 1
  1022. Retry_Send:
  1023.     case "\n\w"      "action:\w"
  1024.     send "."+cr      ""          ""
  1025.     goto Retry_Send  Send_Attach ERR_TIMEOUT
  1026.  
  1027. Send_Attach:
  1028.     if strlen(FILE) == 0 then
  1029.         goto Send_CC
  1030.     endif
  1031.  
  1032.     send "attach"+cr
  1033.     case "は? \w" " )? "
  1034.     goto *         *       ERR_TIMEOUT
  1035.     
  1036.     send FNAME+cr
  1037.     case "ZMODEM"
  1038.     wait 1
  1039.  
  1040.     protocol ZM
  1041.     fopen FILE BU
  1042.  
  1043.     while binstatus == 1
  1044.         wait 2
  1045.     wend
  1046.     wait 1
  1047.  
  1048.     if binerror < 0 then
  1049.         PostNumMessage HWND CODE 101 0
  1050.         send "q"+cr
  1051.         goto MAIL_SEND_ERR
  1052.     endif
  1053. Send_CC:
  1054.     n = 1
  1055.     while strlen(UID[n]) > 0
  1056.         send "CC "+UID[n]+cr
  1057.         case ":\w"
  1058.         n = n+1
  1059.     wend
  1060.  
  1061.     send "send"+cr
  1062. MAIL_SEND_ERR:
  1063.     case ":\w"
  1064.  
  1065.     MacroExit 0
  1066. ;    PostNumMessage HWND CODE 0 0
  1067.     goto EXIT
  1068.  
  1069. ;------------------------------------------------------------------------------
  1070. MAIL_REPLAY:
  1071. ;
  1072. ; MAIL コメント送信
  1073. ;
  1074. ; HWND    : 通知先ウィンドウ
  1075. ; CODE    : 通知コード
  1076. ; MID    : コメント元メール番号
  1077. ; HMEM    : 送信データ (GlobalHandle)
  1078. ;
  1079.     gosub INITIAL
  1080. ;
  1081.     FilterOn 0
  1082.     if LISTING then 
  1083.         gosub EXITLISTING
  1084.     endif
  1085.     if CHAT then 
  1086.         gosub EXITCHAT
  1087.     endif
  1088.     FilterOn 1
  1089. ;
  1090.     send "Clear"+cr
  1091.     case ":\w"
  1092.  
  1093.     send "Mail Rep "+str(MID)+cr
  1094.     case "\n\w"
  1095.  
  1096.     SendHandle HMEM 1
  1097. Retry_Rep:
  1098.     case "\n\w"    "action:\w" "(y/n)?"
  1099.     send "."+cr    "send"+cr   "n"+cr    ""
  1100.     goto Retry_Rep *           Retry_Rep ERR_TIMEOUT
  1101.  
  1102.     case ":\w"
  1103.  
  1104.     MacroExit 0
  1105.     PostNumMessage HWND CODE 0 0
  1106.     goto EXIT
  1107.  
  1108. ;------------------------------------------------------------------------------
  1109. MAIL_FORWARD:
  1110. ;
  1111. ; MAIL 転送
  1112. ;
  1113. ; HWND    : 通知先ウィンドウ
  1114. ; CODE    : 通知コード
  1115. ; ID    : 転送元メールID
  1116. ; UID    : 送信先ID (配列)
  1117. ;
  1118.     gosub INITIAL
  1119. ;
  1120.     FilterOn 0
  1121.     if LISTING then 
  1122.         gosub EXITLISTING
  1123.     endif
  1124.     if CHAT then 
  1125.         gosub EXITCHAT
  1126.     endif
  1127.  
  1128.     send "file Mail %d\r", ID
  1129.     case ":\w"
  1130.  
  1131.     chrwait 0
  1132.     n = 0
  1133.     while strlen(UID[n]) > 0
  1134.         send "for "+UID[n]+cr
  1135.         case ":\w"
  1136.         send "send"+cr
  1137.         case ":\w"
  1138.         n = n+1
  1139.     wend
  1140.     
  1141.     send "q"+cr
  1142. ;    case ":\w"
  1143.  
  1144.     MacroExit 0
  1145.     PostNumMessage HWND CODE 0 0
  1146.     goto EXIT
  1147.  
  1148. ;------------------------------------------------------------------------------
  1149. MAIL_READ:
  1150. ;
  1151. ; MAIL 本文読み出し
  1152. ;
  1153. ; HWND    : 通知先ウィンドウ
  1154. ; CODE    : 通知コード
  1155. ; ID    : 取得メール番号
  1156. ;
  1157.     gosub INITIAL
  1158. ;
  1159.     FilterOn 0
  1160.     if LISTING then 
  1161.         gosub EXITLISTING
  1162.     endif
  1163.     if CHAT then 
  1164.         gosub EXITCHAT
  1165.     endif
  1166.     FilterOn 1
  1167. ;
  1168.     send "Mail "+str(ID)+cr
  1169.  
  1170. Endcheck:
  1171.     cases ":\w"      "(y/n)? Y\08"
  1172.     goto  Mail_End Mail_Bin     Mail_End
  1173.  
  1174. Mail_Bin:
  1175.     FilterOn 0
  1176.     CheckDownload ""
  1177.     send "y"+cr "n"+cr
  1178.     goto *      Endcheck
  1179.  
  1180.     sleep 2
  1181.     protocol ZM
  1182.     fopen "" BD
  1183.  
  1184.     while binstatus == 1
  1185.         wait 2
  1186.     wend
  1187.     wait 1
  1188.     
  1189. Mail_End:
  1190.     FilterOn 0
  1191.     send "q"+cr
  1192.  
  1193.     MacroExit 0
  1194.     PostNumMessage HWND CODE 0 0
  1195.     end
  1196.  
  1197. ;------------------------------------------------------------------------------
  1198. MAIL_INBASK:
  1199. ;
  1200. ; 電子メール 受信メール一覧取得
  1201. ;
  1202. ; HWND    : 通知先ウィンドウ
  1203. ; CODE    : 通知コード
  1204. ;
  1205.     gosub INITIAL
  1206. ;
  1207.     FilterOn 0
  1208.     if LISTING then 
  1209.         gosub EXITLISTING
  1210.     endif
  1211.     if CHAT then 
  1212.         gosub EXITCHAT
  1213.     endif
  1214.     FilterOn 1
  1215.  
  1216.     send "Mail Inbask"+cr
  1217.     cases ":\w"
  1218.  
  1219.     FilterOn 0
  1220.     MacroExit 0
  1221.     PostNumMessage HWND CODE 0 0
  1222.     end
  1223.  
  1224. ;------------------------------------------------------------------------------
  1225. MAIL_OUTBASK:
  1226. ;
  1227. ; 電子メール 送信済みメール一覧取得
  1228. ;
  1229. ; HWND    : 通知先ウィンドウ
  1230. ; CODE    : 通知コード
  1231.  
  1232.     gosub INITIAL
  1233. ;
  1234.     FilterOn 0
  1235.     if LISTING then 
  1236.         gosub EXITLISTING
  1237.     endif
  1238.     if CHAT then 
  1239.         gosub EXITCHAT
  1240.     endif
  1241.     FilterOn 1
  1242. ;
  1243.     send "Mail Outbask"+cr
  1244.     cases ":\w"
  1245.  
  1246.     FilterOn 0
  1247.     MacroExit 0
  1248.     PostNumMessage HWND CODE 0 0
  1249.     end
  1250.  
  1251. ;------------------------------------------------------------------------------
  1252. MAIL_DELETE:
  1253. ;
  1254. ; MAIL 削除
  1255. ;
  1256. ; HWND    : 通知先ウィンドウ
  1257. ; CODE    : 通知コード
  1258. ; ID    : 削除メール番号
  1259. ;
  1260.     gosub INITIAL
  1261. ;
  1262.     FilterOn 0
  1263.  
  1264.     if LISTING then 
  1265.         gosub EXITLISTING
  1266.     endif
  1267.     if CHAT then 
  1268.         gosub EXITCHAT
  1269.     endif
  1270. ;
  1271.     send "Mail del "+str(ID)+cr
  1272.  
  1273. DeleteRetry:
  1274.     cases ":\w" "y/n)? "
  1275.     send  ""    "y"+cr
  1276.     goto  *     DeleteRetry *
  1277.  
  1278.     PostNumMessage HWND CODE 1 0
  1279.  
  1280.     MacroExit 0
  1281.     PostNumMessage HWND CODE 0 0
  1282.     end
  1283.  
  1284. ;------------------------------------------------------------------------------
  1285. GOTO_CHAT:
  1286. ;
  1287. ; チャットへ入る
  1288. ;
  1289. ; HWND    : 通知先ウィンドウ
  1290. ; CODE    : 通知コード
  1291. ; NAME    : チャットでの名前
  1292. ; MSG    : メッセージ
  1293. ; CHANEL : チャネル番号
  1294. ; BAND    : バンド
  1295. ;
  1296.     gosub INITIAL
  1297. ;
  1298.     FilterOn 0
  1299.     ChatControl 0
  1300.  
  1301.     if LISTING then 
  1302.         gosub EXITLISTING
  1303.     endif
  1304.  
  1305.     send "q"+cr
  1306.  
  1307. goto_chat0:
  1308.     case ":\w"
  1309.     sendstr "cbix"+cr
  1310.  
  1311. goto_chat1:
  1312.     case "dumb ですか? (y/n/q): \w" "(y/n/q): \w" "<CR> で続きを..." "Reserved."  "R:\w"     "下さい: "
  1313.     send "y"+cr                     "n"+cr        cr                 ""           "q"+cr     "dumb"+cr" ""
  1314.     goto goto_chat3                 goto_chat2    goto_chat1         goto_chat5   goto_chat0 goto_chat3 ERR_TIMEOUT
  1315.  
  1316. ; profle Save済み
  1317. goto_chat5:
  1318.     wait 1
  1319.     if strlen(NAME) > 0 then
  1320.         send "/alias \""+NAME+"\""+cr
  1321.         case "\n\w"
  1322.     endif
  1323.  
  1324.     send "/band "+BAND+cr
  1325.     case "\n\w"
  1326.  
  1327.     send "/chanel %d\r", CHANEL
  1328.         
  1329.     goto goto_chat6
  1330.  
  1331. goto_chat2:
  1332.     case "下さい: "
  1333.     send "dumb"+cr ""
  1334.     goto *         ERR_TIMEOUT
  1335.  
  1336. goto_chat3:
  1337.     case "下さい。: " "Reserved."
  1338.     send BAND+cr      ""          ""
  1339.     goto *            goto_chat5  ERR_TIMEOUT
  1340.         
  1341.     case "? (y/n): "
  1342.     goto *         ERR_TIMEOUT
  1343.     if strlen(NAME) > 0 then
  1344.         sendstr "y"+cr
  1345.         case "下さい: "
  1346.         send NAME+cr ""
  1347.         goto *         ERR_TIMEOUT
  1348.     else
  1349.         sendstr "n"+cr
  1350.     endif
  1351.  
  1352.     case "下さい。: "
  1353.     send "%d\r", CHANEL ""
  1354.     goto *         ERR_TIMEOUT
  1355.  
  1356.     case "下さい。: "
  1357.     send cr ""
  1358.     goto *         ERR_TIMEOUT
  1359.  
  1360. goto_chat6:
  1361.     case "\n\w"
  1362.     send "/beep off"+cr
  1363.     case "\n\w"
  1364.     send "/echo off"+cr
  1365.     case "\n\w"
  1366.  
  1367.     ChatControl 1
  1368.  
  1369.     if strlen(MSG) > 0 then
  1370.         send MSG+cr
  1371.     endif
  1372.  
  1373.     MacroExit 0
  1374.     PostNumMessage HWND CODE 0 0
  1375.     end
  1376.  
  1377.  
  1378. ;------------------------------------------------------------------------------
  1379. CHAT_CHAGNE:
  1380. ;
  1381. ; チャットでの状態変更
  1382. ;
  1383. ; HWND    : 通知先ウィンドウ
  1384. ; CODE    : 通知コード
  1385. ; NAME    : チャットでの名前
  1386. ; MSG    : メッセージ
  1387. ; CHANEL : チャネル番号
  1388. ; BAND    : バンド
  1389. ;
  1390.     gosub INITIAL
  1391. ;
  1392. ; 名前変更
  1393.     if strlen(NAME) > 0 then    
  1394.         send "/alias \""+NAME+"\""+cr
  1395.         case "許可されていません" "予約語です" "変わりました"
  1396.         wait 1
  1397.     endif
  1398.  
  1399. ; バンド変更
  1400.     if strlen(BAND) > 0 then    
  1401.         send "/band "+BAND+cr
  1402.         case "ようこそ" "ヘルプは"
  1403.         wait 1
  1404.     endif
  1405.  
  1406. ; チャネル変更
  1407.     if CHANEL > 0 then
  1408.         send "/chanel %d\r", CHANEL
  1409.         case "ようこそ" "ヘルプは"
  1410. ;        wait 1
  1411.     endif
  1412.  
  1413.     MacroExit 0
  1414.     PostNumMessage HWND CODE 0 0
  1415.     end
  1416.  
  1417. ;------------------------------------------------------------------------------
  1418. WHO:
  1419. ;
  1420. ; 参加ユーザー名取得
  1421. ;
  1422. ; HWND    : 通知先ウィンドウ
  1423. ; CODE    : 通知コード
  1424. ;
  1425.     gosub INITIAL
  1426. ;
  1427.     FilterOn 0
  1428.     if LISTING then 
  1429.         gosub EXITLISTING
  1430.     endif
  1431.     if CHAT then 
  1432.         gosub EXITCHAT
  1433.     endif
  1434.     FilterOn 1
  1435.  
  1436.     send "Who"+cr
  1437.     cases ":\w"
  1438.  
  1439.     MacroExit 0
  1440.     PostNumMessage HWND CODE 0 0
  1441.     end
  1442.  
  1443. ;------------------------------------------------------------------------------
  1444. GET_RESUME:
  1445. ;
  1446. ; ユーザープロフィール取得
  1447. ;
  1448. ; HWND    : 通知先ウィンドウ
  1449. ; CODE    : 通知コード
  1450. ; USER    : ユーザ名
  1451. ;
  1452.     gosub INITIAL
  1453. ;
  1454.     FilterOn 0
  1455.     if LISTING then 
  1456.         gosub EXITLISTING
  1457.     endif
  1458.     if CHAT then 
  1459.         gosub EXITCHAT
  1460.     endif
  1461.     FilterOn 1
  1462.  
  1463.     send "Show Resume "+USER+cr
  1464.     cases ":\w"
  1465.  
  1466.     MacroExit 0
  1467.     PostNumMessage HWND CODE 0 0
  1468.     end
  1469.  
  1470. ;------------------------------------------------------------------------------
  1471. SET_RESUME:
  1472. ;
  1473. ; ユーザープロフィール設定
  1474. ;
  1475. ; HWND    : 通知先ウィンドウ
  1476. ; CODE    : 通知コード
  1477. ; HMEM    : 送信データ (GlobalHandle)
  1478. ;
  1479.     gosub INITIAL
  1480. ;
  1481.     FilterOn 0
  1482.     if LISTING then 
  1483.         gosub EXITLISTING
  1484.     endif
  1485.     if CHAT then 
  1486.         gosub EXITCHAT
  1487.     endif
  1488.     FilterOn 1
  1489.  
  1490.     send "edit Resume"+cr
  1491.     case ":\w"
  1492.  
  1493.     send "1,$d"+cr
  1494.     case ":\w"
  1495.  
  1496.     send "i"+cr
  1497.     SendHandle HMEM 1
  1498.     send "."+cr
  1499.     cases ":\w"
  1500.  
  1501.     send "w"+cr
  1502.     case ":\w"
  1503.  
  1504.     send "q"+cr
  1505.     case ":\w"
  1506.  
  1507.     MacroExit 0
  1508.     PostNumMessage HWND CODE 0 0
  1509.     end
  1510.  
  1511. ;------------------------------------------------------------------------------
  1512. LIB_MAIN_LIST:
  1513. ;
  1514. ; Listing メインエリア名称取得
  1515. ;
  1516. ; HWND    : 通知先ウィンドウ
  1517. ; CODE    : 通知コード
  1518. ;
  1519.     gosub INITIAL
  1520. ;
  1521.     FilterOn 0
  1522.     if CHAT then 
  1523.         gosub EXITCHAT
  1524.     endif
  1525.  
  1526.     if LISTING == 0 Then
  1527.         send "Join Listings"+cr    
  1528.         cases ": \w"
  1529.     endif
  1530. ;
  1531.     FilterOn 1
  1532.  
  1533.     send "area ?"+cr
  1534.     cases ":\w" ": \w"
  1535.  
  1536.     send cr
  1537.     cases ": \w"
  1538.  
  1539.     MacroExit 0
  1540.     PostNumMessage HWND CODE 0 0
  1541.     end
  1542.  
  1543. ;------------------------------------------------------------------------------
  1544. LIB_SUB_LIST:
  1545. ;
  1546. ; Listing サブエリア名称取得
  1547. ;
  1548. ; HWND    : 通知先ウィンドウ
  1549. ; CODE    : 通知コード
  1550. ; MAIN    : メインエリア名
  1551. ;
  1552.     gosub INITIAL
  1553. ;
  1554.     FilterOn 0
  1555.     if CHAT then 
  1556.         gosub EXITCHAT
  1557.     endif
  1558.  
  1559.     if LISTING == 0 Then
  1560.         send "Join Listings"+cr    
  1561.         cases ": \w"
  1562.     endif
  1563. ;
  1564.     if strlen(MAIN) > 0 Then
  1565.         send "area "+MAIN+cr
  1566.         cases ": \w" "\nそのような"
  1567.         goto  *      Lib_Area_Error Lib_Area_TIMEOUT
  1568.     endif
  1569.  
  1570.     send "Subarea ?"
  1571.     FilterOn 1
  1572.     send cr
  1573.     cases ":\w"      ": \w"     ")? \w"
  1574.     goto  GetSub_End GetSub_End * *
  1575.  
  1576.     FilterOn 0
  1577.     send  "ALL"+cr
  1578.     cases ":\w"      ": \w"
  1579.  
  1580. GetSub_End:
  1581.     FilterOn 0
  1582.     MacroExit 0
  1583.     PostNumMessage HWND CODE 0 0
  1584.     end
  1585.  
  1586. ;------------------------------------------------------------------------------
  1587. LIB_FILE_LIST:
  1588. ;
  1589. ; Listing ファイル名一覧
  1590. ;
  1591. ; HWND    : 通知先ウィンドウ
  1592. ; CODE    : 通知コード
  1593. ; MAIN    : MAINグループ
  1594. ;
  1595.     gosub INITIAL
  1596. ;
  1597.     FilterOn 0
  1598.     if CHAT then 
  1599.         gosub EXITCHAT
  1600.     endif
  1601.  
  1602.     if LISTING == 0 Then
  1603.         send "Join Listings"+cr    
  1604.         cases ": \w"
  1605.     endif
  1606. ;
  1607.     if strlen(MAIN) > 0 Then
  1608.         send "area "+MAIN+cr
  1609.         cases ": \w" "\nそのような"
  1610.         goto  *      Lib_Area_Error Lib_Area_TIMEOUT
  1611.     endif
  1612.  
  1613.     if strlen(SUB) > 0 Then
  1614.         send "Subarea "+SUB+cr
  1615.         cases ": \w" "\nそのような"
  1616.         goto  *      Lib_Area_Error Lib_Area_TIMEOUT
  1617.     endif
  1618.  
  1619.     send "Find All"+cr
  1620.     cases ": \w"
  1621.  
  1622.     send "short"+cr
  1623.     cases ": \w"
  1624.  
  1625.     FilterOn 1
  1626.  
  1627.     send "disp"+cr
  1628.     cases ": \w"
  1629.  
  1630.     send "q"+cr
  1631.     cases ": \w"
  1632.  
  1633.     MacroExit 0
  1634.     PostNumMessage HWND CODE 0 0
  1635.     end
  1636.  
  1637. Lib_Area_Error:
  1638. Lib_Area_TIMEOUT:
  1639.     wait 1
  1640.     sendstr cr
  1641.  
  1642.     MacroExit 0
  1643.     PostNumMessage HWND CODE 110 0
  1644.     end
  1645.  
  1646. ;------------------------------------------------------------------------------
  1647. LIB_FILE_INFO:
  1648. ;
  1649. ; Listing ファイル概要取得
  1650. ;
  1651. ; HWND    : 通知先ウィンドウ
  1652. ; CODE    : 通知コード
  1653. ; MAIN    : MAINグループ
  1654. ; ID    : 読み出し番号
  1655. ;
  1656.     gosub INITIAL
  1657. ;
  1658.     FilterOn 0
  1659.     if CHAT then 
  1660.         gosub EXITCHAT
  1661.     endif
  1662.  
  1663.     if LISTING == 0 Then
  1664.         send "Join Listings"+cr    
  1665.         cases ": \w"
  1666.     endif
  1667. ;
  1668.     if strlen(MAIN) > 0 Then
  1669.         send "area "+MAIN+cr
  1670.         cases ": \w"
  1671.     endif
  1672.  
  1673.     if strlen(SUB) > 0 Then
  1674.         send "Subarea "+SUB+cr
  1675.         cases ": \w" "\nそのような"
  1676.         goto  *      Lib_Area_Error Lib_Area_TIMEOUT
  1677.     endif
  1678.  
  1679.     send "Find %d\r", ID
  1680.     cases ": \w"
  1681.  
  1682.     send "long"+cr
  1683.     cases ": \w"
  1684.  
  1685.     FilterOn 1
  1686.  
  1687.     send "disp"+cr
  1688.     cases ": \w"
  1689.  
  1690.     FilterOn 0
  1691.  
  1692.     send "q"+cr
  1693.     cases ": \w"
  1694.  
  1695.     MacroExit 0
  1696.     PostNumMessage HWND CODE 0 0
  1697.     end
  1698.  
  1699. ;------------------------------------------------------------------------------
  1700. LIB_FILE_RECEIVE:
  1701. ;
  1702. ; Listing ファイルダウンロード
  1703. ;
  1704. ; HWND    : 通知先ウィンドウ
  1705. ; CODE    : 通知コード
  1706. ; MAIN    : MAINグループ
  1707. ; ID    : 読み出し番号
  1708. ;
  1709.     gosub INITIAL
  1710. ;
  1711.     FilterOn 0
  1712.     if CHAT then 
  1713.         gosub EXITCHAT
  1714.     endif
  1715.  
  1716.     if LISTING == 0 Then
  1717.         send "Join Listings"+cr    
  1718.         cases ": \w"
  1719.     endif
  1720. ;
  1721.     if strlen(MAIN) > 0 Then
  1722.         send "area "+MAIN+cr
  1723.         cases ": \w"
  1724.     endif
  1725.  
  1726.     if strlen(SUB) > 0 Then
  1727.         send "Subarea "+SUB+cr
  1728.         cases ": \w" "\nそのような"
  1729.         goto  *      Lib_Area_Error Lib_Area_TIMEOUT
  1730.     endif
  1731.  
  1732.     send "Option receive z q"+cr
  1733.     cases ": \w"
  1734.  
  1735.     send "receive %d\r", ID
  1736.  
  1737.     wait 1
  1738.     protocol ZM
  1739.     fopen "" BD
  1740.     wait 1
  1741.  
  1742.     while binstatus == 1
  1743.         wait 1
  1744.     wend        
  1745. ;    if binerror != 1 then
  1746. ;        PostNumMessage HWND CODE 101 0
  1747. ;    endif
  1748.     sendstr cr
  1749.  
  1750.     cases ": \w"
  1751.  
  1752.     MacroExit 0
  1753. ;    PostNumMessage HWND CODE 0 0
  1754.     end
  1755.  
  1756. ;------------------------------------------------------------------------------
  1757. LIB_UPLOAD:
  1758. ;
  1759. ; Listing ファイルアップロード
  1760. ;
  1761. ; HWND    : 通知先ウィンドウ
  1762. ; CODE    : 通知コード
  1763. ; MAIN    : MAINグループ
  1764. ; SUB    : SUBグループ
  1765. ; FILE    : ファイル名 フルパス
  1766. ; FNAME : ファイル名
  1767. ; SUBJECT : タイトル
  1768. ; MSG    : メッセージ
  1769. ; KEY    : キーワード
  1770. ;
  1771.     gosub INITIAL
  1772. ;
  1773.     FilterOn 0
  1774.     if CHAT then 
  1775.         gosub EXITCHAT
  1776.     endif
  1777.  
  1778.     if LISTING == 0 Then
  1779.         send "Join Listings"+cr    
  1780.         cases ": \w"
  1781.     endif
  1782. ;
  1783.     if strlen(MAIN) > 0 Then
  1784.         send "area "+MAIN+cr
  1785.         cases ": \w"
  1786.     endif
  1787.  
  1788.     if strlen(SUB) > 0 Then
  1789.         send "Subarea "+SUB+cr
  1790.         cases ": \w"
  1791.     endif
  1792.  
  1793.     send "Option send z q"+cr
  1794.     case ": \w"
  1795.  
  1796.     send "send"+cr
  1797. FnameSet:
  1798.     case "File? " "subarea: \w"    "サブエリアはありません" "一覧は?): \w"
  1799.     send FNAME+cr SUB+cr        ""                      ""              ""
  1800.     goto *        FnameSet      SubArea_ERR             SubArea_ERR     SubArea_ERR
  1801.  
  1802.     case "y or n): "
  1803.     send "n"+cr
  1804.          
  1805.     case "ZMODEM"
  1806.     wait 1
  1807.  
  1808.     protocol ZM
  1809.     fopen FILE BU
  1810.  
  1811.     while binstatus == 1
  1812.         wait 2
  1813.     wend
  1814.     if binerror < 0 then
  1815.         PostNumMessage HWND CODE 2 0
  1816.         wait 1
  1817.         send "\03"
  1818.         goto LIB_SEND_ERR
  1819.     endif
  1820.  
  1821.     timeout 1
  1822.     case ">\w" "\n\w"
  1823.     timeout 60
  1824.  
  1825.     SendHandle MSG 1
  1826.     timeout 2
  1827.     case ">\w"
  1828.     send cr
  1829.     timeout 5
  1830.     case ">\w"
  1831.     send "."+cr
  1832.  
  1833.     case "y/n)?: "
  1834.     send "n"+cr
  1835.  
  1836. ;    case "入力が"
  1837.     n = 0
  1838.     case ">\w" "\n\w"
  1839.     while strlen(KEY[n]) > 0
  1840.         send KEY[n]+cr
  1841.         n = n+1
  1842.         case ">\w" "\n\w"
  1843.         
  1844.     wend
  1845.     send "."+cr
  1846.  
  1847.     MacroExit 0
  1848.     PostNumMessage HWND CODE 1 0
  1849.     end
  1850.  
  1851. SubArea_ERR:
  1852.     wait 1
  1853.     send "\03"
  1854.     MacroExit 0
  1855.     PostNumMessage HWND CODE 101 0
  1856.     end
  1857.  
  1858. ;------------------------------------------------------------------------------
  1859. CHG_PASSWORD:
  1860. ;
  1861. ; パスワード変更
  1862. ;
  1863. ; HWND    : 通知先ウィンドウ
  1864. ; CODE    : 通知コード
  1865. ; OLD    : 旧パスワード
  1866. ; NEW    : 新パスワード
  1867.  
  1868.     gosub INITIAL
  1869.     FilterOn 0
  1870.  
  1871.     if LISTING then 
  1872.         gosub EXITLISTING
  1873.     endif
  1874.     if CHAT then 
  1875.         gosub EXITCHAT
  1876.     endif
  1877.  
  1878.     send "q"+cr
  1879.     case ":"
  1880.  
  1881.     send "password"+cr
  1882.     case "古いパスワード:"
  1883.  
  1884.     send OLD+cr
  1885.     case "新しいパスワード:" "不適当です" "\n:"
  1886.     goto *                   CHGPASS_ERR  CHGPASS_ERR CHGPASS_ERR
  1887.  
  1888.     send NEW+cr
  1889.     case "新しいパスワード:" "再入力:" 
  1890.     goto NON_CHG_PASS        *         CHGPASS_ERR
  1891.  
  1892.     send NEW+cr
  1893.     case ":\w"
  1894.  
  1895.     PostNumMessage HWND CODE 1 0
  1896.     MacroExit 1
  1897.     goto CHGPASS_END
  1898.  
  1899. NON_CHG_PASS:
  1900.     send OLD+cr
  1901.     case "新しいパスワード:" "再入力:" 
  1902.     goto CHGPASS_ERR         *         CHGPASS_ERR
  1903.  
  1904.     send OLD+cr
  1905.     case ":\w"
  1906.  
  1907. CHGPASS_ERR:
  1908.     MacroExit 0
  1909.  
  1910. CHGPASS_END:
  1911.     PostNumMessage HWND CODE 0 0
  1912.     end
  1913.  
  1914. ;------------------------------------------------------------------------------
  1915. MIX_LOGIN:
  1916. ;
  1917. ; MIX オートログインマクロ
  1918. ;
  1919. ; HWND    : 通知先ウィンドウ
  1920. ; CODE    : 通知コード
  1921. ; UID    : ID
  1922. ; UPASSWD : パスワード
  1923. ; PHONE    : "T" or "P"
  1924. ; MODEM    : モデム初期化コマンド
  1925. ; NUMBER : 電話番号
  1926. ; COUNT : リトライ回数
  1927. ; WAIT    : リトラリ間隔
  1928. ; TYPE    : アクセスポイントタイプ (0:東京 1:地方AP)
  1929. ; ZERO    : 0 発信
  1930. ; ABORT : 強制中断
  1931. ; GATEWAY : "PCVAN" or "NIFTY"
  1932. ; GWID    : ID
  1933. ; GWPASS : パスワード
  1934. ;
  1935. ; 通信ポートパラメータ設定
  1936. ;    9600/8/s1/Non/S-JIS/BS/Log-FileNon
  1937. ;
  1938. ;    setparam 1 0 7
  1939.     setparam 1 1 1
  1940.     setparam 1 2 0
  1941.     setparam 1 3 2
  1942.     setparam 2 3 0
  1943.     setparam 2 4 1
  1944.     setparam 3 3 0
  1945.  
  1946.     if ABORT == 1 then
  1947.         goto LOGIN_ABORT
  1948.     endif
  1949.         
  1950. ;    if GATEWAY == "TELNET" then
  1951.     if TYPE == 4 then
  1952.         setparam 6 0 15
  1953.     endif
  1954.  
  1955.     popen
  1956.     PostNumMessage HWND CODE 1 0
  1957.     sleep 2
  1958.  
  1959. ; モデム初期化
  1960.     timeout 3
  1961.     chrwait 1
  1962.     send "AT"+cr
  1963.     case "OK"     "n:"      ":"      "?)"
  1964.     send ""       "quit"+cr "bye"+cr "quit"+cr ""
  1965.     goto MODEM_OK *         *        *    MODEM_ERR
  1966.     timeout 10
  1967. Re_bye:
  1968.     if ABORT == 1 then
  1969.         goto LOGIN_ABORT
  1970.     endif
  1971.     case "NO " "R:\w"   "M:\w"   ":\w"  "?)"
  1972.     send ""    "bye"+cr "bye"+cr "bye"+cr "quit"+cr ""
  1973.     goto *     Re_bye   Re_bye   Re_bye   Re_bye    MODEM_ERR
  1974.  
  1975.     timeout 3
  1976.     wait 1
  1977.     send "AT"+cr
  1978.     case "OK"
  1979.     goto *    MODEM_ERR
  1980.  
  1981. MODEM_OK:
  1982.     PostNumMessage HWND CODE 2 0
  1983.     if ABORT == 1 then
  1984.         goto LOGIN_ABORT
  1985.     endif
  1986.  
  1987. ;    if GATEWAY == "TELNET" then
  1988.     if TYPE == 4 then
  1989.         goto MODEM_INI_OK
  1990.     endif
  1991.  
  1992.     send "AT"+MODEM+cr
  1993.     case "OK"            "ERROR"
  1994.     goto MODEM_INI_OK    *      MODEM_ERR
  1995.  
  1996.     wait 1
  1997.     send "ATZ"+cr
  1998.     case "OK"            "ERROR"
  1999.     goto MODEM_INI_OK    MODEM_ERR MODEM_ERR
  2000.  
  2001. MODEM_INI_OK:
  2002.     PostNumMessage HWND CODE 3 0
  2003.  
  2004.     if ABORT == 1 then
  2005.         goto LOGIN_ABORT
  2006.     endif
  2007.         
  2008.     n = COUNT
  2009.  
  2010.     sleep 1
  2011. Retry_Login:
  2012.     timeout 60
  2013.     PostNumMessage HWND CODE 5 0
  2014.  
  2015. ;    if GATEWAY == "TELNET" then
  2016.     if TYPE == 4 then
  2017.         sendstr "ATD "+NUMBER+cr
  2018.     else
  2019.         sendstr "ATD"+PHONE
  2020.         if ZERO == 1 then
  2021.             sendstr "0,,"
  2022.         endif
  2023.         sendstr NUMBER+cr
  2024.     endif
  2025.  
  2026.     case "CONNECT" "BUSY"  "NO " "ERROR" "OK"
  2027.     goto CONNECT   *       *     *       *    CONNECT_ERR
  2028.     stat = result
  2029.  
  2030.     if ABORT == 1 then
  2031.         goto LOGIN_ABORT
  2032.     endif
  2033.  
  2034.     n = n-1
  2035.     if n > 0 then
  2036.         PostNumMessage HWND CODE 4 0
  2037.         i = WAIT
  2038.         while i > 0
  2039.             wait 1
  2040.             if ABORT == 1 then
  2041.                 goto LOGIN_ABORT
  2042.             endif
  2043.             i = i-1
  2044.         wend
  2045.         goto Retry_Login
  2046.     endif
  2047.  
  2048.     result = stat
  2049.     goto CONNECT_ERR CONNECT_ERR CONNECT_ERR CONNECT_ERR CONNECT_ERR
  2050.  
  2051. CONNECT:
  2052.         PostNumMessage HWND CODE 6 0
  2053.  
  2054.         switch GATEWAY "OTHERAP" "TYMPAS"  "TRIP"  "PCVAN"  "NIFTY"
  2055.         goto           *         GW_TYMPAS GW_TRIP GW_PCVAN GW_NIFTY MIX_LOGIN_START
  2056.  
  2057. ; 地方アクセスポイント
  2058.     send " P"+cr
  2059.     case "NIKKEI" "NO "
  2060.     goto *        CONNECT_ERR
  2061.     wait 1
  2062.     send "C MIX"+cr
  2063.  
  2064. MIX_LOGIN_START:
  2065.     setdir 0 LOGPATH
  2066.     setdir 1 DOWNPATH
  2067.     if DATELOG == 0 then
  2068.         LOGNAME = LOGFILE
  2069.     endif
  2070.     setparam 3 3 MAKELOG
  2071.  
  2072.     case "enter \"mix\"): " "login: " "NO CA"
  2073.     goto *                  *         LOGIN_ERR LOGIN_ERR
  2074.     sendstr "mix"+cr
  2075.  
  2076.     PostNumMessage HWND CODE 7 0
  2077.  
  2078.     case "Name? " "NO CA"    "保守作業"
  2079.     goto *        LOGIN_ERR  MENT_STOP  ID_ERR
  2080.     send UID+CR
  2081. ;    PostNumMessage HWND CODE 8 0
  2082.  
  2083.     case "Password: " "NO "        "既に"         "Name? "
  2084.     Goto *            LOGIN_ERR PASSWORD_ERROR PASSWORD_ERROR PASSWORD_ERROR
  2085.     send UPASSWD+CR
  2086.     PostNumMessage HWND CODE 8 0
  2087.  
  2088.     chrwait 1
  2089. LOGON_RECHECK:
  2090.     case ":\w"       "(?はヘルプ): " "Name? "        ".More..\w"
  2091.     goto OPTION_SET  MENU_OFF        PASSWORD_ERROR  LOGON_MORE PROMPT_ERR
  2092.  
  2093. LOGON_MORE:
  2094.     wait 1
  2095.     send cr
  2096.     goto LOGON_RECHECK
  2097.  
  2098. MENU_OFF:
  2099.     send "8"+cr
  2100.     case ":\w"
  2101.  
  2102. OPTION_SET:
  2103.     send "opt terse term pagelen 0 term width 90 term tty q"+cr
  2104.     case ":\w"
  2105.     send "opt head 0 mail call yes down zmodem up zmodem q"+cr
  2106.     case ":\w"
  2107.     send "opt edit quiet autodownload y mymessage yes q"+cr
  2108.     case ":\w"
  2109.     send "opt resume yes q"+cr
  2110.  
  2111.     PostNumMessage HWND CODE 9 0
  2112.     case ":\w"
  2113.     
  2114.     end
  2115.  
  2116. LOGIN_ABORT:
  2117.     PostNumMessage HWND CODE 107 0
  2118.     goto LOGIN_EXIT
  2119.  
  2120. MENT_STOP:
  2121.     PostNumMessage HWND CODE 106 0
  2122.     goto LOGIN_EXIT
  2123.     
  2124. PROMPT_ERR:
  2125.     PostNumMessage HWND CODE 105 0
  2126.     goto LOGIN_EXIT
  2127.  
  2128. PASSWORD_ERROR:
  2129. ;パスワードエラーの場合には強制切断を行う
  2130.     gosub Hungup
  2131.     PostNumMessage HWND CODE 104 0
  2132.     goto LOGIN_EXIT
  2133.     
  2134. ID_ERR:
  2135.     PostNumMessage HWND CODE 103 0
  2136.     goto LOGIN_EXIT
  2137.     
  2138. LOGIN_ERR:
  2139.     PostNumMessage HWND CODE 102 0
  2140.     goto LOGIN_EXIT
  2141.     
  2142. CONNECT_ERR:
  2143.     PostNumMessage HWND CODE 101 0
  2144.     goto LOGIN_EXIT
  2145.  
  2146. MODEM_ERR:
  2147.     PostNumMessage HWND CODE 100 0
  2148.     goto LOGIN_EXIT
  2149.  
  2150. LOGIN_EXIT:
  2151.     pclose
  2152.     end
  2153.  
  2154. ; 強制的に回線を切断する
  2155. Hungup:
  2156.     wait 1
  2157.     send "+"
  2158.     send "+"
  2159.     send "+"
  2160.  
  2161.     case "OK"      "NO "
  2162.     wait 1
  2163.     send "ATH0"+cr ""     ""
  2164.  
  2165. Hungup_END:
  2166.     return
  2167.  
  2168. ;
  2169. ; TYMPAS 経由
  2170. GW_TYMPAS:
  2171.         case    "f"       "log in: "             "connected"
  2172.         send    "I"       GWID+":584;"+GWPASS+CR ""              ""
  2173.         goto    GW_TYMPAS GW_TYMPAS              MIX_LOGIN_START LOGIN_ERR
  2174.  
  2175. ;
  2176. ; Tri-P 経由
  2177. GW_TRIP:
  2178.         wait 2
  2179.         send "@"
  2180.         wait 1
  2181.         send CR
  2182.  
  2183.         case "*"
  2184.         goto *  LOGIN_ERR
  2185.  
  2186.         send "N"+GWID+GWPASS+"-MIX"+CR
  2187.         case "TED"           "*\w"
  2188.         goto MIX_LOGIN_START LOGIN_ERR LOGIN_ERR
  2189.  
  2190. ; PC-VAN 経由の接続
  2191.  
  2192. GW_PCVAN:
  2193.     CHRWAIT 0
  2194.     wait  5
  2195.     timeout 60
  2196.     send  "PCVAN"+CR
  2197.  
  2198. PCVAN_LOGIN:
  2199.     case    "ID: "   "ワード: " "(Y,N,GW)=\w" "(Y,N)=\w" "システムチョウセイノタメ"  "タダイマ カイセンハ" "NO "
  2200.     send    GWID+CR     GWPASS+CR   "N"+CR          "N"+CR     ""              ""            ""        ""
  2201.     goto    PCVAN_LOGIN PCVAN_LOGIN PCVAN_LOGIN   *             LOGIN_ERR       LOGIN_ERR     LOGIN_ERR LOGIN_ERR
  2202.  
  2203.     case "(H,Q,J)=\w"
  2204.     send "jINETTEL"+cr
  2205.     case "(H,Q,E,J)=\w"
  2206.     send "2"+cr
  2207.  
  2208.     case "telnet> "
  2209.     send "open mix.or.jp"+cr
  2210.  
  2211.     goto MIX_LOGIN_START
  2212.             
  2213. ;------------------------------------------------------------------------------
  2214. MIX_LOGOUT:
  2215. ;
  2216. ; ログアウト
  2217. ;
  2218.     chrwait 1
  2219. ;
  2220.     gosub INITIAL
  2221. ;
  2222.     FilterOn 0
  2223.     if cd != 1 then
  2224.         goto Logout_End
  2225.     endif
  2226.  
  2227.     if LISTING then 
  2228.         gosub EXITLISTING
  2229.     endif
  2230.     if CHAT then 
  2231.         gosub EXITCHAT
  2232.     endif
  2233. ;
  2234. Retry_Out:
  2235.         if cd != 1 then
  2236.                 goto Logout_End
  2237.         endif
  2238.         send "bye"+cr
  2239.         case "NO CA" ":\w"      "(y/n)? Y\08\w" "(y/n)?"  "E:\w"    "J)=\w"  "log in:\w"   "\n*\w"
  2240.         send ""      "q"+cr     "no"+cr         "n"+cr    "w"+cr    "q"+cr    ""           ""       ""
  2241.         goto *       Retry_Out  Retry_Out       Retry_Out Retry_Out Retry_Out TYMPAS_OUT   TRIP_OUT *
  2242.  
  2243. Logout_End:
  2244.         setparam 3 3 0
  2245.  
  2246.         wait 1
  2247.         pclose
  2248.         end
  2249.  
  2250. TYMPAS_OUT:
  2251. TRIP_OUT:
  2252.         send "+"
  2253.         send "+"
  2254.         send "+"
  2255.         case "OK"
  2256.         send "ATH0"+cr ""
  2257.         goto Logout_End Logout_End
  2258.  
  2259. ;------------------------------------------------------------------------------
  2260. MIX_LOGIN_NEWUSER:
  2261. ;
  2262. ; MIX オートログインマクロ(新規入会)
  2263. ;
  2264. ; HWND    : 通知先ウィンドウ
  2265. ; CODE    : 通知コード
  2266. ; UID    : ID(ユーザー指定IDがあれば)
  2267. ; UPASSWD : パスワード
  2268. ; PHONE    : "T" or "P"
  2269. ; MODEM    : モデム初期化コマンド
  2270. ; NUMBER : 電話番号
  2271. ; COUNT : リトライ回数
  2272. ; WAIT    : リトラリ間隔
  2273. ; TYPE    : アクセスポイントタイプ (0:東京 1:地方AP)
  2274. ; ZERO    : 0 発信
  2275. ; ABORT : 強制中断
  2276. ; GATEWAY : "PCVAN" or "NIFTY"
  2277. ; GWID    : ID
  2278. ; GWPASS : パスワード
  2279. ;
  2280. ; TEMPNAME : MIX番号(入会登録用)
  2281. ; TEMPPASS : 仮パスワード
  2282. ;
  2283. ; 通信ポートパラメータ設定
  2284. ;    9600/8/s1/Non/S-JIS/BS/Log-FileNon
  2285. ;
  2286.     gosub INITIAL
  2287.  
  2288. ;    setparam 1 0 7
  2289.     setparam 1 1 1
  2290.     setparam 1 2 0
  2291.     setparam 1 3 2
  2292.     setparam 2 3 0
  2293.     setparam 2 4 1
  2294.     setparam 3 3 0
  2295.  
  2296.     if ABORT == 1 then
  2297.         goto LOGIN_ABORT
  2298.     endif
  2299.         
  2300. ;    if GATEWAY == "TELNET" then
  2301.     if TYPE == 4 then
  2302.         setparam 6 0 15
  2303.     endif
  2304.  
  2305.     popen
  2306.     PostNumMessage HWND CODE 1 0
  2307.     sleep 2
  2308.  
  2309. ; モデム初期化
  2310.     timeout 3
  2311.     chrwait 1
  2312.     send "AT"+cr
  2313.     case "OK"             "n:"      ":"      "?)"
  2314.     send ""               "quit"+cr "bye"+cr "quit"+cr ""
  2315.     goto NEWUSER_MODEM_OK *         *        *         NEWUSER_MODEM_ERR
  2316.     timeout 10
  2317. NEWUSER_RE_BYE:
  2318.     if ABORT == 1 then
  2319.         goto NEWUSER_LOGIN_ABORT
  2320.     endif
  2321.     case "NO " "R:\w"           "M:\w"           ":\w"            "?)"
  2322.     send ""    "bye"+cr         "bye"+cr         "bye"+cr         "quit"+cr      ""
  2323.     goto *     NEWUSER_RE_BYE   NEWUSER_RE_BYE   NEWUSER_RE_BYE   NEWUSER_RE_BYE NEWUSER_MODEM_ERR
  2324.  
  2325.     timeout 3
  2326.     wait 1
  2327.     send "AT"+cr
  2328.     case "OK"
  2329.     goto *    NEWUSER_MODEM_ERR
  2330.  
  2331. NEWUSER_MODEM_OK:
  2332.     PostNumMessage HWND CODE 2 0
  2333.     if ABORT == 1 then
  2334.         goto NEWUSER_LOGIN_ABORT
  2335.     endif
  2336.  
  2337. ;    if GATEWAY == "TELNET" then
  2338.     if TYPE == 4 then
  2339.         goto NEWUSER_MODEM_INI_OK
  2340.     endif
  2341.  
  2342.     send "AT"+MODEM+cr
  2343.     case "OK"                 "ERROR"
  2344.     goto NEWUSER_MODEM_INI_OK *       NEWUSER_MODEM_ERR
  2345.  
  2346.     wait 1
  2347.     send "ATZ"+cr
  2348.     case "OK"                 "ERROR"
  2349.     goto NEWUSER_MODEM_INI_OK NEWUSER_MODEM_ERR NEWUSER_MODEM_ERR
  2350.  
  2351. NEWUSER_MODEM_INI_OK:
  2352.     PostNumMessage HWND CODE 3 0
  2353.  
  2354.     if ABORT == 1 then
  2355.         goto NEWUSER_LOGIN_ABORT
  2356.     endif
  2357.         
  2358.     n = COUNT
  2359.  
  2360.     sleep 1
  2361. NEWUSER_RETRY_LOGIN:
  2362.     timeout 60
  2363.     PostNumMessage HWND CODE 5 0
  2364.  
  2365. ;    if GATEWAY == "TELNET" then
  2366.     if TYPE == 4 then
  2367.         sendstr "ATD "+NUMBER+cr
  2368.     else
  2369.         sendstr "ATD"+PHONE
  2370.         if ZERO == 1 then
  2371.             sendstr "0,,"
  2372.         endif
  2373.         sendstr NUMBER+cr
  2374.     endif
  2375.  
  2376.     case "CONNECT"       "BUSY" "NO " "ERROR" "OK"
  2377.     goto NEWUSER_CONNECT *      *     *       *    NEWUSER_CONNECT_ERR
  2378.     stat = result
  2379.  
  2380.     if ABORT == 1 then
  2381.         goto NEWUSER_LOGIN_ABORT
  2382.     endif
  2383.  
  2384.     n = n-1
  2385.     if n > 0 then
  2386.         PostNumMessage HWND CODE 4 0
  2387.         i = WAIT
  2388.         while i > 0
  2389.             wait 1
  2390.             if ABORT == 1 then
  2391.                 goto NEWUSER_LOGIN_ABORT
  2392.             endif
  2393.             i = i-1
  2394.         wend
  2395.         goto NEWUSER_RETRY_LOGIN
  2396.     endif
  2397.  
  2398.     result = stat
  2399.     goto NEWUSER_CONNECT_ERR NEWUSER_CONNECT_ERR NEWUSER_CONNECT_ERR NEWUSER_CONNECT_ERR NEWUSER_CONNECT_ERR
  2400.  
  2401. NEWUSER_CONNECT:
  2402.     PostNumMessage HWND CODE 6 0
  2403.  
  2404.     switch GATEWAY "OTHERAP" "PCVAN"          "NIFTY"
  2405.     goto           *         NEWUSER_GW_PCVAN NEWUSER_GW_NIFTY NEWUSER_MIX_LOGIN_START
  2406.  
  2407. ; 地方アクセスポイント
  2408.     send " P"+cr
  2409.     case "NIKKEI" "NO "
  2410.     goto *        NEWUSER_CONNECT_ERR
  2411.     wait 1
  2412.     send "C MIX"+cr
  2413.  
  2414. NEWUSER_MIX_LOGIN_START:
  2415.     setdir 0 LOGPATH
  2416.     setdir 1 DOWNPATH
  2417.     if DATELOG == 0 then
  2418.         LOGNAME = LOGFILE
  2419.     endif
  2420.     setparam 3 3 MAKELOG
  2421.  
  2422.     case "enter \"mix\"): " "login: " "NO CA"
  2423.     goto *                  *         NEWUSER_LOGIN_ERR NEWUSER_LOGIN_ERR
  2424.     sendstr "mix"+cr
  2425.  
  2426.     PostNumMessage HWND CODE 7 0
  2427.  
  2428.     case "Name? " "NO CA"            "保守作業"
  2429.     goto *        NEWUSER_LOGIN_ERR  NEWUSER_MENT_STOP  NEWUSER_ID_ERR
  2430.  
  2431.     send "new"+cr
  2432.     case "\r\n登録しますか (y/n)? "
  2433.     send "y"+CR                 ""
  2434.     goto *                      NEWUSER_LOGIN_ERR
  2435.  
  2436. NewStart:
  2437.     case "\r\nMIX 番号:" "\r\n仮パスワード:"
  2438.     send TEMPNAME+CR     TEMPPASS+CR         ""
  2439.     goto NewStart        *                   NEWUSER_LOGIN_ERR
  2440.  
  2441. NewName:
  2442.     case "\r\n姓:"   "\r\n名:"
  2443.     send Name1+CR     Name2+CR   ""
  2444.     goto NewName      *          NEWUSER_LOGIN_ERR
  2445.  
  2446.     case "\r\nこれでよろしいですか (y/n)?"
  2447.     send "y"+CR                           ""
  2448.     goto *                                NEWUSER_LOGIN_ERR
  2449.  
  2450.     case "MIX での名前"
  2451.     goto *              NEWUSER_LOGIN_ERR
  2452.  
  2453.     YesNo = "y"
  2454.     if strlen(UID) > 0 then
  2455.         YesNo = "n"
  2456.     endif
  2457.  
  2458.     case "\r\nこれでよろしいですか (y/n)?"
  2459.     send YesNo+CR                         ""
  2460.     goto *                                NEWUSER_LOGIN_ERR
  2461.  
  2462.     if YesNo == "y" then
  2463.         goto NewName_OK
  2464.     endif
  2465.  
  2466.     case "\r\nニックネーム:"
  2467.     goto *                    NEWUSER_LOGIN_ERR
  2468.  
  2469. NewName_Org:
  2470.     send UID+CR
  2471.  
  2472.     case "\r\nこれでよろしいですか  (y/n)?" "別の名前を考えて下さい。"
  2473.     send "y"+CR                             ""                         ""
  2474.     goto NewName_OK                         *                          NEWUSER_LOGIN_ERR
  2475.  
  2476.     case "\r\nニックネーム:"
  2477.     goto *                    NEWUSER_LOGIN_ERR
  2478.  
  2479. ; すでに指定ニックネームが使われている場合
  2480.     NewUserID UID UID
  2481.     goto NewName_Org NEWUSER_LOGIN_ERR
  2482.  
  2483. NewName_OK:
  2484.     case "-->\w"
  2485.     send RESUME1+CR ""
  2486.     goto *             NEWUSER_LOGIN_ERR
  2487.  
  2488.     case "-->\w"
  2489.     send RESUME2+CR ""
  2490.     goto *             NEWUSER_LOGIN_ERR
  2491.  
  2492.     case "-->\w"
  2493.     send RESUME3+CR ""
  2494.     goto *             NEWUSER_LOGIN_ERR
  2495.  
  2496.     case "\r\nこれでよろしいですか (y/n)?"
  2497.     send "y"+CR                             ""
  2498.     goto *                                  NEWUSER_LOGIN_ERR
  2499.  
  2500.     case "\r\n新しいパスワード:"
  2501.     send UPASSWD+CR              ""
  2502.     goto *                       NEWUSER_LOGIN_ERR
  2503.  
  2504.     case "\r\n新しいパスワード:"
  2505.     send UPASSWD+CR              ""
  2506.     goto *                       NEWUSER_LOGIN_ERR
  2507.  
  2508.     PostNumMessage HWND CODE 8 0
  2509.  
  2510.     chrwait 1
  2511. NEWUSER_LOGON_RECHECK:
  2512.     case ":\w"              "(?はヘルプ): "  "Name? "                ".More..\w"
  2513.     goto NEWUSER_OPTION_SET NEWUSER_MENU_OFF NEWUSER_PASSWORD_ERROR  NEWUSER_LOGON_MORE PROMPT_ERR
  2514.  
  2515. NEWUSER_LOGON_MORE:
  2516.     wait 1
  2517.     send cr
  2518.     goto NEWUSER_LOGON_RECHECK
  2519.  
  2520. NEWUSER_MENU_OFF:
  2521.     send "8"+cr
  2522.     case ":\w"
  2523.  
  2524. NEWUSER_OPTION_SET:
  2525.     send "opt terse term pagelen 0 term width 90 term tty q"+cr
  2526.     case ":\w"
  2527.     send "opt head 0 mail call yes down zmodem up zmodem q"+cr
  2528.     case ":\w"
  2529.     send "opt edit quiet autodownload y mymessage yes q"+cr
  2530.     PostNumMessage HWND CODE 9 0
  2531.  
  2532.     case ":\w"
  2533.  
  2534.     end
  2535.  
  2536. NEWUSER_LOGIN_ABORT:
  2537.     PostNumMessage HWND CODE 107 0
  2538.     goto NEWUSER_LOGIN_EXIT
  2539.  
  2540. NEWUSER_MENT_STOP:
  2541.     PostNumMessage HWND CODE 106 0
  2542.     goto NEWUSER_LOGIN_EXIT
  2543.     
  2544. NEWUSER_PROMPT_ERR:
  2545.     PostNumMessage HWND CODE 105 0
  2546.     goto NEWUSER_LOGIN_EXIT
  2547.  
  2548. NEWUSER_PASSWORD_ERROR:
  2549. ;パスワードエラーの場合には強制切断を行う
  2550.     gosub Hungup
  2551.     PostNumMessage HWND CODE 104 0
  2552.     goto NEWUSER_LOGIN_EXIT
  2553.     
  2554. NEWUSER_ID_ERR:
  2555.     PostNumMessage HWND CODE 103 0
  2556.     goto NEWUSER_LOGIN_EXIT
  2557.     
  2558. NEWUSER_LOGIN_ERR:
  2559.     gosub Hungup
  2560.     PostNumMessage HWND CODE 102 0
  2561.     goto NEWUSER_LOGIN_EXIT
  2562.     
  2563. NEWUSER_CONNECT_ERR:
  2564.     PostNumMessage HWND CODE 101 0
  2565.     goto NEWUSER_LOGIN_EXIT
  2566.  
  2567. NEWUSER_MODEM_ERR:
  2568.     PostNumMessage HWND CODE 100 0
  2569.     goto NEWUSER_LOGIN_EXIT
  2570.  
  2571. NEWUSER_LOGIN_EXIT:
  2572.     pclose
  2573.     end
  2574.  
  2575. ; PC-VAN 経由の接続
  2576.  
  2577. NEWUSER_GW_PCVAN:
  2578.     CHRWAIT 0
  2579.     wait  5
  2580.     timeout 60
  2581.     send  "PCVAN"+CR
  2582.  
  2583. NEWUSER_PCVAN_LOGIN:
  2584.     case    "ID: "   "ワード: " "(Y,N,GW)=\w" "(Y,N)=\w" "システムチョウセイノタメ"  "タダイマ カイセンハ" "NO "
  2585.     send    GWID+CR     GWPASS+CR   "N"+CR          "N"+CR     ""              ""            ""        ""
  2586.     goto    NEWUSER_PCVAN_LOGIN NEWUSER_PCVAN_LOGIN NEWUSER_PCVAN_LOGIN   *             NEWUSER_LOGIN_ERR       NEWUSER_LOGIN_ERR     NEWUSER_LOGIN_ERR LOGIN_ERR
  2587.  
  2588.     case "(H,Q,J)=\w"
  2589.     send "jINETTEL"+cr
  2590.     case "(H,Q,E,J)=\w"
  2591.     send "2"+cr
  2592.  
  2593.     case "telnet> "
  2594.     send "open mix.or.jp"+cr
  2595.  
  2596.     goto NEWUSER_MIX_LOGIN_START
  2597.