home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 March / VPR9603A.ISO / fwindows / nah126 / nifauto.scr < prev    next >
Text File  |  1995-10-28  |  95KB  |  3,948 lines

  1. ;/////////////////////////////////////////////////
  2. ;///    NIFAUTO FOR HIDETERM
  3. ;///    VERSION:1.26
  4. ;///    DATE:OCTOBER 29, 1995
  5. ;///    COPYRIGHT (C) 1992 - 1995
  6. ;///    YOSHIKI OSAKO (NIFTYSERVE NCC00744)
  7. ;/////////////////////////////////////////////////
  8.  
  9. ;///// INITIAL SETTING /////
  10. SetAppIni:
  11.     endscroll
  12.     gethostname #HostName
  13.     getini "HIDETERM.INI", #HostName, "ScriptFile", #Script
  14.     @App = drop(toupper(#Script), ".SCR")
  15.     if (@App == "")
  16.         #Msg = "ホスト名の取得に失敗しました。"
  17.         goto ErrorHangup
  18.     endif
  19.     @AppIni = @App + ".INI"
  20.     getini @AppIni, @App, "sDisp", @@sDisp
  21.     getini @AppIni, @App, "sProp", @@sProp
  22.  
  23. CheckVersion:
  24.     getversion ##Ver
  25.     if (##Ver < 219)
  26.         #Msg = "秀Term Version 2.19以上で使用して下さい。"
  27.         goto ErrorHangup
  28.     endif
  29.     getini @AppIni, @App, "Version", ##AppVer
  30.     if (##AppVer < 126)
  31.         #Msg = @AppIni + "のアップデートをして下さい。"
  32.         goto ErrorHangup
  33.     endif
  34.     if ((not %%NAH01) or (not %%NAH02))
  35.         #Msg = "Nifautoから起動させてください。"
  36.         goto ErrorHangup
  37.     endif
  38.     @@AppSet = length(search(%%NAH01, %%NAH02))
  39.  
  40. CheckIniFile:
  41.     getwindir #WinDir
  42.     if (not existfile(#WinDir + "\" + @AppIni))
  43.         #Msg = @AppIni + "がありません。^M"
  44.         #Msg = #Msg + "NIFAUTO.EXEを使用してINI FILEを作成して下さい。"
  45.         goto ErrorHangup
  46.     endif
  47.  
  48. SetTitle:
  49.     if (@@AppSet == 0) title @App + " (未登録)"
  50.     else title @App
  51.  
  52. CheckNode:
  53.     ##i = 1
  54.     while(##i < 6)
  55.         getini @AppIni, "External", "Host" + ##i, #CurHost
  56.         if (#CurHost == #HostName)
  57.             getini @AppIni, "External", "Node" + ##i, ##Node
  58.             breakloop
  59.         endif
  60.         ##i = ##i + 1
  61.     endwhile
  62.  
  63. CheckPath:
  64.     getini "HIDETERM.INI", "HideTerm", "UploadPath", @UpPath
  65.     getini "HIDETERM.INI", "HideTerm", "DownloadPath", @DownPath
  66.     getini "HIDETERM.INI", "HideTerm", "LogPath", @LogPath
  67.     if (part(@UpPath, length(@UpPath) - 1, 1) != "\")
  68.         @UpPath = @UpPath + "\"
  69.     endif
  70.     if (part(@DownPath, length(@DownPath) - 1, 1) != "\")
  71.         @DownPath = @DownPath + "\"
  72.     endif
  73.     if (part(@LogPath, length(@LogPath) - 1, 1) != "\")
  74.         @LogPath = @LogPath + "\"
  75.     endif
  76.  
  77. CheckId:
  78.     call SetId
  79.     getini @AppIni, "Personal", "ExtraId", #Hello
  80.     if (#Hello != "") @@Hello = 1
  81.     else @@Hello = 0
  82.  
  83. CheckActFileExist:
  84.     call SetActFile 0
  85.     ##MesFlag = part(#return, 0, 1)
  86.     ##LibFlag = part(#return, 1, 1)
  87.     ##SelFlag = part(#return, 2, 1)
  88.     ##FreFlag = part(#return, 3, 1)
  89.     ##SwRgFlag = part(#return, 4, 1)
  90.     @ErrLog = @LogPath + "NIFERR.LOG"
  91.     getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
  92.  
  93. CheckSign:
  94.     getini @AppIni, @App, "sPara", @sPara
  95.     getini @AppIni, @App, "sRem", @sRem
  96.     if (@sPara == "") @sPara = "/"
  97.     if (@sRem == "") @sRem = ";"
  98.  
  99. CheckDate:
  100.     getini @AppIni, @App, "TimeDiff", ##TDiff
  101.     if (##TDiff != 0)
  102.         call DateAdjust ##TDiff
  103.         #Date = part(#return, 0, 6)
  104.         #Time = part(#return, 6, 4)
  105.     else
  106.         getdate #Date
  107.         gettime #Time
  108.     endif
  109.     getweek #Week
  110.     @Yr = part(#Date, 0, 2)
  111.     @Mon = part(#Date, 2, 2)
  112.     @Day = part(#Date, 4, 2)
  113.     @LogDate = @Mon + @Day
  114.     ##Now = value(part(#Time, 0, 4))
  115.     datetolinear #Date, ##TD
  116.     getini @AppIni, @App, "LogTime", ##STime
  117.  
  118. CheckJobLevel:
  119.     getini @AppIni, "Level", "Read", #ReadLevel
  120.     getini @AppIni, "Level", "List", #ListLevel
  121.     getini @AppIni, "Level", "News", #NewsLevel
  122.     getini @AppIni, "Level", "Bill", ##BillDate
  123.     getini @AppIni, "Level", "Clip", #ClipLevel
  124.     getini @AppIni, "Level", "ClipLimit", ##ClipLimit
  125.     getini @AppIni, @App, "TermChange", ##TermFlag
  126.     getini @AppIni, @App, "FoptChange", ##FoptFlag
  127.     getini @AppIni, @App, "ChangeRPattern", ##CRPattern
  128.     getini @AppIni, @App, "ChangeLPattern", ##CLPattern
  129.     getini @AppIni, @App, "ChangeNPattern", ##CNPattern
  130.     getini @AppIni, @App, "ChangeBPattern", ##CBPattern
  131.     getini @AppIni, @App, "ChangeCPattern", ##CCPattern
  132.     if (##BillDate == value(@Day)) @@BillLevel = 1
  133.     else @@BillLevel = 0
  134.     ##p = length(drop("日月火水木金土", #Week)) / 2
  135.     @@ReadLevel = value(part(#ReadLevel, ##p, 1))
  136.     @@ListLevel = value(part(#ListLevel, ##p, 1))
  137.     @@ClipLevel = value(part(#ClipLevel, ##p, 1))
  138.     @@NewsLevel = value(part(#NewsLevel, ##p, 1))
  139.     if (@@ClipLevel == 1 and ##ClipLimit == 0) ##CCPattern = 1
  140.  
  141. SetAdjustTime:
  142.     getini @AppIni, @App, "AdjustTime", ##AdjTime
  143.     getini @AppIni, "External", "HtDir", #HtDir
  144.     if (part(#HtDir, length(#HtDir) - 1, 1) != "\") #HtDir = #HtDir + "\"
  145.     if (##AdjTime == 1)
  146.         if (existfile(#HtDir + "SETCLKD.EXE"))
  147.             @AdjustClock = #HtDir + "SETCLKD /DS:10 "
  148.         else
  149.             #Msg = "SETCLKD.EXEがありません。^M"
  150.             #Msg = #Msg + "PC内部時刻の補正は行いません。"
  151.             timeoutmessage #Msg, @@sDisp
  152.             ##AdjTime = 0
  153.             putini @AppIni, @App, "AdjustTime", ##AdjTime
  154.         endif
  155.     endif
  156.  
  157. SetAutoHang:
  158.     getini @AppIni, @App, "AutoHang", @@HangMin
  159.     setautohangup @@HangMin
  160.  
  161. CheckTermSetting:
  162.     getini @AppIni, @App, "Terminal", #TermSet
  163.     @@tPage = value(part(#TermSet, 1, 1))
  164.  
  165. CheckDlmOn:
  166.     getini @AppIni, @App, "DlmOn", ##DlmOn
  167.     if(##DlmOn == 1) @@DlmOn = 0
  168.     else @@DlmOn = 1
  169.  
  170. CheckLoginPattern:
  171.     getini @AppIni, @App, "LoginPattern", @@LoginPattern
  172.  
  173. ;///// LOGIN PROCEDURE /////
  174. ConnectNif:
  175.     Afterhangup    Atoshimatsu
  176.     @@ErrorLevel = 0
  177.     switch ##Node
  178.         case 0    ;Road 1
  179.             #LoginCmd = ".00+"
  180.             send #LoginCmd
  181.         case 1    ;Road 2
  182.             #LoginCmd = "C NIF^M"
  183.             send " P^M"
  184.         case 3    ;CompuServe
  185.             #LoginCmd = "CIS^M"
  186.             send "^M"
  187.         case 4    ;CompuPass
  188.             #LoginCmd = "NIFTY^M"
  189.             send "^M"
  190.         case 5    ;Internet
  191.             send "TELNET R2.NIFTYSERVE.OR.JP^M"
  192.             call DefaultLogStart
  193.         case default
  194.             #LoginCmd = "C NIF^M"
  195.     endswitch
  196.  
  197. Login:
  198.     timeout 30
  199.     ##i = 0
  200.     ##j = 0
  201.     loopswitch
  202.         case "01+", "*", "Host Name:"
  203.             if (##i < 5)
  204.                 send #LoginCmd
  205.                 ##i = ##i + 1
  206.             else
  207.                 @@ErrorLevel = 1
  208.                 goto ErrorCheck
  209.             endif
  210.         case "User ID:"
  211.             millisleep 1
  212.             send %CISID +"^M"
  213.         case "Password:"
  214.             millisleep 1
  215.             send %%CISPassword + "^M"
  216.         case postmilliidle(@@sProp) "Enter choice !", "enter choice !"
  217.             millisleep 1
  218.             send "GO NIF-4^M"
  219.         case "<CR> for more !", "^G^G^G^G"
  220.             send "^M"
  221.         case "COM"
  222.             call DefaultLogStart
  223.         case "tion-ID  --->"
  224.             millisleep 1
  225. ;            if (#LoginCmd == "NIFTY^M" or #LoginCmd == "CIS^M")
  226.             if (##Node > 2)
  227.                 call DefaultLogStart
  228.                 port data=8 parity=none
  229.             endif
  230.             send "SVC^M"
  231.         case "User-ID  --->"
  232.             millisleep 1
  233.             send @NifId + "^M"
  234.         case "User-ID Error"
  235.             #Msg = @NifID + "はエラーです。^M"
  236.             #Msg = #Msg + "正しいユーザIDを入力して下さい。"
  237.             input #Msg, @NifID
  238.             if (cancel)
  239.                 hangup
  240.                 exit
  241.             endif
  242.             if (@@LoginId == 0)
  243.                 putini @AppIni, "Personal", "DefaultId", @NifId
  244.             else
  245.                 putini @AppIni, "Personal", "ExtraId", @NifId
  246.             endif
  247.             send @NifId + "^M"
  248.         case "Password --->"
  249.             millisleep 1
  250.             send @NifPass + "^M"
  251.         case "Password ERROR"
  252.             #Msg = @NifPass + "はエラーです。^M"
  253.             #Msg = #Msg + "正しいパスワードを入力して下さい。"
  254.             secretinput #Msg, @NifPass
  255.             if (cancel)
  256.                 hangup
  257.                 exit
  258.             endif
  259.             if (@@LoginId == 0)
  260.                 putini @AppIni, "Personal", "DefaultPassword", @NifPass
  261.                 %%NifPassword = @NifPass
  262.             else
  263.                 putini @AppIni, "Personal", "ExtraPassword", @NifPass
  264.                 %%NifPassword2 = @NifPass
  265.             endif
  266.             send @NifPass + "^M"
  267.         case "ようこそNIF"
  268.             breakloop
  269.         case "NO CARRIER"
  270.             hangup
  271.             exit
  272.         case "ERROR INC", "本日は定期メンテナンスのためサービス開始を", \
  273.              "Service is currently unavailable"
  274.             @@ErrorLevel = 1
  275.             goto ErrorCheck
  276.         case timeout
  277.             @@ErrorLevel = 1
  278.             goto ErrorCheck
  279.     endloop
  280.  
  281. CheckFirstLogin:
  282.     timeout 0
  283.     wait "前回LOG OUT "
  284.     getline #Last
  285.     #LD = part(#Last, 0, 2) + part(#Last, 3, 2) + part(#Last, 6, 2)
  286.     ##LT = value(part(#Last, 12, 2) + part(#Last, 15, 2))
  287.     datetolinear #LD, ##LD
  288.     ##D = ##TD - ##LD
  289.     ##S = ##Now - ##STime
  290.     ##T = ##LT - ##STime
  291.     if (##D == 0)
  292.         if ((##S < 0 and ##T <= 0) or (##S >= 0 and ##T > 0))
  293.             ##FirstLogin = 0
  294.         else
  295.             ##FirstLogin = 1
  296.         endif
  297.     elseif (##D == 1)
  298.         if (##S < 0 and ##T > 0)
  299.             #FirstLogin = 0
  300.         else
  301.             ##FirstLogin = 1
  302.         endif
  303.     else
  304.         ##FirstLogin = 1
  305.     endif
  306.     if (##FirstLogin == 0)
  307.         @@ReadLevel    = ##CRPattern
  308.         @@ListLevel    = ##CLPattern
  309.         @@NewsLevel    = ##CNPattern
  310.         @@BillLevel    = ##CBPattern
  311.         @@ClipLevel = ##CCPattern
  312.     endif
  313.  
  314. CheckMailReceive:
  315.     ##MailFlag = 0
  316.     ##ClipFlag = 0
  317.     loopswitch
  318.         case "届いています(未読"
  319.             ##MailFlag = 1
  320.         case "」に記事が"
  321.             ##ClipFlag = 1
  322.         case "今週のお知らせ"
  323.             loopswitch
  324.                 case "番号またはコマンド (改行で次頁)^M^J>", \
  325.                      "番号またはコマンド (改行でトップメニュー)^M^J>"
  326.                     send "^M"
  327.                 case postmilliidle(100) "^M^J>"
  328.                     goto MainPreApp
  329.             endloop
  330.         case postmilliidle(100) "^M^J>"
  331.             breakloop
  332.     endloop
  333.  
  334. ;///// MAIN ROUTINE /////
  335. MainPassChangeWarning:
  336.     if (@Day == "01" and ##FirstLogin == 1)
  337.         #Msg = "月が変わりました。パスワード盗用防止のために^M"
  338.         #Msg = #Msg + "パスワードを変更しましょう。但し、変更はユー^M"
  339.         #Msg = #Msg + "ザーの責任において、手動で変更してください。"
  340.         timeoutmessage #Msg, @@sDisp
  341.     endif
  342.  
  343. MainPreApp:
  344.     call MainMenuKey
  345.     call SubPreApp
  346.  
  347. MainChangeSetting:
  348.     if (##TermFlag == 1)
  349.         call SubTerminalSet
  350.         putini @AppIni, @App, "TermChange", 0
  351.     endif
  352.     if (##FoptFlag == 1)
  353.         call SubForumOption
  354.         putini @AppIni, @App, "FoptChange", 0
  355.     endif
  356.  
  357. MainMailRead:
  358.     if (##MailFlag == 1) call SubMailRead
  359.  
  360. MainCheckSwReg:
  361.     if (##SwRgFlag == 1)
  362.         #Msg = "送金代行確認をしますか?"
  363.         timeoutquestion #Msg, @@sDisp
  364.         if (yes)
  365.             call CheckSwReg
  366.         endif
  367.     endif
  368.  
  369. MainMesUpFirst:
  370.     if (##MesUpFirst == 1 and ##MesFlag == 1) call IdentifyOperation "Mes"
  371.  
  372. MainChoice:
  373.     switch @@LoginPattern
  374.         case 1
  375.             goto MainJob
  376.         case 2
  377.             goto MainAct
  378.         case 3
  379.             goto WaitEnd
  380.         case default
  381.             #Msg1 = "本日、再度のアクセスです。^M"
  382.             #Msg2 = "パターン"+ tozenkaku(@@ReadLevel) + "で巡回しますか?"
  383.             switch ##FirstLogin
  384.                 case 0
  385.                     #Msg = #Msg1 + #Msg2
  386.                 case default
  387.                     #Msg = #Msg2
  388.             endswitch
  389.     endswitch
  390.     timeoutquestion #Msg, @@sDisp
  391.     if (yes) goto MainRead
  392.     else goto MainJob
  393.  
  394. MainRead:
  395.     call IdentifyOperation "Read"
  396.  
  397. MainJob:
  398.     if (@@ListLevel == 1) call IdentifyOperation "List"
  399. ;    if (##ClipFlag == 1 and @@ClipLevel == 1) call SubClipRead
  400.     if (@@ClipLevel == 1) call SubClipRead
  401.     if (@@NewsLevel == 1) call SubNewsRead
  402.     if (@@BillLevel == 1) call SubBill
  403.  
  404. MainAct:
  405.     if (##SelFlag == 1) call IdentifyOperation "SRead"
  406.     if (##MesUpFirst == 0 and ##MesFlag == 1) call IdentifyOperation "Mes"
  407.     if (##LibFlag == 1) call IdentifyOperation "Lib"
  408.  
  409. MainFree:
  410.     if (##FreFlag == 1) call SubFreeAction
  411.  
  412. MainEnd:
  413.     call AutoEnd
  414.     goto WaitEnd
  415.  
  416. WaitEnd:
  417.     timeout 0
  418.     setautohangup 0
  419.     if (##AdjTime == 1)
  420.         wait "^M^J        LOG OUT --- "
  421.         getline #AdjustTime
  422.         #AdjustTime = drop(#AdjustTime, "M^J")
  423.         run @AdjustClock + #AdjustTime
  424.     else
  425.         wait "^M^J ご利用誠にありがとうございました。"
  426.     endif
  427.     goto Logout
  428.  
  429. ;///// LOGOUT PROCEDURE /////
  430. Logout:
  431.     if (#LoginCmd == "NIFTY^M" or #LoginCmd = "CIS^M")
  432.         port data=7 parity=even
  433.         send "^M"
  434.     endif
  435.     loopswitch
  436.         case postidle(1) "!"
  437.             millisleep 1
  438.             send "BYE^M"
  439.         case "HOST NAME?", "Host Name:"
  440.             millisleep 1
  441.             send "OFF^M"
  442.         case "NO CARRIER", "OK", "01+"
  443.             hangup
  444.             breakloop
  445.         case "^G^G^G^G", "^G^G^G^G^G"
  446.             send "^M"
  447.     endloop
  448.     exit
  449.  
  450. Atoshimatsu:
  451.     #App = "NIFAUTO"
  452.     #AppIni = #App + ".INI"
  453.     getini #AppIni, #App, "LoginId", ##LoginId
  454.     getini #AppIni, #App, "LoginPattern", ##LoginPattern
  455.     getini #AppIni, #App, "CloseHt", ##CloseFlag
  456.     getini #AppIni, #App, "sDisp", ##sDisp
  457.     getini #AppIni, "External", "PostApp", #PostApp
  458.     getini #AppIni, #App, "StartPostApp", ##StartApp
  459.     getini #AppIni, #App, "ChangeRPattern", ##ReadLevel
  460.     getini #AppIni, #App, "ChangeLPattern", ##ListLevel
  461.     getini #AppIni, #App, "ChangeNPattern", ##NewsLevel
  462.     getini #AppIni, #App, "ChangeBPattern", ##BillLevel
  463.     if (##LoginId != 0) putini #AppIni, #App, "LoginId", 0
  464.     if (##LoginPattern != 0) putini #AppIni, #App, "LoginPattern", 0
  465.     if (##ReadLevel != 0) putini #AppIni, #App, "ChangeRPattern", 0
  466.     if (##ListLevel != 0) putini #AppIni, #App, "ChangeLPattern", 0
  467.     if (##NewsLevel != 0) putini #AppIni, #App, "ChangeNPattern", 0
  468.     if (##BillLevel != 0) putini #AppIni, #App, "ChangeBPattern", 0
  469.     #Hour =    part(#1, 0, 2)
  470.     #Minute    = part(#1, 2, 2)
  471.     #Second    = part(#1, 4, 2)
  472.     #Msg = "通話時間は"
  473.     if (#Hour != "00") #Msg = #Msg + #Hour + "時間"
  474.     #Msg = #Msg + #Minute + "分" + #Second + "秒でした。"
  475.     timeoutmessage #Msg, ##sDisp
  476.     if (##StartApp == 1 and #PostApp != "") runsync #PostApp
  477.     if (##CloseFlag == 1) closehideterm
  478. return
  479.  
  480. AutoEnd:
  481.     call MainMenuKey
  482.     if (@@Hello == 1)
  483.         call SetActFile 1
  484.         #FileCheck = #return
  485.         if (value(#FileCheck) > 0)
  486.             call SetHello
  487.             if (value(#return) == 1)
  488.                 call ChangeLoginIdFlag
  489.                 call SetId
  490.                 ##MesFlag = part(#FileCheck, 0, 1)
  491.                 ##LibFlag = part(#FileCheck, 1, 1)
  492.                 ##SelFlag = part(#FileCheck, 2, 1)
  493.                 ##FreFlag = part(#FileCheck, 3, 1)
  494.                 ##SwRgFlag = part(#FileCheck, 4, 1)
  495.                 @@NewsLevel = 0
  496.                 getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
  497.                 send "HELLO^M"
  498.                 goto Login
  499.             endif
  500.         endif
  501.     endif
  502.     #Msg = "オートパイロット終了。^Mログアウトしますか?"
  503.     timeoutquestion #Msg, @@sDisp
  504.     if (yes)
  505.         send "BYE^M"
  506.         return
  507.     endif
  508.     @PrevJob = ""
  509.     @PrevName = ""
  510.     if (@@Hello == 1)
  511.         call AutoHello
  512.     endif
  513. return
  514.  
  515. SetHello:
  516.     ##Hello = 0
  517.     @PrevJob = ""
  518.     @PrevName = ""
  519.     getini @AppIni, "Personal", "ExtraId", #Hello
  520.     if (#Hello == "") return ##Hello
  521.     #Msg = "別IDでログインしますか?"
  522.     timeoutquestion #Msg, @@sDisp
  523.     if (yes) ##Hello = 1
  524.     else ##Hello = 0
  525. return ##Hello
  526.  
  527. SetId:
  528.     getini @AppIni, @App, "LoginId", @@LoginId
  529.     getini @AppIni, "Personal", "Name", @NameJ
  530.     switch @@LoginId
  531.         case 0
  532.             getini @AppIni, "Personal", "DefaultId", @NifId
  533.             getini @AppIni, "Personal", "DefaultPassword", @NifPass
  534.             getini @AppIni, "Personal", "DefaultHandle", @NifHandle
  535.             if (@NifId == "") @NifId = %NIFID
  536.             if (@NifPass == "") @NifPass = %%NIFPASSWORD
  537.         case 1
  538.             getini @AppIni, "Personal", "ExtraId", @NifId
  539.             getini @AppIni, "Personal", "ExtraPassword", @NifPass
  540.             getini @AppIni, "Personal", "ExtraHandle", @NifHandle
  541.             if (@NifId == "") @NifId = %NIFID2
  542.             if (@NifPass == "") @NifPass = %%NIFPASSWORD2
  543.     endswitch
  544. return
  545.  
  546. ChangeLoginIdFlag:
  547.     if (@@LoginId == 0) @@LoginId = 1
  548.     else @@LoginId = 0
  549.     putini @AppIni, @App, "LoginId", @@LoginId
  550. return
  551.  
  552. SetActFile:
  553.     switch @@LoginId
  554.         case 1
  555.             if (#1 == 0) #FName = @UpPath + "NIFEXTR"
  556.             else #FName = @UpPath + @App
  557.             getini @AppIni, "SwReg", "SwNum11", #SwNum
  558.         case default
  559.             if (#1 == 0) #FName = @UpPath + @App
  560.             else #FName = @UpPath + "NIFEXTR"
  561.             getini @AppIni, "SwReg", "SwNum01", #SwNum
  562.     endswitch
  563.     @MesFile = #FName + ".MES"
  564.     @LibFile = #FName + ".LIB"
  565.     @SelFile = #FName + ".SEL"
  566.     @FreFile = #FName + ".FRE"
  567.     #FileExist = ""
  568.     if (existfile(@MesFile)) #FileExist = #FileExist + "1"
  569.     else #FileExist = #FileExist + "0"
  570.     if (existfile(@LibFile)) #FileExist = #FileExist + "1"
  571.     else #FileExist = #FileExist + "0"
  572.     if (existfile(@SelFile)) #FileExist = #FileExist + "1"
  573.     else #FileExist = #FileExist + "0"
  574.     if (existfile(@FreFile)) #FileExist = #FileExist + "1"
  575.     else #FileExist = #FileExist + "0"
  576.     if (#SwNum != "") #FileExist = #FileExist + "1"
  577.     else #FileExist = #FileExist + "0"
  578. return #FileExist
  579.  
  580. DateAdjust:
  581.     ##TDiff = value(#1) * (-1)
  582.     if (##TDiff == 0) return ""
  583.     getdate #Date
  584.     gettime #Time
  585.     ##Yr = Value(part(#Date, 0, 2)) + 1900
  586.     ##Mon = Value(part(#Date, 2, 2))
  587.     ##Day = Value(part(#Date, 4, 2))
  588.     ##Hr = Value(part(#Time, 0, 2)) + ##TDiff
  589.     #Min = part(#Time, 2, 2)
  590.     if (##Hr > 23)
  591.         ##Hr = ##Hr - 24
  592.         ##Day = ##Day + 1
  593.     elseif (##Hr < 0)
  594.         ##Hr = 24 + ##Hr
  595.         ##Day = ##Day - 1
  596.     endif
  597.     switch ##Mon
  598.         case 1
  599.             if (##Day < 1)
  600.                 ##Day = 31
  601.                 ##Mon = 12
  602.                 ##Yr = ##Yr - 1
  603.             elseif (##Day > 31)
  604.                 ##Day = 1
  605.                 ##Mon = 2
  606.             endif
  607.         case 2
  608.             if (##Day < 1)
  609.                 ##Day = 31
  610.                 ##Mon = 1
  611.             elseif (##Day > 28)
  612.                 if (##Yr % 4 == 0)
  613.                     if (##Yr % 400 == 0)
  614.                         ##Day = 1
  615.                         ##Mon = 3
  616.                     endif
  617.                 else
  618.                     ##Day = 1
  619.                     ##Mon = 3
  620.                 endif
  621.             endif
  622.         case 3
  623.             if (##Day < 1)
  624.                 if (##Yr % 4 == 0)
  625.                     if (##Yr % 400 == 0)
  626.                         ##Day = 28
  627.                     else
  628.                         ##Day = 29
  629.                     endif
  630.                 else
  631.                     ##Day = 28
  632.                 endif
  633.                 ##Mon = 2
  634.             elseif (##Day > 31)
  635.                 ##Day = 1
  636.                 ##Mon = ##Mon + 1
  637.             endif
  638.         case 5, 7, 8, 10
  639.             if (##Day < 1)
  640.                 ##Day = 30
  641.                 ##Mon = ##Mon - 1
  642.             elseif (##Day > 31)
  643.                 ##Day = 1
  644.                 ##Mon = ##Mon + 1
  645.             endif
  646.         case 12
  647.             if (##Day < 1)
  648.                 ##Day = 31
  649.                 ##Mon = ##Mon - 1
  650.             elseif (##Day > 31)
  651.                 ##Day = 1
  652.                 ##Mon = 1
  653.                 ##Yr = ##Yr + 1
  654.             endif
  655.         case default
  656.             if (##Day < 1)
  657.                 ##Day = 30
  658.                 ##Mon = ##Mon - 1
  659.             elseif (##Day > 31)
  660.                 ##Day = 1
  661.                 ##Mon = ##Mon + 1
  662.             endif
  663.     endswitch
  664.     #Yr = ##Yr -1900
  665.     if (##Mon < 10) #Mon = "0" + ##Mon
  666.     else #Mon = ##Mon
  667.     if (##Day < 10) #Day = "0" + ##Day
  668.     else #Day = ##Day
  669.     if (##Hr < 10) #Hr = "0" + ##Hr
  670.     else #Hr = ##Hr
  671.     #Now = #Yr + #Mon + #Day + #Hr + #Min
  672. return #Now
  673.  
  674. ;///// SUB ROUTINE MODULES /////
  675.  
  676. ;///// PROMPT SUBROUTINE /////
  677. Prompt:
  678.     @@ErrorLevel = 0
  679.     loopswitch
  680.         case "^J◆現在このフォーラムはメンテナンス作業中につき", \
  681.              "^J-保守作業の為しばらくの間御利用頂けません-", \
  682.              "^J現在、サービスは大変混雑しています。後ほどの", \
  683.              "^J◆この機能は本フォーラムではご利用できません◆", \
  684.              "^J◆コマンドを入力してください◆";, \
  685. ;             "^J◆番号又はコマンドを入力して下さい◆", \
  686. ;             "^J◆番号の選択に誤りがあります◆"
  687.             @@ErrorLevel = 2
  688.         case "^J◆該当する会議室がありません◆"
  689.             @@ErrorLevel = 3
  690.         case "^J◆該当するライブラリがありません◆"
  691.             @@ErrorLevel = 4
  692.         case "^J◆次頁はありません◆"
  693.             ;
  694.         case "^J◆現在未読の発言はありません◆
  695.             ;
  696.         case "^J1:フォーラム概要  2:一時利用  3:入会手続き"
  697.             timeoutquestion "入会処理をしますか?", @@sDisp
  698.             if (yes) call ForumJoin
  699.         case "^J同意しますか (1: 同意する  2: しない)^M^J:"
  700.             timeoutquestion "パティオの入会処理をしますか?", @@sDisp
  701.             if (yes) call PatioJoin
  702. ;        case "のユーザーからのメッセージです-^M^J"
  703. ;            readbuffer 1, #GetSend
  704. ;            call SendReact #GetSend
  705.         case "^J続き (改行", "^J続き(改行", \
  706.              "^J番号 (改行", "^J番号(改行"
  707.             wait postmilliidle(@@sProp) "^J>"
  708.             send "^M"
  709.         case postmilliidle(@@sProp) "^Jmore>", \
  710.              postmilliidle(@@sProp) "^Jnext>"
  711.             send "^M"
  712.         case postmilliidle(@@sProp) "^J>", \
  713.              postmilliidle(@@sProp) "^JCCS(N)>", \
  714.              postmilliidle(@@sProp) "^JCCS(C)>", \
  715.              postmilliidle(@@sProp) "^JCCS(R)>", \
  716.              postmilliidle(@@sProp) "^JCCS(P)>", \
  717.              postmilliidle(@@sProp) "^JPATIO(N)>", \
  718.              postmilliidle(@@sProp) "^JPATIO(P)>", \
  719.              postmilliidle(@@sProp) "^JMAIL>", \
  720.              postmilliidle(@@sProp) "^JBBS>", \
  721.              postmilliidle(@@sProp) "^JHP>", \
  722.              postmilliidle(@@sProp) "^JLIB>", \
  723.              postmilliidle(@@sProp) "^JFORUM>", \
  724.              postmilliidle(@@sProp) "^JFILE>", \
  725.              postmilliidle(@@sProp) "^J:", \
  726.              postmilliidle(@@sProp) "^J:"
  727.             breakloop
  728.     endloop
  729. return
  730.  
  731. ;///// LOG SUBROUTINE /////
  732. DefaultLogStart:
  733.     getini @AppIni, @App, "DefaultLog", ##DefaultLog
  734.     if (##DefaultLog == 1) #DefaultLog = "NIFTY.LOG"
  735.     else #DefaultLog = @LogPath + "NIF" + @LogDate + ".LOG"
  736.     call LogStart #DefaultLog
  737. return
  738.  
  739. LogStart:
  740.     log #1
  741. return
  742.  
  743. LogAppend:
  744.     appendfile #1
  745.     writefile #1, "^M"
  746.     closefile #1
  747. return
  748.  
  749. GetLogFile:
  750.     #Func = #1
  751.     #Log = #2
  752.     #Room = #3
  753.     getini @AppIni, @App, "MesLog", ##ReadLog
  754.     if (#Func == "LL" and ##ReadLog == 2) ##ReadLog = 0
  755.     switch ##ReadLog
  756.         case 2
  757.             #Log = @LogPath + #Log
  758.         case 1
  759.             #Log = @LogPath + part(drop(#Log, "."), 0, 8) + "."
  760.             switch #Func
  761.                 case "HP", "PT"
  762.                     #Log = #Log + #Func
  763.                 case "LL"
  764.                     #Log = #Log + "LST"
  765.                 case default
  766.                     if (value(#Room) < 10) #Log = #Log + "00" + #Room
  767.                     else #Log = #Log + "0" + #Room
  768.             endswitch
  769.         case default
  770.             #Log = @LogPath + part(drop(#Log, "."), 0, 6)
  771.             switch #Func
  772.                 case "HP", "PT", "LL"
  773.                     #Log = #Log + #Func + ".LOG"
  774.                 case default
  775.                     if (value(#Room) < 10) #Log = #Log + "0" + #Room + ".LOG"
  776.                     else #Log = #Log + #Room + ".LOG"
  777.             endswitch
  778.     endswitch
  779. return #Log
  780.  
  781. GetJobLogFile:
  782.     #JobName = #1
  783.     #LogHead = part(#JobName, 0, 1) + part(#JobName,3, 1)
  784.     getini @AppIni, @App, "DateLog", ##DateLog
  785.     switch ##DateLog
  786.         case 1
  787.             #Log = @LogPath + "NF"+ #LogHead + @LogDate + ".LOG"
  788.         case default
  789.             #Log = @LogPath + "NIF" + #JobName + ".LOG"
  790.     endswitch
  791. return #Log
  792.  
  793. ;///// MOVE SUBROUTINE /////
  794. RegisteredMove:
  795.     if (#2 == "") addmenu "移動先は?"
  796.     else addmenu "巡回先は?"
  797.     addmenu 0
  798.     addmenu "キー変更"
  799.     ##i = 1
  800.     ##j = 2
  801.     beginloop
  802.         getini @AppIni, #1, ##i, #Name[##i]
  803.         if (#Name[##i] == "") breakloop
  804.         getini @AppIni, #Name[##i], "Comment", #Rem
  805.         if (#Rem != "")    #GetName = #Name[##i] + @sRem + #Rem
  806.         else #GetName = #Name[##i]
  807.         if (#2 == "")
  808.             if (search(#Name[##i], "-") == "")
  809.                 addmenu #GetName
  810.             else
  811.                 if (#1 == "HP" or #1 == "Patio")
  812.                     addmenu #GetName
  813.                 else
  814.                     #GetName = ""
  815.                 endif
  816.             endif
  817.         else
  818.             getini @AppIni, #Name[##i], "ReadId", ##ReadId
  819.             if (@@LoginId == ##ReadId)
  820.                 addmenu #GetName
  821.             else
  822.                 #GetName = ""
  823.             endif
  824.         endif
  825.         if (#GetName != "")
  826.             #Name2[##j] = drop(#GetName, @sRem)
  827.             ##j = ##j + 1
  828.         endif
  829.         ##i = ##i + 1
  830.         if (@@AppSet == 0 and ##i > 3) breakloop
  831.     endloop
  832.     showmenu
  833.     if (result <= 0) return ""
  834.     if (result == 1)
  835.         switch #1
  836.             case "Forum", "PriForum"
  837.                 call ForumKey
  838.             case "HP"
  839.                 call HpKey
  840.             case "Patio"
  841.                 call PatioKey
  842.         endswitch
  843.         return ""
  844.     endif
  845.     #Register = #Name2[result]
  846.     if (#2 != "") return #Register
  847.     getini @AppIni, #Register, "Function", #Func
  848.     getini @AppIni, #Register, "Password", #Pass
  849.     call Move #Func, drop(#Register, "-"), #Pass
  850.     if (#Func == "FM" or "PF") call ForumKey
  851.     if (#Func == "HP") call HpKey
  852.     if (#Func == "PT") call PatioKey
  853. return
  854.  
  855. Move:
  856.     #Func = #1
  857.     #Name = #2
  858.     #Password = #3
  859.     if (#Name == "PER")
  860.         #Func = "NO"
  861.         #Password = "NO"
  862.     endif
  863.     switch #Func
  864.         case "FM"
  865.             send "GO " + #Name + "^M"
  866.             call Prompt
  867.             call ForumKey
  868.         case "HP"
  869.             send "GO HP^M"
  870.             call Prompt
  871.             send "1^M"
  872.             call HpPtEnter #Name, #Password
  873.             call HpKey
  874.         case "PT"
  875.             send "GO PATIO^M"
  876.             call Prompt
  877.             send "2^M"
  878.             call HpPtEnter #Name, #Password
  879.             call PatioKey
  880.         case "PF"
  881.             send "GO " + #Name + "^M"
  882.             call Prompt
  883.             send #Password + "^M"
  884.             call Prompt
  885.             call ForumKey
  886.         case default
  887.             send "GO " + #Name + "^M"
  888.             call Prompt
  889.             call MainMenuKey
  890.     endswitch
  891. return
  892.  
  893. HpPtEnter:
  894.     loopswitch
  895.         case "ID (改行のみ:自分の"
  896.             call Prompt
  897.             if (#1 == @NifId or #1 == "")
  898.                 send "^M"
  899.                 breakloop
  900.             else
  901.                 send #1 + "^M"
  902.             endif
  903.         case "パスワード"
  904.             call Prompt
  905.             send #2 + "^M"
  906.             breakloop
  907.         case " (1:設定する  2:しない)"
  908.             call Prompt
  909.             send "2^M"
  910.             @@ErrorLevel = 2
  911.             breakloop
  912.         case "^J◆該当する利用者のHome Partyはありません◆", \
  913.              "^J◆該当するパティオはありません◆", \
  914.              "^J-保守作業の為しばらくの間御利用頂けません-", \
  915.              "^J現在、サービスは大変混雑しています。後ほどの"
  916.             @@ErrorLevel = 2
  917.             breakloop
  918.     endloop
  919.     call Prompt
  920. return
  921.  
  922. ;///// KEY ASSIGN SUBROUTINE /////
  923. MainMenuKey:
  924.     keyassign f1, "READ", script, AutoRead
  925.     keyassign f2, "LIST", script, AutoList
  926.     keyassign f3, "SREAD", script, AutoSre
  927.     keyassign f4, "MES", script, AutoMes
  928.     keyassign f5, "LIB", script, AutoLib
  929.     keyassign f6, "FREE", script, AutoFreeAct
  930.     keyassign f7, "CLIP", script, AutoClip
  931.     keyassign f8, "NEWS", script, AutoNews
  932.     keyassign f9, "BILL", script, AutoBill
  933.     keyassign f10, "MAIL", script, SubMailRead
  934.     keyassign b1, "FOPT", script, AutoFOption
  935.     keyassign b2, "TERM", script, AutoTerminal
  936.     keyassign b3, "SWS", script, SwSokin
  937.     keyassign b4, "NO MRE", script, AutoNoMread
  938.     keyassign b5, "CSC", script, CSCStart
  939.     keyassign b6, "BREAK", script, Break
  940.     keyassign b7, "ENTER", string, "^M"
  941.     keyassign b8, "MEN ON", script, MenuOn
  942.     keyassign b9, "PAG OFF", script, PageOff
  943.     keyassign b10, "PAU OFF", script, PauseOff
  944.     keyassign c1, "FORUM", script, ForumMove
  945.     keyassign c2, "HP", script, HPMove
  946.     keyassign c3, "PATIO", script, PatioMove
  947.     keyassign c4, "PFORUM", script, PriForumMove
  948.     keyassign c5, "MAIL", script, MailKey
  949.     keyassign c6, "HELLO", script, AutoHello
  950.     keyassign c7, "SCR1", script, ExeExtScr1
  951.     keyassign c8, "SCR2", script, ExeExtScr2
  952.     keyassign c9, "SCR3", script, ExeExtScr3
  953.     keyassign c10, "BYE", script, AutoLogout
  954.     keyassign d1, "BBS", string, "BBS^M"
  955.     keyassign d2, "CB", string, "CB^M"
  956.     keyassign d3, "WEATH", string, "GO WEATHER^M"
  957.     keyassign d4, "BUSIN", string, "GO BUSINESS^M"
  958.     keyassign d5, "LIFE", string, "GO LIFE^M"
  959.     keyassign d6, "SHOP", string, "GO SHOPPING^M"
  960.     keyassign d7, "INFOC", string, "GO INFOCUE^M"
  961.     keyassign d8, "GTWAY", string, "GO GATEWAY^M"
  962.     keyassign d9, "SWREG", script, AutoCheckSwReg
  963.     keyassign d10, "", string, ""
  964. return
  965.  
  966. MailKey:
  967.     keyassign f1, "GO MAL", string, "MAIL^M"
  968.     keyassign f2, "READ", script, AutoMailRead
  969.     keyassign f3, "DEL", script, MailDelete
  970.     keyassign f4, "CAN", script, MailCancel
  971.     keyassign f5, "SDL", string, "SDL^M"
  972.     keyassign f6, "RCV", string, "RVL^M"
  973.     keyassign f7, "REP", string, "REP^M"
  974.     keyassign f8, "FORW", string, "FOR^M"
  975.     keyassign f9, "EDIT", string, "EDIT^M"
  976.     keyassign f10, "MAIN", script, MainMenuKey
  977.     keyassign b1, "ADD", string, "ADD^M"
  978.     keyassign b2, "ADDRSS", script, AddressBook
  979.     keyassign b3, "PER", script, PerFileKey
  980.     keyassign b4, "LOAD", string, "LOA^M"
  981.     keyassign b5, "STORE", string, "STO^M"
  982. return
  983.  
  984. PerFileKey:
  985.     keyassign f1, "GO PER", string, "GO PER^M"
  986.     keyassign f2, "READ", string, "REA^M"
  987.     keyassign f3, "UPD", string, "UPD^M"
  988.     keyassign f4, "DEL", string, "DEL^M"
  989.     keyassign f5, "COPY", string, "COP^M"
  990.     keyassign f6, "UPL", string, "UPL^M"
  991.     keyassign f7, "DOW", string, "DOW^M"
  992.     keyassign f8, "PRO", string, "PRO^M"
  993.     keyassign f9, "", string, ""
  994.     keyassign f10, "MAIN", script, MainMenuKey
  995.     keyassign b1, "", string, ""
  996.     keyassign b2, "", string, ""
  997.     keyassign b3, "", string, ""
  998.     keyassign b4, "", string, ""
  999.     keyassign b5, "", string, ""
  1000. return
  1001.  
  1002. ForumKey:
  1003.     keyassign f1, "ANN", string, "ANN^M"
  1004.     keyassign f2, "BUL", string, "BUL^M"
  1005.     keyassign f3, "ROOM", script, MesRoomMove
  1006.     keyassign f4, "LIB", script, LibMove
  1007.     keyassign f5, "MEM", string, "MEM^M"
  1008.     keyassign f6, "RTC", string, "RTC^M"
  1009.     keyassign f7, "SYSOP", script, ForumSysopMail
  1010.     keyassign f8, "OPT", script, ForumOptChange
  1011.     keyassign f9, "CSC", script, CSCStartF
  1012.     keyassign f10, "MAIN", script, MainMenuKey
  1013.     keyassign b1, "CHAT", script, ChatKey
  1014.     keyassign b2, "JOIN", script, ForumJoin
  1015.     keyassign b3, "", string, ""
  1016.     keyassign b4, "", string, ""
  1017.     keyassign b5, "", string, ""
  1018. return
  1019.  
  1020. MesRoomKey:
  1021.     keyassign f1, "RTN", string, "RTN^M"
  1022.     keyassign f2, "RMN", string, "RMN^M"
  1023.     keyassign f3, "RC MAX", string, "RC MAX^M"
  1024.     keyassign f4, "RC D", string, "RC D^M"
  1025.     keyassign f5, "NO MRE", script, NoMRead
  1026.     keyassign f6, "MES DEL", script, MesDelete
  1027.     keyassign f7, "RX", string, "RX^M"
  1028.     keyassign f8, "RESP", string, "RESP^M"
  1029.     keyassign f9, "GO LIB", script, LibMove
  1030.     keyassign f10, "TOP", script, ForumTopMove
  1031.     keyassign b1, "ID", script, MyId
  1032.     keyassign b2, "NAME", script, MyName
  1033.     keyassign b3, "HANDLE", script, MyHandle
  1034.     keyassign b4, "SMAIL", string, "SMAIL^M"
  1035.     keyassign b5, "", string, ""
  1036. return
  1037.  
  1038. LibKey:
  1039.     keyassign f1, "SEARCH", script, LibSearch
  1040.     keyassign f2, "BROWSE", script, LibBrowse
  1041.     keyassign f3, "DOWN", script, LibDown
  1042.     keyassign f4, "FNAME", script, DownFileName
  1043.     keyassign f5, "FLIST", script, ListFileName
  1044.     keyassign f6, "LIST", script, GetList
  1045.     keyassign f7, "LX", string, "LX^M"
  1046.     keyassign f8, "DIR", string, "DIR^M"
  1047.     keyassign f9, "GO MES", script, MesRoomMove
  1048.     keyassign f10, "TOP", script, ForumTopMove
  1049.     keyassign b1, "SEA", string, "SEA"
  1050.     keyassign b2, "KEY", string, "KEY^M"
  1051.     keyassign b3, "BRO", string, "BRO^M"
  1052.     keyassign b4, "SCAN", string, "SCA^M"
  1053.     keyassign b5, "", string, ""
  1054. return
  1055.  
  1056. HpKey:
  1057.     keyassign f1, "GUEST", string, "GUE^M"
  1058.     keyassign f2, "TITLE", string, "TITLE^M"
  1059.     keyassign f3, "NEW", string, "REA NEW^M"
  1060.     keyassign f4, "TODAY", string, "REA TODAY^M"
  1061.     keyassign f5, "COM", string, "COM^M"
  1062.     keyassign f6, "DEL", string, "DEL "
  1063.     keyassign f7, "REV", string, "REA REV^M"
  1064.     keyassign f8, "MOVE", string, "MOVE^M"
  1065.     keyassign f9, "SETUP", string, "SETUP^M"
  1066.     keyassign f10, "MAIN", script, MainMenuKey
  1067.     keyassign b1, "ID", script, MyId
  1068.     keyassign b2, "NAME", script, MyName
  1069.     keyassign b3, "HANDLE", script, MyHandle
  1070.     keyassign b4, "CANCEL", string, "CAN^M"
  1071.     keyassign b5, "EXPAND", string, "EXP^M"
  1072. return
  1073.  
  1074. PatioKey:
  1075.     keyassign f1, "RTN", string, "RTN^M"
  1076.     keyassign f2, "RMN", string, "RMN^M"
  1077.     keyassign f3, "RC MAX", string, "RC MAX^M"
  1078.     keyassign f4, "RC D", string, "RC D^M"
  1079.     keyassign F5, "MRE", string, "MRE^M"
  1080.     keyassign f6, "MES DEL", script, MesDelete
  1081.     keyassign f7, "RESP", string, "RESP^M"
  1082.     keyassign f8, "GUEST", string, "GUE^M"
  1083.     keyassign f9, "OPTION", script, PatioOptChange
  1084.     keyassign f10, "MAIN", script, MainMenuKey
  1085.     keyassign b1, "ID", script, MyId
  1086.     keyassign b2, "NAME", script, MyName
  1087.     keyassign b3, "HANDLE", script, MyHandle
  1088.     keyassign b4, "SETUP", string, "SETUP^M"
  1089.     keyassign b5, "INIT", string, "INIT^M"
  1090. return
  1091.  
  1092. ChatKey:
  1093.     keyassign f1, "/PROF", string, "/PR "
  1094.     keyassign f2, "/USERS", string, "/U^M"
  1095.     keyassign f3, "HELLO", string, "はろ>"
  1096.     keyassign f4, "BYE BYE", string, "ではそろそろ失礼します>all"
  1097.     keyassign f5, "/STATUS", string, "/S^M"
  1098.     keyassign f6, "/JOB", string, "/J^M"
  1099.     keyassign f7, "/HELP", string, "/?^M"
  1100.     keyassign f8, "ECH OFF", script, ChatEchoOff
  1101.     keyassign f9, "WIN OFF", script, ChatWinOff
  1102.     keyassign f10, "END", script, ChatEnd
  1103.     keyassign b1, "ID", script, MyId
  1104.     keyassign b2, "NAME", script, MyName
  1105.     keyassign b3, "HANDLE", script, MyHandle
  1106.     keyassign b4, "/WHO", string, "/W "
  1107.     keyassign b5, "/PAGE", string, "/P "
  1108. return
  1109.  
  1110. ;///// SUBROUTINES FOR KEY ASSIGN /////
  1111. MenuOff:
  1112.     send "SET MENU OFF^M"
  1113.     call Prompt
  1114.     keyassign b8, "MEN ON", script, MenuOn
  1115. return
  1116.  
  1117. MenuOn:
  1118.     send "SET MENU ON^M"
  1119.     call Prompt
  1120.     keyassign b8, "MEN OFF", script, MenuOff
  1121. return
  1122.  
  1123. PageOff:
  1124.     send "SET PAGE OFF^M"
  1125.     call Prompt
  1126.     if (#1 != "") return
  1127.     keyassign b9, "PAG ON", script, PageOn
  1128. return
  1129.  
  1130. PageOn:
  1131.     send "SET PAGE ON^M"
  1132.     call Prompt
  1133.     if (#1 != "") return
  1134.     keyassign b9, "PAG OFF", script, PageOff
  1135. return
  1136.  
  1137. PauseOff:
  1138.     send "SET PAUSE OFF^M"
  1139.     call Prompt
  1140.     if (#1 != "") return
  1141.     keyassign b10, "PAU ON", script, PauseOn
  1142. return
  1143.  
  1144. PauseOn:
  1145.     send "SET PAUSE ON^M"
  1146.     call Prompt
  1147.     keyassign b10, "PAU OFF", script, PauseOff
  1148. return
  1149.  
  1150. DlmOn:
  1151.     if (@@DlmOn == 1) return
  1152.     send "SET DLM ON^M"
  1153.     call Prompt
  1154. ;    @@DlmOn = 1
  1155. return
  1156.  
  1157. ChatWinOff:
  1158.     chat off
  1159.     keyassign f9, "WIN ON", script, ChatWinOn
  1160. return
  1161.  
  1162. ChatWinOn:
  1163.     chat on
  1164.     keyassign f9, "WIN OFF", script, ChatWinOff
  1165. return
  1166.  
  1167. ChatEchoOff:
  1168.     send "/EC OFF^M"
  1169.     keyassign f8, "ECH ON", script, ChatEchoOn
  1170. return
  1171.  
  1172. ChatEchoOn:
  1173.     send "/EC ON^M"
  1174.     keyassign f8, "ECH OFF", script, ChatEchoOff
  1175. return
  1176.  
  1177. MyHandle:
  1178.     send @NifHandle + "^M"
  1179. return
  1180.  
  1181. MyId:
  1182.     send @NifId + "^M"
  1183. return
  1184.  
  1185. MyName:
  1186.     send @NameJ + "^M"
  1187. return
  1188.  
  1189. ExeExtScr1:
  1190.     getini @AppIni, "External", "ExtScript1", #ExtScr
  1191.     call ExeExtScript #ExtScr
  1192. return
  1193.  
  1194. ExeExtScr2:
  1195.     getini @AppIni, "External", "ExtScript2", #ExtScr
  1196.     call ExeExtScript #ExtScr
  1197. return
  1198.  
  1199. ExeExtScr3:
  1200.     getini @AppIni, "External", "ExtScript3", #ExtScr
  1201.     call ExeExtScript #ExtScr
  1202. return
  1203.  
  1204. ExeExtScript:
  1205.     #ExtScr = #1
  1206.     checklabel #ExtScr
  1207.     if (no) return
  1208.     callvarlabel #ExtScr
  1209. return
  1210.  
  1211. Break:
  1212.     sendbreak
  1213. return
  1214.  
  1215. ChatStart:
  1216.     chat on
  1217.     call ChatKey
  1218. return
  1219.  
  1220. CSCStart:
  1221.     keyassign reset
  1222.     call "CSC.SCR"
  1223.     call MainMenuKey
  1224.     call DefaultLogStart
  1225. return
  1226.  
  1227. CSCStartF:
  1228.     keyassign reset
  1229.     call "CSC.SCR"
  1230.     call ForumKey
  1231.     call DefaultLogStart
  1232. return
  1233.  
  1234. ChatEnd:
  1235.     send "/E^M"
  1236.     chat off
  1237.     call ForumKey
  1238. return
  1239.  
  1240. ForumMove:
  1241.     call RegisteredMove "Forum", ""
  1242. return
  1243.  
  1244. HPMove:
  1245.     call RegisteredMove "HP", ""
  1246. return
  1247.  
  1248. PatioMove:
  1249.     call RegisteredMove "Patio", ""
  1250. return
  1251.  
  1252. PriForumMove:
  1253.     call RegisteredMove "PriForum", ""
  1254. return
  1255.  
  1256. AutoLogout:
  1257.     send "BYE^M"
  1258. return
  1259.  
  1260. AutoHello:
  1261.     call SetHello
  1262.     if (value(#return) != 1) return
  1263.     call SetActFile 1
  1264.     ##MesFlag = part(#return, 0, 1)
  1265.     ##LibFlag = part(#return, 1, 1)
  1266.     ##SelFlag = part(#return, 2, 1)
  1267.     ##FreFlag = part(#return, 3, 1)
  1268.     ##SwRgFlag = part(#return, 4, 1)
  1269.     @@NewsLevel = 0
  1270.     call ChangeLoginIdFlag
  1271.     call SetId
  1272.     @@LoginPattern = 0
  1273.     getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
  1274.     send "HELLO^M"
  1275.     goto Login
  1276. return
  1277.  
  1278. AutoNews:
  1279.     setautohangup @@HangMin
  1280.     call SubNewsRead
  1281.     goto AutoEnd
  1282.  
  1283. AutoBill:
  1284.     setautohangup @@HangMin
  1285.     call SubBill
  1286.     goto AutoEnd
  1287.  
  1288. AutoClip:
  1289.     setautohangup @@HangMin
  1290.     call SubClipRead
  1291.     goto AutoEnd
  1292.  
  1293. AutoRead:
  1294.     setautohangup @@HangMin
  1295.     addmenu "巡回パターンは?"
  1296.     addmenu 0
  1297.     addmenu "個別フォーラム"
  1298.     addmenu "個別ホームパーティー"
  1299.     addmenu "個別パティオ"
  1300.     addmenu "個別Pフォーラム"
  1301.     ##i = 0
  1302.     while(##i < 20)
  1303.         if (##i < 10)
  1304.             #Item = "パターン" + tozenkaku(##i) + ":巡回レベル"
  1305.             #Item = #Item + tozenkaku(##i) + "以下"
  1306.         else
  1307.             #Item = "パターン" + ##i + ":巡回レベル"
  1308.             #Item = #Item + tozenkaku(##i - 10) + "のみ"
  1309.         endif
  1310.         addmenu #Item
  1311.         ##i = ##i + 1
  1312.     endwhile
  1313.     showmenu
  1314.     if (result < 1)
  1315.         return
  1316.     elseif (result >= 1 and result <= 4)
  1317.         if (result == 1) call RegisteredMove "Forum", "1"
  1318.         if (result == 2) call RegisteredMove "HP", "1"
  1319.         if (result == 3) call RegisteredMove "Patio", "1"
  1320.         if (result == 4) call RegisteredMove "PriForum", "1"
  1321.         if (#return == "") return
  1322.         #Name = #return
  1323.         getini @AppIni, #Name, "Function", #Func
  1324.         call DlmOn
  1325.         call GetDoDetal "Read", #Name, #Func, "", ""
  1326.     else
  1327.         @@ReadLevel = result - 5
  1328.         call IdentifyOperation "Read"
  1329.     endif
  1330.     goto AutoEnd
  1331.  
  1332. AutoSre:
  1333.     call SetActFile 0
  1334.     if (value(part(#return, 2, 1)) == 0 ) return
  1335.     setautohangup @@HangMin
  1336.     call IdentifyOperation "SRead"
  1337.     goto AutoEnd
  1338.  
  1339. AutoList:
  1340.     setautohangup @@HangMin
  1341.     call IdentifyOperation "List"
  1342.     goto AutoEnd
  1343.  
  1344. AutoMes:
  1345.     call SetActFile 0
  1346.     if (value(part(#return, 0, 1)) == 0) return
  1347.     setautohangup @@HangMin
  1348.     call IdentifyOperation "Mes"
  1349.     goto AutoEnd
  1350.  
  1351. AutoLib:
  1352.     call SetActFile 0
  1353.     if (value(part(#return, 1, 1)) == 0) return
  1354.     setautohangup @@HangMin
  1355.     call IdentifyOperation "Lib"
  1356.     goto AutoEnd
  1357.  
  1358. AutoFreeAct:
  1359.     call SetActFile 0
  1360.     if (value(part(#return, 3, 1)) == 0) return
  1361.     setautohangup @@HangMin
  1362.     call SubFreeAction
  1363.     goto AutoEnd
  1364.  
  1365. AutoTerminal:
  1366.     setautohangup @@HangMin
  1367.     call SubTerminalSet
  1368.     goto AutoEnd
  1369.  
  1370. AutoFOption:
  1371.     setautohangup @@HangMin
  1372.     call SubForumOption
  1373.     goto AutoEnd
  1374.  
  1375. AutoMailRead:
  1376.     setautohangup @@HangMin
  1377.     call SubMailRead
  1378.     goto AutoEnd
  1379.  
  1380. AutoCheckSwReg:
  1381.     setautohangup @@HangMin
  1382.     call CheckSwReg
  1383.     goto AutoEnd
  1384.  
  1385. AutoNoMread:
  1386.     setautohangup @@HangMin
  1387.     ##i = 1
  1388.     ##j = 1
  1389.     ##Count = 1
  1390.     beginloop
  1391.         if(##Count > 3) breakloop
  1392.         if(##Count == 1) getini @AppIni, "Forum", ##i, #Name
  1393.         if(##Count == 2) getini @AppIni, "Patio", ##i, #Name
  1394.         if(##Count == 3) getini @AppIni, "PriForum", ##i, #Name
  1395.         if (#Name != "")
  1396.             #GoName[##j] = #Name
  1397.             ##i = ##i + 1
  1398.             ##j = ##j + 1
  1399.             millisleep 1
  1400.             if (@@AppSet == 0 and ##j > 3)
  1401.                 ##i = 1
  1402.                 ##Count = ##Count + 1
  1403.                 millisleep 1
  1404.             endif
  1405.         else
  1406.             ##i = 1
  1407.             ##Count = ##Count + 1
  1408.             millisleep 1
  1409.         endif
  1410.     endloop
  1411.     ##i = 1
  1412.     while (##i < ##j + 1)
  1413.         getini @AppIni, #GoName[##i], "Function", #Func
  1414.         getini @AppIni, #GoName[##i], "Password", #Pass
  1415.         call Move #Func, #GoName[##i], #Pass
  1416.         if (@@ErrorLevel == 2) loopagain
  1417.         switch #Func
  1418.             case "PT"
  1419.                 send "1^M"
  1420.                 call Prompt
  1421.                 send "RC MAX^M"
  1422.                 call Prompt
  1423.             case default
  1424.                 call NoMread
  1425.         endswitch
  1426.         ##i = ##i + 1
  1427.         millisleep 1
  1428.     endwhile
  1429. return
  1430.  
  1431. ;///// FREE ACTION SUBROUTINE /////
  1432. SubFreeAction:
  1433.     #File = @FreFile
  1434.     #Section = "FAct"
  1435.     if (not existfile(#File)) return
  1436.     openfile #File
  1437.     beginloop
  1438.         readfile #File, #Line
  1439.         if (no) breakloop
  1440.         #Head = part(#Line, 0, 1)
  1441.         switch #Head
  1442.             case @sRem
  1443.                 loopagain
  1444.             case "@"
  1445.                 call ExeSubFreFile, #Line
  1446.                 loopagain
  1447.             case "$"
  1448.                 call ExeSubFreScript, #Line
  1449.                 loopagain
  1450.         endswitch
  1451.         #Line = drop(dropback(#Line, @sRem), "^I")
  1452.         if (toupper(#Line) == "BYE")
  1453.             closefile #File
  1454.             delfile #File
  1455.             send #Line + "^M"
  1456.             goto WaitEnd
  1457.         endif
  1458.         send #Line + "^M"
  1459.         call Prompt
  1460.         if (@@ErrorLevel > 0) goto ErrorCheck
  1461.     endloop
  1462.     closefile #File
  1463.     delfile #File
  1464. return
  1465.  
  1466. ExeSubFreFile:
  1467.     #ExeFile = part(#1, 1, 256)
  1468.     if (not existfile(#ExeFile)) return
  1469.     openfile #ExeFile
  1470.     beginloop
  1471.         readfile #ExeFile, #Line
  1472.         if (no) breakloop
  1473.         #Head = part(#Line, 0, 1)
  1474.         switch #Head
  1475.             case @sRem, "@"
  1476.                 loopagain
  1477.             case "$"
  1478.                 call ExeSubFreScript, #Line
  1479.                 loopagain
  1480.         endswitch
  1481.         #Line = drop(dropback(#Line, @sRem), "^I")
  1482.         send #Line + "^M"
  1483.         call Prompt
  1484.         if (@@ErrorLevel > 0) goto ErrorCheck
  1485.     endloop
  1486.     closefile #ExeFile
  1487. return
  1488.  
  1489. ExeSubFreScript:
  1490.     #ExeScr = part(#1, 1, 256)
  1491.     checklabel #ExeScr
  1492.     if (no)
  1493.         #Msg = "スクリプトが見つかりません。"
  1494.         timeoutmessage #Msg, @@sDisp
  1495.         return
  1496.     endif
  1497.     callvarlabel #ExeScr
  1498. return
  1499.  
  1500. ;///// APP BEFORE OPERATION SUBROUTINE /////
  1501. SubPreApp:
  1502.     timeout 0
  1503.     setautohangup 0
  1504.     getini @AppIni, @App, "StartPreApp", ##StartPreApp
  1505.     getini @AppIni, "External", "PreApp", #PreApp
  1506.     if (##StartPreApp == 1 and #PreApp != "")
  1507.         runsync2 #PreApp
  1508. ;        run #PreApp
  1509.     endif
  1510.     setautohangup @@HangMin
  1511. return
  1512.  
  1513. ;///// NEWS OPERATION SUBROUTINES/////
  1514. SubNewsRead:
  1515.     getini @AppIni, @App, "NewsLog", ##NewsLog
  1516.     if (@PrevJob != "NEW") send "GO NEW^M"
  1517.     call Prompt
  1518.     @PrevJob = "NEW"
  1519.     call MainMenuKey
  1520.     if (@@tPage == 1) call PageOff @@tPage
  1521.     if (##NewsLog == 1)
  1522.         call GetJobLogFile "NEWS"
  1523.         call LogStart #return
  1524.     endif
  1525.     if (@@NewsLevel == 1)
  1526.         #NewsNo = "ALL"
  1527.     else
  1528.         input "読みだし希望番号を入力して下さい。", #NewsNo, "ALL"
  1529.         if (cancel)
  1530.             if (##NewsLog == 1)
  1531.                 call DefaultLogStart
  1532. ;                call LogAppend #LogFile
  1533.             endif
  1534.             return
  1535.         endif
  1536.     endif
  1537.     send #NewsNo + "^M"
  1538.     call Prompt
  1539.     if (##NewsLog == 1)
  1540.         call DefaultLogStart
  1541. ;        call LogAppend #LogFile
  1542.     endif
  1543.     send "NEWOFF^M"
  1544.     call Prompt
  1545. return
  1546.  
  1547. ;///// BILL SUBROUTINE /////
  1548. SubBill:
  1549.     getini @AppIni, @App, "BillLog", ##BillLog
  1550.     getini @AppIni, "Level", "BillDetail", ##BillDetail
  1551.     #Date = @Yr + @LogDate
  1552.     if (@PrevJob != "BIL") send "GO BILL^M"
  1553.     wait "^J利用料金情報"
  1554.     call Prompt
  1555.     @PrevJob = "BIL"
  1556.     call MainMenuKey
  1557.     if (@@tPage == 1) call PageOff @@tPage
  1558.     if (##BillLog == 1)
  1559.         call GetJobLogFile "BILL"
  1560.         call LogStart #return
  1561.     endif
  1562.     ##BillCheck = 0
  1563.     ##DetailCheck = 0
  1564.     send "2^M"
  1565.     loopswitch
  1566.         case "表示情報選択 (1:日毎合計表示"
  1567.             call Prompt
  1568.             if (##BillDetail == 1 and ##BillCheck == 0)
  1569.                 send "1^M"
  1570.                 ##BillCheck = ##BillCheck + 1
  1571.             else
  1572.                 send "E^M"
  1573.                 breakloop
  1574.             endif
  1575.         case "表示月選択 (数字で月日指定  改行で前々月から表示"
  1576.             call Prompt
  1577.             if (##DetailCheck > 0)
  1578.                 send "E^M"
  1579.             else
  1580.                 ##Mon = value(@Mon) - 1
  1581.                 if (##Mon == 0) ##Mon = 12
  1582.                 send ##Mon + "^M"
  1583.                 ##DetailCheck = #DetailCheck + 1
  1584.             endif
  1585.         case postmilliidle(@@sProp) "^Jmore>"
  1586.             send "^M"
  1587.         case "^J続き"
  1588.             call Prompt
  1589.             send "^M"
  1590.     endloop
  1591.     call Prompt
  1592.     if (##BillLog == 1)
  1593.         call DefaultLogStart
  1594. ;        call LogAppend #LogFile
  1595.     endif
  1596. return
  1597.  
  1598. ;///// CLIPPING SERVICE SUBROUTINE /////
  1599. SubClipRead:
  1600.     getini @AppIni, @App, "ClipId", ##ClipId
  1601.     getini @AppIni, @App, "ClipLog", ##ClipLog
  1602.     if (##ClipId < 2)
  1603.         if (##ClipId != @@LoginId) return
  1604.     endif
  1605.     if (@PrevJob != "CLP") send "GO CLIP^M"
  1606.     call Prompt
  1607.     @PrevJob = "CLP"
  1608.     call MainMenuKey
  1609.     if (@@tPage == 1) call PageOff @@tPage
  1610.     send "3^M"
  1611.     switch
  1612.         case "ニュースを読む"
  1613.             call Prompt
  1614.             millisleep 1
  1615.             ##i = 1
  1616.             while (##i < 4)
  1617.                 readbuffer ##i, #Line
  1618.                 if (#Line == "ニュースを読む") breakloop
  1619.                 else ##HolderNum = ##i
  1620.                 ##i = ##i + 1
  1621.             endwhile
  1622.         case "◆現在クリッピングは設定されていません◆"
  1623.             call Prompt
  1624.             return
  1625.     endswitch
  1626.     ##ReadHolder = 1
  1627.  
  1628. DoClipRead:
  1629.     if (##ClipLog == 1)
  1630.         call GetJobLogFile "CLIP"
  1631.         call LogStart #return
  1632.     endif
  1633.     #ClipNum = ""
  1634.     send ##ReadHolder + "^M"
  1635.     switch
  1636.         case "◆現在ニュースはクリップされていません◆"
  1637.             call Prompt
  1638.             goto ClipReadEnd
  1639.         case "番号 (改行で次頁)^M^J>"
  1640.             send "^M"
  1641.         case ":"
  1642.             ##i = 0
  1643.             beginloop
  1644.                 getchar #Number
  1645.                 if (##i == 3) breakloop
  1646.                 if (#Number == " " or #Number == "") breakloop
  1647.                 #ClipNum = #ClipNum + #Number
  1648.                 ##i = ##i + 1
  1649.             endloop
  1650.     endswitch
  1651.     call Prompt
  1652.     #ClipNo = #ClipNum + "-1"
  1653.     switch @@ClipLevel
  1654.         case 0
  1655.             #DelCmd = "2"
  1656.             #Msg = "読みだし希望番号を入力して下さい。"
  1657.             input #Msg, #ClipNo, #ClipNo
  1658.             if (cancel) send "E^M"
  1659.             else send #ClipNo + "^M"
  1660.         case default
  1661.             #DelCmd = "1"
  1662.             send #ClipNo + "^M"
  1663.     endswitch
  1664.     call Prompt
  1665.     if (##ClipLog == 1)
  1666.         call DefaultLogStart
  1667. ;        call LogAppend #LogFile
  1668.     endif
  1669.     send "^M"
  1670.     loopswitch
  1671.         case "記事削除 (1:全記事削除  2:今読んだ記事  改行で終了)^M^J:"
  1672.             send #DelCmd + "^M"
  1673.         case "削除 (1:削除する  2:しない)^M^J:"
  1674.             send "1^M"
  1675.         case "ニュースを読む"
  1676.             call Prompt
  1677.             breakloop
  1678.     endloop
  1679.  
  1680. ClipReadEnd:
  1681.     ##ReadHolder = ##ReadHolder + 1
  1682.     if (##ReadHolder <= ##HolderNum) goto DoClipRead
  1683. return
  1684.  
  1685. ClipSet:
  1686.     #Holder = #1
  1687.     #NewsPaper = #2
  1688.     #SavDay = #3
  1689.     #Key = #4
  1690.     if (#Holder == "") #Holder = "Clipping"
  1691.     if (#Key == "")
  1692.         @@ErrorLevel = 8
  1693.         #p = "キーワード"
  1694.         goto ErrorCheck
  1695.     endif
  1696.     while (##i < 8)
  1697.         #Keyword[##i] = ""
  1698.         ##i = ##i + 1
  1699.     endwhile
  1700.     #Key = #Key + ","
  1701.     ##i = 0
  1702.     ##h = 1
  1703.     beginloop
  1704.         #a = part(#Key, ##i, 1)
  1705.         if ( #a == "," )
  1706.             #Keyword[##h] = tozenkaku(part(#Key, 0, ##i))
  1707.             ##h = ##h + 1
  1708.             ##i = ##i + 1
  1709.             #Key = part(#Key, ##i, 256)
  1710.             if (length(#Key) <= 1 ) breakloop
  1711.             ##i = 0
  1712.         endif
  1713.         if (length(#Key) <= 1) breakloop
  1714.         ##i = ##i + 1
  1715.     endloop
  1716.     send "1^M"
  1717.     ##Count = 1
  1718.     loopswitch
  1719.         case "ホルダー名の設定 (全角10文字まで)"
  1720.             call Prompt
  1721.             send #Holder + "^M"
  1722.         case "記事の保存期間を入力してください "
  1723.             call Prompt
  1724.             send #SavDay + "^M"
  1725.         case "(1:OK  2:NG)"
  1726.             call Prompt
  1727.             send "1^M"
  1728.         case "番号選択 (複数選択可):"
  1729.             send #NewsPaper + "^M"
  1730.         case "番号選択 (改行のみ終了):"
  1731.             send "^M"
  1732.         case "キーワードの入力 (全角のみ10文字まで"
  1733.             call Prompt
  1734.             send #Keyword[##Count] + "^M"
  1735.             ##Count = ##Count + 1
  1736.         case "記事数表示 (1:表示する  2:表示しない)"
  1737.             send "1^M"
  1738.         case "確認  利用設定 (1:する  2:しない)", \
  1739.              "確認  設定内容変更 (1:する  2:しない)"
  1740.             call Prompt
  1741.             send "1^M"
  1742.         case "クリッピング設定/解除"
  1743.             call Prompt
  1744.             breakloop
  1745.     endloop
  1746. return
  1747.  
  1748. ;///// MAIL SUBROUTINE /////
  1749. SubMailRead:
  1750.     getini @AppIni, @App, "MailLog", ##MailLog
  1751.     if (@@LoginId == 0)
  1752.         getini @AppIni, @App, "MailRead", ##MailRead
  1753.         getini @AppIni, @App, "MailAct", ##MailAct
  1754.     else
  1755.         getini @AppIni, @App, "ExtraMailRead", ##MailRead
  1756.         getini @AppIni, @App, "ExtraMailAct", ##MailAct
  1757.     endif
  1758.     if (@PrevJob != "MAL") send "MAIL^M"
  1759.     call Prompt
  1760.     call MailKey
  1761.     if (@@tPage == 1) call PageOff @@tPage
  1762.     if (##MailLog == 1)
  1763.         call GetJobLogFile "MAIL"
  1764.         call LogStart #return
  1765.     endif
  1766.  
  1767. DoMailRead:
  1768.     call CheckMailList "1"
  1769.     #List = #return
  1770.     if (#List == "")
  1771.         if (##MailLog == 1)
  1772.             call DefaultLogStart
  1773. ;            call LogAppend #LogFile
  1774.         endif
  1775.         @PrevName = "TXT"
  1776.         @PrevJob = "MAL"
  1777.         return
  1778.     endif
  1779.     if (##MailRead == 1)
  1780.         timeoutquestion "未読メールをすべて読みますか。", @@sDisp
  1781.         if (no)
  1782.             #Msg = "メールの識別子を指定してください。バイナリー^M"
  1783.             #Msg = #Msg + "メールの場合は、識別子の前に @ が必要です。^M"
  1784.             #Msg = #Msg + "キャンセルは、メール処理を終了します。"
  1785.             #Num = ""
  1786.             while (#Num == "")
  1787.                 input #Msg, #Num, #List
  1788.                 if (cancel)
  1789.                     if (##MailLog == 1)
  1790.                         call DefaultLogStart
  1791. ;                        call LogAppend #LogFile
  1792.                     endif
  1793.                     @PrevName = "TXT"
  1794.                     @PrevJob = "MAL"
  1795.                     return
  1796.                 endif
  1797.             endwhile
  1798.             #List = #Num
  1799.             if (part(#List, length(#List) - 1, 1) != ",")
  1800.                 #List = #List + ","
  1801.             endif
  1802.         endif
  1803.     endif
  1804.     while (length(#List) > 1)
  1805.         #MailName = drop(#List, ",")
  1806.         #List = search(#List, ",")
  1807.         if (part(#MailName, 0, 1) == "@")
  1808.             #MailName = part(#MailName, 1, 8)
  1809.             call DownBinMail #MailName
  1810.         else
  1811.             send "REA " + #MailName + "^M"
  1812.         endif
  1813.         if (##MailAct == 1) call MailLoop "SAV"
  1814.         else call MailLoop "DEL"
  1815.         #List = part(#List, 1, 256)
  1816.         if (length(#List) > 1 and length(#List) < 9) goto DoMailRead
  1817.     endwhile
  1818.     if (##MailLog == 1)
  1819.         call DefaultLogStart
  1820. ;        call LogAppend #LogFile
  1821.     endif
  1822.     call MainMenuKey
  1823.     @PrevName = "TXT"
  1824.     @PrevJob = "MAL"
  1825. return
  1826.  
  1827. MailDelete:
  1828.     if (@@tPage == 1) call PageOff @@tPage
  1829.     call CheckMailList "2"
  1830.     #List = #return
  1831.     if (#List == "") return
  1832.     while (length(#List) > 1)
  1833.         #DelName = drop(#List, ",")
  1834.         send "DEL " + #DelName + "^M"
  1835.         call MailLoop "DEL"
  1836.         #List = part(search(#List, ","), 1, 256)
  1837.         if (length(#List) > 1 and length(#List) < 9) goto MailDelete
  1838.     endwhile
  1839.     @PrevName = "TXT"
  1840.     @PrevJob = "MAL"
  1841. return
  1842.  
  1843. MailDownload:
  1844.     if (@@tPage == 1) call PageOff @@tPage
  1845.     call CheckMailList "3"
  1846.     #List = #return
  1847.     if (#List == "") return
  1848.     while (length(#List) > 1)
  1849.         #DowName = drop(#List, ",")
  1850.         call DownBinMail #DowName
  1851.         getini @AppIni, @App, "MailAct", ##MailAct
  1852.         if (##MailAct == 1) call MailLoop "SAV"
  1853.         else call MailLoop "DEL"
  1854.         #List = part(search(#List, ","), 1, 256)
  1855.         if (length(#List) > 1 and length(#List) < 9) goto MailDownload
  1856.     endwhile
  1857. return
  1858.  
  1859. DownBinMail:
  1860.     port autobplus = off
  1861.     send "DOW " + #1 + " PROT:BPL^M"
  1862.     wait "ファイル名 (改行のみで終了)^M^J:"
  1863.     send #1 + ".BML^M"
  1864.     wait "^E"
  1865.     download #1 + ".BML", bplus
  1866.     wait "-ダウンロード終了-"
  1867.     port autobplus = on
  1868. return
  1869.  
  1870. CheckMailList:
  1871.     #Number = ""
  1872.     #Num = ""
  1873.     send "LIST^M"
  1874.     switch
  1875.         case ":"
  1876.             ##i = 0
  1877.             beginloop
  1878.                 getchar #Number
  1879.                 if (##i == 2) breakloop
  1880.                 if (#Number == " " or #Number == "") breakloop
  1881.                 #Num = #Num + #Number
  1882.                 ##i = ##i + 1
  1883.             endloop
  1884.     endswitch
  1885.     call Prompt
  1886.     ##Num = value(#Num)
  1887.     if (##Num < 1) return ""
  1888.     #NewList = ""
  1889.     #DelList = ""
  1890.     #DowList = ""
  1891.     readbuffer 0, #Line
  1892.     ##i = 1
  1893.     if (#Line == ">")
  1894.         ##Num = ##Num + 1
  1895.         ##i = ##i + 1
  1896.     endif
  1897.     while (##i <= ##Num)
  1898.         readbuffer ##i, #Buf
  1899.         #MailName = part(#Buf, 71, 8)
  1900.         if (part(#Buf, 0, 1) != "*")
  1901.             if (part(#Buf, 29, 1) == "B")
  1902.                 #NewList = #NewList + "@" + #MailName + ","
  1903.                 #DowList = #DowList + #MailName + ","
  1904.             else
  1905.                 #NewList = #NewList + #MailName + ","
  1906.             endif
  1907.         else
  1908.             #DelList = #DelList + #MailName + ","
  1909.         endif
  1910.         ##i = ##i + 1
  1911.     endwhile
  1912.     if (#1 == "1") #RetList = #NewList
  1913.     if (#1 == "2") #RetList = #DelList
  1914.     if (#1 == "3") #RetList = #DowList
  1915. return #RetList
  1916.  
  1917. MailToId:
  1918.     input "宛先を入力して下さい。", #ToId
  1919.     if (cancel) #ToId = ""
  1920.     send toupper(#ToId) + "^M"
  1921. return
  1922.  
  1923. GetMailId:
  1924.     readfile #1, #Id
  1925.     if (no)
  1926.         closefile #1
  1927.         #Id = ""
  1928.     endif
  1929.     if (part(#Id, 0, 1) == @sRem)
  1930.         beginloop
  1931.             readfile #1, #Id
  1932.             if (part(#Id, 0, 1) == @sRem) loopagain
  1933.             if (part(#Id, 0, 1) == "@")  #Id = ""
  1934.             breakloop
  1935.         endloop
  1936.     endif
  1937.     #Id = toupper(drop(drop(drop(#Id, @sRem), "^I"), ","))
  1938. return #Id
  1939.  
  1940. MailCancel:
  1941.     #CanId = ""
  1942.     while (#CanId == "")
  1943.         input "キャンセルするメールの相手のIDは?", #CanId
  1944.         if (cancel) return
  1945.     endwhile
  1946.     send "CAN^M"
  1947.     call MailLoop "DEL", toupper(#CanId)
  1948. return
  1949.  
  1950. AddressBook:
  1951.     #File = #1
  1952.     if (#File == "")
  1953.         #File = dropback(@UpPath, "\")
  1954.         chdir #Path
  1955.         inputfilename "ファイル名", #File
  1956.         restoredir
  1957.         if (cancel) return
  1958.         #File = @UpPath + #File
  1959.     else
  1960.         if (search(#File, "\") == "") #File = @UpPath + #File
  1961.         if (not existfile(#File))
  1962.             @@ErrorLevel = 9
  1963.             goto ErrorCheck
  1964.         endif
  1965.     endif
  1966.     openfile #File
  1967.     beginloop
  1968.         readfile #File, #Line
  1969.         if (no)
  1970.             closefile #File
  1971.             return
  1972.         endif
  1973.         if (part(#Line, 0, 1) == @sRem) loopagain
  1974.         if (part(#Line, 0, 1) == "@")
  1975.             #Name = part(#Line, 1, 256)
  1976.             #Name = drop(drop(#Name, @sRem), "^I")
  1977.         else
  1978.             closefile #File
  1979.             return
  1980.         endif
  1981.         breakloop
  1982.     endloop
  1983.     send "1^M"
  1984.     call MailLoop "", "", #Name, #File
  1985.     if (value(#return > 0)
  1986.         #Msg = #return + "人分のIDを送信しました。"
  1987.         timeoutmessage #Msg, @@sDisp
  1988.     endif
  1989. return
  1990.  
  1991. MailLoop:
  1992.     #Act = #1
  1993.     #Id = #2
  1994.     #Name = #3
  1995.     #File = #4
  1996.     ##i = 0
  1997.     loopswitch
  1998.         case "^J続き (改行で"
  1999.             call Prompt
  2000.             send "^M"
  2001.         case postmilliidle(@@sProp) "^Jmore>"
  2002.             send "^M"
  2003.         case "^J受信後"
  2004.             call Prompt
  2005.             send #Act + "^M"
  2006.         case "action:"
  2007.             send #Act + "^M"
  2008.         case "削除 (1:削除する 2:しない)"
  2009.             call Prompt
  2010.             if (#Act == "DEL") send "1^M"
  2011.             else send "2^M"
  2012.         case "削除対象IDの入力(改行で終了)"
  2013.             call Prompt
  2014.             send #Id + "^M"
  2015.             #Id = ""
  2016.         case "削除対象メール数:"
  2017.             call Prompt
  2018.             send "1^M"
  2019.         case "削除メッセージの入力(漢字で20文字まで 改行のみ省略)"
  2020.             call Prompt
  2021.             #Msg1 = "内容不備のため"
  2022.             #Msg = ""
  2023.             input "削除メッセージを入力して下さい。", #Msg, #Msg1
  2024.             send #Msg + "^M"
  2025.         case "同報グループ名 (改行で終了)"
  2026.             call Prompt
  2027.             send #Name + "^M"
  2028.             if (#Name == "") breakloop
  2029.             #Name = ""
  2030.         case "ID (改行で終了)"
  2031.             call Prompt
  2032.             call GetMailId #File
  2033.             send #return + "^M"
  2034.             if (#return != "")
  2035.                 ##i = ##i + 1
  2036.             else
  2037.                 call Prompt
  2038.                 send "E^M"
  2039.                 call Prompt
  2040.                 breakloop
  2041.             endif
  2042.         case "(1:OK  2:NG)"
  2043.             call Prompt
  2044.             send "1^M"
  2045.         case "◆現在アドレスブックには、登録されていません◆", \
  2046.              "◆宛先IDが最大個数のため登録出来ません◆", \
  2047.              "-宛先ID最終登録-"
  2048.             closefile #4
  2049.             call Prompt
  2050.             send "E^M"
  2051.             call Prompt
  2052.             breakloop
  2053.         case postmilliidle(@@sProp) "^J>", \
  2054.              postmilliidle(@@sProp) "^JMAIL>", \
  2055.              "^J◆削除対象テキストがありません◆", \
  2056.              "^J◆登録されていません◆", \
  2057.              "^J◆番号又はコマンドを入力して下さい◆", \
  2058.              "^J◆番号の選択に誤りがあります◆", \
  2059.              "^J◆入力データエラー◆" ;, \
  2060. ;             "^J◆正しい番号を入力してください◆", \
  2061. ;             "^J-未読メールはありません-"
  2062.             breakloop
  2063.     endloop
  2064. return ##i
  2065.  
  2066. ;///// FORUM SUBROUTINE /////
  2067. ForumJoin:
  2068.     send "3^M"
  2069.     wait "氏名 (漢字で8文字以内 改行のみ実名)"
  2070.     call Prompt
  2071.     call MyHandle
  2072.     call MesLoop
  2073.     send "^M"
  2074. return
  2075.  
  2076. PatioJoin:
  2077.     send "1^M"
  2078.     wait "氏名 (漢字で 8文字以内  改行で登録名)"
  2079.     call Prompt
  2080.     call MyHandle
  2081.     call MesLoop
  2082.     send "^M"
  2083. return
  2084.  
  2085. ForumSysopMail:
  2086.     send "SYM^M"
  2087.     call Prompt
  2088.     send "1^M"
  2089. return
  2090.  
  2091. ForumTopMove:
  2092.     send "T^M"
  2093.     call Prompt
  2094.     call ForumKey
  2095. return
  2096.  
  2097. MesRoomMove:
  2098.     send "MES^M"
  2099.     call Prompt
  2100.     call MesRoomKey
  2101. return
  2102.  
  2103. LibMove:
  2104.     send "LIB^M"
  2105.     call Prompt
  2106.     call LibKey
  2107. return
  2108.  
  2109. MesDelete:
  2110.     #DelNum = ""
  2111.     while (#DelNum == "")
  2112.         input "削除する発言番号は?", #DelNum
  2113.         if (cancel) return
  2114.     endwhile
  2115.     send "RD " + #DelNum + "^M"
  2116.     call MesLoop
  2117. return
  2118.  
  2119. ForumOptChange:
  2120.     call SubForumOption "FM"
  2121. return
  2122.  
  2123. PatioOptChange:
  2124.     call SubForumOption "PT"
  2125. return
  2126.  
  2127. NoMRead:
  2128.     call GetRoomList
  2129.     if (#return == "") return
  2130.     #RoomList = #return
  2131.     ##h = 0
  2132.     while (length(#RoomList) > 1)
  2133.         #Room = drop(#RoomList, ",")
  2134.         #YetList = search(#RoomList, ",")
  2135.         call MakeNoMRead #Room, ##h
  2136.         #RoomList = part(#YetList, 1, 256)
  2137.         ##h = ##h + 1
  2138.     endwhile
  2139. return
  2140.  
  2141. MakeNoMRead:
  2142.     #Room = #1
  2143.     ##h = value(#2)
  2144.     if (##h == 0) send #Room + "^M"
  2145.     else send "RX " + #Room + "^M"
  2146.     call Prompt
  2147. ;    send "RMN^M"
  2148. ;    call Prompt
  2149.     send "RC MAX^M"
  2150.     call Prompt
  2151. return
  2152.  
  2153. GetRoomList:
  2154.     getini @AppIni, @App, "ForumOption", #FoptSet
  2155.     ##fPage = value(part(#FoptSet, 1, 1))
  2156.     if (##fPage == 1) call PageOff ##fPage
  2157.     send "MES^M"
  2158.     switch
  2159.         case "^J◆この機能は本フォーラムではご利用できません◆", \
  2160.              "^J現在、サービスは大変混雑しています。"
  2161.             @@ErrorLevel = 3
  2162.             goto ErrorCheck
  2163.         case "^J番号 発言 (未読)  最新  会議室名^M^J"
  2164.             ;
  2165.     endswitch
  2166.     #RoomList = ""
  2167.     beginloop
  2168.         getchar #a
  2169.         if(#a == ">") breakloop
  2170.         getline #Line
  2171.         #Line = #a + #Line
  2172.         if (part(#Line, 13, 3) != "  0")
  2173.             if (part(#Line, 0, 1) == " ")
  2174.                 #RoomList = #RoomList + part(#Line, 1, 1) + ","
  2175.             else
  2176.                 #RoomList = #RoomList + part(#Line, 0, 2) + ","
  2177.             endif
  2178.         endif
  2179.     endloop
  2180. return #RoomList
  2181.  
  2182. ListFileName:
  2183.     ##Num = 10
  2184.     ##MaxBuf = 100
  2185.     #SeaStr1 = ".LZH"
  2186.     #SeaStr2 = ".EXE"
  2187.     #SeaStr3 = ".ZIP"
  2188.     #SearchBuf = ""
  2189.     #CutStr = ""
  2190.     addmenu "ファイル名は?"
  2191.     addmenu 0
  2192.     ##j = 1
  2193.     while (##j <= ##Num)
  2194.         beginloop
  2195.             if (##i > ##MaxBuf) breakloop
  2196.             readbuffer ##i, #buf
  2197.             #buf = toupper(#buf)
  2198.             if (search(#buf, #SeaStr1) != "")
  2199.                 #CutStr = #SeaStr1
  2200.                 breakloop
  2201.             endif
  2202.             if (search(#buf, #SeaStr2) != "")
  2203.                 #CutStr = #SeaStr2
  2204.                 breakloop
  2205.             endif
  2206.             if (search(#buf, #SeaStr3) != "")
  2207.                 #CutStr = #SeaStr3
  2208.                 breakloop
  2209.             endif
  2210.             ##i = ##i + 1
  2211.             millisleep 1
  2212.         endloop
  2213.         if (##i > ##MaxBuf) breakloop
  2214.         #FileHead = drop(#buf, #CutStr)
  2215.         #FileHead = part(#FileHead, length(#FileHead) - 8, 8)
  2216.         call TrimFileName #FileHead, #CutStr
  2217.         #DownFile[##j] = #return
  2218.         addmenu #DownFile[##j]
  2219.         endif
  2220.         ##j = ##j + 1
  2221.         ##i = ##i + 1
  2222.         millisleep 1
  2223.     endwhile
  2224.     showmenu
  2225.     if (result <= 0) return
  2226.     send #DownFile[result] + "^M"
  2227. return
  2228.  
  2229. DownFileName:
  2230.     #SeaStr = "データ名:"
  2231.     call SearchFileName #SeaStr
  2232.     #File = part(search(#return, #SeaStr), 10, 255)
  2233.     #Ext = part(search(#File, "."), 0, 4)
  2234.     #Head = drop(#File, #Ext)
  2235.     if (#Head != "")
  2236.         call TrimFileName #Head, #Ext
  2237.         #DownFile = #return
  2238.         call ConfirmFileName #DownFile
  2239.         if (#return == "YES")
  2240.             send #DownFile + "^M"
  2241.             return #DownFile
  2242.         endif
  2243.     endif
  2244.     #SeaStr = ".LZH"
  2245.     call SearchFileName #SeaStr
  2246.     #Head = drop(#return, #SeaStr)
  2247.     #Head = part(#Head, length(#Head) - 8, 8)
  2248.     if (#Head != "")
  2249.         call TrimFileName #Head, #SeaStr
  2250.         #DownFile = #return
  2251.         call ConfirmFileName #DownFile
  2252.         if (#return == "YES")
  2253.             send #DownFile + "^M"
  2254.             return #DownFile
  2255.         endif
  2256.     endif
  2257.     #SeaStr = "ファイル名は"
  2258.     call SearchFileName #SeaStr
  2259.     #File = part(search(#return, #SeaStr), 12, 255)
  2260.     #Ext = part(search(#File, "."), 0, 4)
  2261.     #Head = drop(#File, #Ext)
  2262.     if (#Head != "")
  2263.         call TrimFileName #Head, #Ext
  2264.         #DownFile = #return
  2265.         call ConfirmFileName #DownFile
  2266.         if (#return == "YES")
  2267.             send #DownFile + "^M"
  2268.             return #DownFile
  2269.         endif
  2270.     endif
  2271.     call ListFileName
  2272.     if (#return == "") call InputFileName #DownFile
  2273.     send toupper(#return) + "^M"
  2274. return toupper(#return)
  2275.  
  2276. SearchFileName:
  2277.     ##i = 0
  2278.     #SearchStr = #1
  2279.     #SearchBuf = ""
  2280.     while (#SearchBuf == "")
  2281.         ##i = ##i + 1
  2282.         if(##i > 150) return ""
  2283.         readbuffer ##i, #buf
  2284.         #buf = toupper(#buf)
  2285.         #SearchBuf = search(#buf, #SearchStr)
  2286.     endwhile
  2287. return #buf
  2288.  
  2289. TrimFileName:
  2290.     ##a = length(#1)
  2291.     #Ext = #2
  2292.     ##i = 0
  2293.     while (##i < ##a + 1)
  2294.         #Char[##i] = part(#1, ##i, 1)
  2295.         ##i = ##i + 1
  2296.     endwhile
  2297.     ##j= 0
  2298.     #Head = ""
  2299.     while(##j < ##i + 1)
  2300.         if (#Char[##j] >= "^024" and #Char[##j] <= "^07E")
  2301.             if (#Char[##j] >= "^02A" and #Char[##j] <= "^02D")
  2302.             elseif (#Char[##j] == "^02F")
  2303.             elseif (#Char[##j] >= "^03A" and #Char[##j] <= "^040")
  2304.             elseif (#Char[##j] >= "^05B" and #Char[##j] <= "^05D")
  2305.             elseif (#Char[##j] >= "^060" and #Char[##j] <= "^07A")
  2306.             elseif (#Char[##j] == "^07C")
  2307.             else
  2308.                 #Head = #Head + #Char[##j]
  2309.             endif
  2310.         endif
  2311.         ##j = ##j + 1
  2312.     endwhile
  2313.     if(#Head == "") return ""
  2314.     if (length(#Head) > 9) #Head = part(#Head, length(#Head) - 8, 8)
  2315.     #FileName = #Head + #Ext
  2316. return #FileName
  2317.  
  2318. ConfirmFileName:
  2319.     #Msg = "ダウンロードファイル名は、^M" + #1 + "で良いですか?"
  2320.     timeoutquestion #Msg, @@sDisp
  2321.     if (yes) #Ret = "YES"
  2322.     else #Ret = "NO"
  2323. return #Ret
  2324.  
  2325. InputFileName:
  2326.     #Def = #1
  2327.     #DownFile = ""
  2328.     #Mes = "ダウンロードファイル名を入力して下さい。"
  2329.     input #Mes, #DownFile, #Def
  2330.     if (cancel) #Ret = ""
  2331.     else #Ret = #DownFile
  2332. return #Ret
  2333.  
  2334. LibBrowse:
  2335.     #Key = ""
  2336.     #LibDate = ""
  2337.     while (#Key == "")
  2338.         input "キーワードは?", #Key
  2339.         if (cancel) return
  2340.     endwhile
  2341.     while (#LibDate == "")
  2342.         input "日付(YYMMDD)は?", #LibDate, "931101"
  2343.         if (cancel) #LibDate = "931101"
  2344.     endwhile
  2345.     send "BRO KEY:" + toupper(#Key) + " DATE:" + #LibDate + "^M"
  2346.     call Prompt
  2347. return
  2348.  
  2349. LibSearch:
  2350.     #Data = ""
  2351.     while (#Data == "")
  2352.         input "検索するファイル名は?", #Data
  2353.         if (cancel) return
  2354.     endwhile
  2355.     send "SEA FN:" + toupper(#Data) + "^M"
  2356.     call Prompt
  2357. return
  2358.  
  2359. LibDown:
  2360.     #Lib = ""
  2361.     #Data = ""
  2362.     input "ライブラリ番号は?(キャンセル/現在のLIB)", #Lib
  2363.     if (cancel) #Lib = ""
  2364.     if (#Lib != "")
  2365.         send "LIB " + #Lib + "^M"
  2366.         call Prompt
  2367.     endif
  2368.     while (#Data == "")
  2369.         #Msg = "ダウンロードデータ番号を入力してください。^M"
  2370.         #Msg = #Msg + "ファイル名も指定する場合は、番号-ファイ^M"
  2371.         #Msg = #Msg + "ル名としてください。 (例) 123-NAH100.LZH"
  2372.         input #Msg, #Data
  2373.         if (cancel) return
  2374.     endwhile
  2375.     #DowNum = drop(#Data, "-")
  2376.     #FName = part(search(#Data, "-"), 1, 256)
  2377.     send "DOW " + #DowNum + " PROT:BPL^M"
  2378.     port autobplus = off
  2379.     call LibLoop #FName
  2380.     port autobplus = on
  2381. return
  2382.  
  2383. ;///// JOB IDENTIFY SUBROUTINE /////
  2384. IdentifyOperation:
  2385.     #Section = #1
  2386.     #PrevName = @PrevName
  2387.     switch #Section
  2388.         case "Read"
  2389.             call DlmOn
  2390.             goto GetDoName
  2391.         case "List"
  2392.             goto GetDoName
  2393.         case default
  2394.             switch #Section
  2395.                 case "SRead"
  2396.                     call DlmOn
  2397.                     #File = @SelFile
  2398.                 case "Mes"
  2399.                     #File = @MesFile
  2400.                 case "Lib"
  2401.                     #File = @LibFile
  2402.             endswitch
  2403.             if (not existfile(#File)) return
  2404.             goto GetJobSpec
  2405.     endswitch
  2406.  
  2407. GetDoName:
  2408.     ##i = 1
  2409.     ##j = 1
  2410.     beginloop
  2411.         if(##j > 4) breakloop
  2412.         if(##j == 1) getini @AppIni, "Forum", ##i, #Name
  2413.         if(##j == 2) getini @AppIni, "HP", ##i, #Name
  2414.         if(##j == 3) getini @AppIni, "Patio", ##i, #Name
  2415.         if(##j == 4) getini @AppIni, "PriForum", ##i, #Name
  2416.         if (#Name != "")
  2417.             getini @AppIni, #Name, "ReadID", ##ReadId
  2418.             if (@@LoginId == ##ReadId)
  2419.                 if (#Section == "Read")
  2420.                     getini @AppIni, #Name, "Read", ##Level
  2421.                     if (@@ReadLevel < 10)
  2422.                         if (##Level > @@ReadLevel)
  2423.                             ##i = ##i + 1
  2424.                             loopagain
  2425.                         endif
  2426.                     else
  2427.                         if (##Level != (@@ReadLevel - 10))
  2428.                             ##i = ##i + 1
  2429.                             loopagain
  2430.                         endif
  2431.                     endif
  2432.                 endif
  2433.                 if (#Section == "List")
  2434.                     getini @AppIni, #Name, "List", ##ListLev
  2435.                     if (##ListLev < 1)
  2436.                         ##i = ##i + 1
  2437.                         loopagain
  2438.                     endif
  2439.                 endif
  2440.             else
  2441.                 ##i = ##i + 1
  2442.                 loopagain
  2443.             endif
  2444.             getini @AppIni, #Name, "Function", #Func
  2445.             call GetDoDetal #Section, #Name, #Func, #PrevName, #PrevFunc
  2446.             ##i = ##i + 1
  2447.             #PrevName = drop(#Name, "-")
  2448.             #PrevFunc = #Func
  2449.             millisleep 1
  2450.             if (@AppSet == 1 and ##i > 3)
  2451.                 ##i = 1
  2452.                 ##j = ##j + 1
  2453.                 millisleep 1
  2454.             endif
  2455.         else
  2456.             ##i = 1
  2457.             if (#Section = "List") ##j = ##j + 3
  2458.             else ##j = ##j + 1
  2459.             millisleep 1
  2460.         endif
  2461.     endloop
  2462.     if (#Section == "List")
  2463.         call DateAdjust 24
  2464.         #LastListDate = part(#return, 0, 6)
  2465.         putini @AppIni, "Level", "LastListDate", #LastListDate
  2466.     endif
  2467.     @PrevName = #Name
  2468.     @PrevJob = #Job
  2469. return
  2470.  
  2471. GetDoDetal:
  2472.     #Section = #1
  2473.     #Name = #2
  2474.     #Func = #3
  2475.     #PrevName = #4
  2476.     #PrevFunc = #5
  2477.     goto CheckFunc
  2478.  
  2479. GetJobSpec:
  2480.     #Name = @PrevName
  2481.     #Job = @PrevJob
  2482.     getini @AppIni, @App, "MesLib", ##FileFlag
  2483.     #File2 = @LogPath + "NAH" + @Yr + @Mon + searchback(#File, ".")
  2484.     appendfile #File2
  2485.     if (no) createfile #File2
  2486.     writefile #File2, "[" + @Yr + "年" + @Mon + "月" + @Day + "日]"
  2487.     openfile #File
  2488.  
  2489. GetJobDetail:
  2490.     beginloop
  2491.         readfile #File, #Line
  2492.         if (no)
  2493.             closefile #File
  2494.             closefile #File2
  2495.             delfile #File
  2496.             if (##FileFlag == 1) delfile #File2
  2497.             @PrevJob = #Job
  2498.             @PrevName = #Name
  2499.             return
  2500.         else
  2501.             writefile #File2, #Line
  2502.         endif
  2503.         #Head = part(#Line, 0, 1)
  2504.         if (#Head == @sRem) loopagain
  2505.         if (#Head == "@")
  2506.             breakloop
  2507.         else
  2508.             @@ErrorLevel = 5
  2509.             goto ErrorCheck
  2510.         endif
  2511.     endloop
  2512.  
  2513. GetJobParameter:
  2514.     #PrevJob = #Job
  2515.     #PrevFunc = #Func
  2516.     #PrevName = #Name
  2517.     #PrevRoom = #Room
  2518.     #PrevLib = #Lib
  2519.     #Job = ""
  2520.     #IdBook = ""
  2521.     #Content = ""
  2522.     #Data = ""
  2523.     ##Delay = 0
  2524.     #Func = ""
  2525.     #Key = ""
  2526.     #Lib = ""
  2527.     #Name = ""
  2528.     #Password = ""
  2529.     #Room = ""
  2530.     #SavDay = ""
  2531.     #Sub = ""
  2532.     #ToId = ""
  2533.     #Type = ""
  2534.     #ActLine = #Line
  2535.     #Line = part(drop(dropback(#Line, @sRem), "^I"), 1, 256) + @sPara
  2536.     ##i = 0
  2537.     beginloop
  2538.         #a = part(#Line, ##i, 1)
  2539.         if (#a == @sPara) breakloop
  2540.         ##i = ##i + 1
  2541.     endloop
  2542.     #Job = toupper(drop(part(#Line, 0, ##i), " "))
  2543.     ##i = ##i + 1
  2544.     #Line = part(#Line, ##i, 256)
  2545.     if (length(#Line) <= 1) goto CheckJobSpec
  2546.     ##i = 0
  2547.     beginloop
  2548.         #a = part(#Line, ##i, 1)
  2549.         if (#a == @sPara)
  2550.             #p = toupper(part(#Line, 0, 2))
  2551.             #t = (part(#Line, 2, ##i - 2)
  2552.             #v = toupper(#t)
  2553.             #x = (part(#v, length(#v) - 1, 1))
  2554.             if (#x == " ")
  2555.                 #t = part(#t, 0, length(#t) - 1)
  2556.                 #v = part(#v, 0, length(#v) - 1)
  2557.             endif
  2558.             switch #p
  2559.                 case "B="
  2560.                     #IdBook = #v
  2561.                 case "C="
  2562.                     #Content = #v
  2563.                 case "D="
  2564.                     #Data = #v
  2565.                 case "F="
  2566.                     #Func = #v
  2567.                 case "I="
  2568.                     #ToId = #v
  2569.                 case "K="
  2570.                     #Key  = #v
  2571.                 case "L="
  2572.                     #Lib  = #v
  2573.                 case "N="
  2574.                     #Name = #v
  2575.                 case "P="
  2576.                     #Password = #v
  2577.                 case "R="
  2578.                     #Room = #v
  2579.                 case "S="
  2580.                     #Sub  = #t
  2581.                 case "T="
  2582.                     #Type = #v
  2583.                 case "V="
  2584.                     #SavDay = #v
  2585.                 case "Y="
  2586.                     ##Delay = value(#v)
  2587.                 case default
  2588.                     @@ErrorLevel = 8
  2589.                     #p = "Unknown"
  2590.                     goto ErrorCheck
  2591.             endswitch
  2592.             ##i = ##i + 1
  2593.             #Line = part(#Line, ##i, 256)
  2594.             if (length(#Line) <= 1) breakloop
  2595.             ##i = 0
  2596.             loopagain
  2597.         endif
  2598.         if (length(#Line) <= 1) breakloop
  2599.         ##i = ##i + 1
  2600.         loopagain
  2601.     endloop
  2602.  
  2603. CheckJobSpec:
  2604.     if (#Name == "PER")
  2605.         #JobChange = #Name
  2606.         #NameChange = #Job
  2607.         #Job = #JobChange
  2608.         #Name = #NameChange
  2609.         #JobChange = ""
  2610.         #NameChange = ""
  2611.     endif
  2612.     switch #Job
  2613.         case "MAL"
  2614.             if (#PrevJob != #Job)
  2615.                 send "MAIL^M"
  2616.                 call Prompt
  2617.                 call MailKey
  2618.             endif
  2619.             switch #Name
  2620.                 case "ADB"
  2621.                     send "ADD^M"
  2622.                     call Prompt
  2623.                     call AddressBook #Data
  2624.                     goto GetJobDetail
  2625.                 case "BIN"
  2626.                     if (search(#Data, "\") == "") #Data = @UpPath + #Data
  2627.                     if (not existfile(#Data))
  2628.                         @@ErrorLevel = 9
  2629.                         goto ErrorCheck
  2630.                     endif
  2631.                     send "UPL TYPE:BIN PROT:BPL^M"
  2632.                     goto BMailStart
  2633.                 case "LOA"
  2634.                     goto PerFile
  2635.                 case default
  2636.                     send "COM^M"
  2637.                     goto MesUpStart
  2638.             endswitch
  2639.         case "CEN"
  2640.             if (#PrevJob != #Job)
  2641.                 send "GO CENTER^M"
  2642.                 call Prompt
  2643.                 call MainMenuKey
  2644.             endif
  2645.             send "1^M"
  2646.             call Prompt
  2647.             send "1^M"
  2648.             goto MesUpStart
  2649.         case "SYM"
  2650.             if (#Func == "")
  2651.                 getini @AppIni, #Name, "Function", #Func
  2652.             endif
  2653.             if (#Password == "")
  2654.                 getini @AppIni, #Name, "Password", #Password
  2655.             endif
  2656.             if (#PrevName != #Name)
  2657.                 call Move #Func, #Name, #Password
  2658.                 if (@@ErrorLevel > 0) goto ErrorCheck
  2659.                 call ForumKey
  2660.             endif
  2661.             send "SYM^M"
  2662.             call Prompt
  2663.             send "1^M"
  2664.             goto MesUpStart
  2665.         case "PER"
  2666.             if (#PrevJob != #Job)
  2667.                 send "GO PER^M"
  2668.                 call Prompt
  2669.             call PerFileKey
  2670.             endif
  2671.             send "2^M"
  2672.             call Prompt
  2673.             goto PerFile
  2674.         case "SAY", "DOW", "UPL", "BRO", "SRE"
  2675.             if (#Job == "UPL")
  2676.                 if (search(#Data, "\") == "") #Data = @UpPath + #Data
  2677.                 if (not existfile(#Data))
  2678.                     @@ErrorLevel = 9
  2679.                     goto ErrorCheck
  2680.                 endif
  2681.             endif
  2682.             if (#Name == "") #Name = @NifId
  2683.             if (#Func == "")
  2684.                 getini @AppIni, #Name, "Function", #Function
  2685.                 if (#Function == "")
  2686.                     @@ErrorLevel = 7
  2687.                     goto ErrorCheck
  2688.                 endif
  2689.                 #Func = #Function
  2690.             endif
  2691.             goto CheckFunc
  2692.         case "SWS"
  2693.             call SwSokin #Data
  2694.             goto GetJobDetail
  2695.         case "CLP"
  2696.             send "GO CLIP^M"
  2697.             call Prompt
  2698.             send "2^M"
  2699.             call Prompt
  2700.             call ClipSet #Name, #Data, #SavDay, #Key
  2701.             goto GetJobDetail
  2702.         case default
  2703.             @@ErrorLevel = 6
  2704.             goto ErrorCheck
  2705.     endswitch
  2706.  
  2707. CheckFunc:
  2708.     #OrgName = drop(#Name, "-")
  2709.     #PrevOrgName = drop(#PrevName, "-")
  2710.     if (#Func != "FM") getini @AppIni, #Name, "Password", #Password
  2711.     switch #Func
  2712.         case "FM", "PF"
  2713.             if (#PrevOrgName != #OrgName) call Move #Func, #OrgName, #Password
  2714.         case "HP"
  2715.             if (#Name == "") #Name = @NifId
  2716.             if (#PrevFunc != #Func)
  2717.                 call Move #Func, #OrgName, #Password
  2718.             else
  2719.                 if (#PrevName != #Name)
  2720.                     send "MOVE^M"
  2721.                     call HpPtEnter #OrgName, #Password
  2722.                 endif
  2723.             endif
  2724.         case "PT"
  2725.             if (#Name == "") #Name = @NifId
  2726.             if (#PrevName != #Name or #PrevFunc != #Func)
  2727.                 call Move #Func, #OrgName, #Password
  2728.             endif
  2729.         case default
  2730.             @@ErrorLevel = 7
  2731.     endswitch
  2732.     if (@@ErrorLevel > 0)
  2733.         goto ErrorCheck
  2734.         if (#Func == "HP" or #Func == "PT")
  2735.             #Func = #Func + "E"
  2736.             if (#Section == "Read")
  2737.                 return
  2738.             endif
  2739.         endif
  2740.     endif
  2741.     switch #Section
  2742.         case "Read"
  2743.             goto SubRead
  2744.         case "List"
  2745.             goto SubList
  2746.         case "Mes"
  2747.             goto SubMes
  2748.         case "Lib"
  2749.             goto SubLib
  2750.         case "SRead"
  2751.             goto SubSelRead
  2752.     endswitch
  2753.  
  2754. ;///// READ SUBROUTINE /////
  2755. SubRead:
  2756.     getini @AppIni, #Name, "Room", #Room
  2757.     getini @AppIni, #Name, "RoomLog", #RoomLog
  2758.     getini @AppIni, #Name, "Log", #Log
  2759.     if (#RoomLog == "") #RoomLog = "00000000000000000000"
  2760.     switch #Func
  2761.         case "HP"
  2762.             if (@@tPage == 1) call PageOff @@tPage
  2763.             ##ReadMethod = value(part(#Room, 0, 1))
  2764.             ##GetRoomLog = value(part(#RoomLog, 0, 1))
  2765.             if (##ReadMethod == 0) return
  2766.             if (##GetRoomLog == 1)
  2767.                 call GetLogFile #Func, #Log, ""
  2768.                 #HpLog = #return
  2769.                 call LogStart #HpLog
  2770.             endif
  2771.             switch ##ReadMethod
  2772.                 case 1
  2773.                     send "REA NEW^M"
  2774.                 case 3
  2775.                     send "TITLE NEW^M"
  2776.             endswitch
  2777.             call Prompt
  2778.             if (##GetRoomLog == 1) call DefaultLogStart
  2779.             return
  2780.         case "PT"
  2781.             readbuffer 1, #Line
  2782.             if (part(#Line, 13, 3) != "  0") #YetList = "1,"
  2783.             else return
  2784.             if (#Room == "") #Room = "1"
  2785.         case "FM", "PF"
  2786.             send "SEND OFF^M"
  2787.             call Prompt
  2788.             call MesRoomKey
  2789.             call GetRoomList
  2790.             #YetList = #return
  2791.             if (length(#YetList) <= 1) return
  2792.             if (#Room == "") #Room = "00000000000000000000"
  2793.     endswitch
  2794.     getini @AppIni, #Name, "ReadLimit", ##RLimit
  2795.     switch ##RLimit
  2796.         case 0
  2797.             #MreRoom = ""
  2798.             #OtherRoom = ""
  2799.             while (length(#YetList) > 1)
  2800.                 #YetRoom = drop(#YetList, ",")
  2801.                 #YetList = part(#YetList, length(#YetRoom) + 1, 256)
  2802.                 ##ReadMethod = value(part(#Room, value(#YetRoom) - 1, 1))
  2803.                 ##GetRoomLog = value(part(#RoomLog, value(#YetRoom) - 1, 1))
  2804.                 if (##ReadMethod == 1 and ##GetRoomLog == 0)
  2805.                     #MreRoom = #MreRoom + #YetRoom + ","
  2806.                 else
  2807.                     #OtherRoom = #OtherRoom + #YetRoom + ","
  2808.                 endif
  2809.             endwhile
  2810.             if (#MreRoom != "")
  2811.                 if (#Func == "PT")
  2812.                     send "MRE^M"
  2813.                 else
  2814.                     #MreRoom = dropback(#MreRoom, ",")
  2815.                     send "MRE ROOM:" + #MreRoom + "^M"
  2816.                 endif
  2817.                 call Prompt
  2818.             endif
  2819.             #YetList = #OtherRoom
  2820.         case default
  2821.             ;
  2822.     endswitch
  2823.     ##j = 1
  2824.     #YetRoom = ""
  2825.     beginloop
  2826.         #YetRoom = drop(#YetList, ",")
  2827.         #YetList = part(#YetList, length(#YetRoom) + 1, 256)
  2828.         ##ReadMethod = value(part(#Room, value(#YetRoom) - 1, 1))
  2829.         ##GetRoomLog = value(part(#RoomLog, value(#YetRoom) - 1, 1))
  2830.         if (##ReadMethod > 0)
  2831.             call DoRead #Name, #YetRoom, ##ReadMethod, ##GetRoomLog, #Log, ##j
  2832.             ##j = ##j + 1
  2833.         endif
  2834.         if (length(#YetList) <= 1) breakloop
  2835.     endloop
  2836. return
  2837.  
  2838. DoRead:
  2839.     #Name = #1
  2840.     #Room = #2
  2841.     ##ReadMethod = value(#3)
  2842.     ##GetRoomLog = value(#4)
  2843.     #Log = #5
  2844.     ##Count = value(#6)
  2845.     getini @AppIni, #Name, "Function", #Func
  2846.     if (#Log == "") #Log = #Name
  2847.     call GetLogFile #Func, #Log, #Room
  2848.     #Log = #return
  2849.     getini @AppIni, #Name, "ReadLimit", ##RLimit
  2850.     getini @AppIni, "Level", "ReadLimit", ##LimitNum
  2851.     if (##LimitNum == 0) ##RLimit = 0
  2852.     if (#Func == "PT")
  2853.         readbuffer 1, #Line
  2854.         #Exist = part(#Line, 5, 6)
  2855.         #MreNum = part(#Line, 12, 4)
  2856.         send "1^M"
  2857.         if (##GetRoomLog == 1 and ##ReadMethod == 3) call LogStart #Log
  2858.         call Prompt
  2859.     else
  2860.         if (##GetRoomLog == 1 and ##ReadMethod == 3) call LogStart #Log
  2861.         if (##Count == 1) send "MES " + #Room + "^M"
  2862.         else send "RX " + #Room + "^M"
  2863.         call Prompt
  2864.         if (@@ErrorLevel > 0) goto ErrorCheck
  2865.         readbuffer 0, #Line
  2866.         if (#Line == ">") ##Num = 2
  2867.         else ##Num = 1
  2868.         readbuffer ##Num, #Line
  2869.         if (search(#Line, "リードオンリ") != "")
  2870.             ##Num = ##Num + 1
  2871.             readbuffer ##Num, #Line
  2872.         endif
  2873.         #Exist = part(drop(search(#Line, "発言数 :"), " 未読"), 8, 256)
  2874.         #MreNum = part(drop(search(#Line, "未読 :"), "-"), 6, 256)
  2875.     endif
  2876.     ##OffSet = value(#Exist) - ##LimitNum + 1
  2877.     #GetNum = ""
  2878.     if (##RLimit == 0)
  2879.         #GetNum = "NEW"
  2880.     else
  2881.         if (value(#MreNum) <= ##LimitNum)
  2882.             #GetNum = "NEW"
  2883.         else
  2884.             #GetNum = ##OffSet + "-" + #Exist
  2885.         endif
  2886.     endif
  2887.  
  2888. DoReadStart:
  2889.     switch ##ReadMethod
  2890.         case 1
  2891.             #Cmd = "MRE"
  2892.             if (#GetNum != "NEW") #Cmd = #Cmd + " MODE:" + ##OffSet
  2893.         case 2
  2894.             #Cmd = "DOW " + #GetNum + " PROT:BPL"
  2895.         case 3
  2896.             #Cmd = "RTN"
  2897. ;            #Cmd = "RMN"
  2898.     endswitch
  2899.     send #Cmd + "^M"
  2900.     switch ##ReadMethod
  2901.         case 1
  2902.             if (##GetRoomLog == 1) call LogStart #Log
  2903.             call Prompt
  2904.         case 2
  2905.             switch
  2906.                 case "^J:"
  2907.                     port autobplus = off
  2908.                 case "◆現在未読の発言はありません◆"
  2909.                     return
  2910.             endswitch
  2911.             send #Log + "^M"
  2912.             wait "^E"
  2913.             download #Log, bplus, append
  2914.             switch
  2915.                 case "@ヤ"
  2916.                     sendbreak
  2917.                     call Prompt
  2918.                     ##ReadMethod = 1
  2919.                     port autobplus = on
  2920.                     goto DoReadStart
  2921.                 case "-ダウンロード終了-"
  2922.                     call Prompt
  2923.                     port autobplus = on
  2924.             endswitch
  2925.         case 3
  2926.             call Prompt
  2927.             send "RC MAX^M"
  2928.             call Prompt
  2929.     endswitch
  2930.     if (##GetRoomLog == 1 and ##ReadMethod != 2)
  2931.         call DefaultLogStart
  2932. ;        call LogAppend #Log
  2933.     endif
  2934. return
  2935.  
  2936. ;///// LIST SUBROUTINE /////
  2937. SubList:
  2938.     getini @AppIni, #Name, "Lib", #Lib
  2939.     getini @AppIni, #Name, "LibLog", #LibLog
  2940.     getini @AppIni, #Name, "Log", #Log
  2941.     if (#Lib == "") #Lib = "00000000000000000000"
  2942.     if (#Log == "") #Log = #Name
  2943.     if (search(#LibLog, "1") == "") ##GetLibLog = 0
  2944.     else ##GetLibLog = 1
  2945.     if (search(#Lib, "0") == "")
  2946.         #ListLib = "ALL"
  2947.     else
  2948.         ##i = 1
  2949.         #ListLib = ""
  2950.         while (##i <= 20)
  2951.             ##a = value(part(#Lib, ##i - 1, 1))
  2952.             if (##a > 0) #ListLib = #ListLib + ##i + ","
  2953.             ##i = ##i + 1
  2954.         endwhile
  2955.         if (length(#ListLib) <= 1) return
  2956.         #ListLib = dropback(#ListLib, ",")
  2957.     endif
  2958.     call LibMove
  2959.     if (@@ErrorLevel > 0) goto ErrorCheck
  2960.     if (##GetLibLog == 1)
  2961.         call GetLogFile "LL", #Log, ""
  2962.         call LogStart #return
  2963.     endif
  2964.     call GetList #ListLib
  2965.     if (##GetLibLog == 1)
  2966.         call DefaultLogStart
  2967. ;        call LogAppend #Log
  2968.     endif
  2969. return
  2970.  
  2971. GetList:
  2972.     #Lib = #1
  2973.     #Cmd = "SEA"
  2974.     while (#Lib == "")
  2975.         input "ライブラリ番号は?", #Lib
  2976.         if (cancel) #Lib = "ALL"
  2977.     endwhile
  2978.     if (#Lib != "ALL") #Cmd = #Cmd + " LIB:" + #Lib
  2979.     getini @AppIni, "Level", "ListDay", ##Day
  2980.     while (##Day == "")
  2981.         input "何日前からのデータリストを取りますか?", ##Day, "10"
  2982.         if (cancel) return
  2983.     endwhile
  2984.     if (##Day == 0)
  2985.         getini @AppIni, "Level", "LastListDate", #LastDate
  2986.         if (#LastDate != "")
  2987.             #Cmd = #Cmd + " DATE:>" + #LastDate
  2988.         endif
  2989.     elseif (##Day > 0 and ##Day < 100)
  2990.         #Cmd = #Cmd + " DAY:" + ##Day
  2991.     endif
  2992.     send #Cmd + "^M"
  2993.     call Prompt
  2994. return
  2995.  
  2996. ;///// TITLE SELECT READ SUBROUTINE /////
  2997. SubSelRead:
  2998.     if (#Func == "HP")
  2999.         #Room = "1"
  3000.         #Cmd = "REA "
  3001.         #Data = drop(#Data, ",")
  3002.     else
  3003.         if (#PrevName != #Name)
  3004.             getini @AppIni, @App, "ForumOption", #FoptSet
  3005.             ##fPage = value(part(#FoptSet, 1, 1))
  3006.             ##fStop = value(part(#FoptSet, 2, 1))
  3007.             if (##fPage == 1) call PageOff ##fPage
  3008.             if (##fStop == 1) call PauseOff ##fStop
  3009.         endif
  3010.         #Cmd = "#"
  3011.     endif
  3012.     getini @AppIni, #Name, "RoomLog", #RoomLog
  3013.     ##GetRoomLog = value(part(#RoomLog, value(#Room) - 1, 1)
  3014.     getini @AppIni, #Name, "Log", #Log
  3015.     if (#Log == "") #Log = #Name
  3016.     call GetLogFile #Func, #Log, #Room
  3017.     #Log = #return
  3018.     switch #Func
  3019.         case "PT"
  3020.             if (#PrevName != #Name)
  3021.                 send "1^M"
  3022.                 call Prompt
  3023.             endif
  3024.         case "HP"
  3025.             ;
  3026.         case default
  3027.             if (not(#PrevName == #Name and #PrevRoom == #Room))
  3028.                 send "MES " + #Room + "^M"
  3029.                 call Prompt
  3030.                 if (@@ErrorLevel > 0) goto ErrorCheck
  3031.             endif
  3032.     endswitch
  3033.     #a = part(#Data, length(#Data) - 1, 1)
  3034.     if (#a == "^02D")
  3035.     elseif (#a >= "^030" and #a <= "^039")
  3036.     else
  3037.         #Data = part(#Data, 0, length(#Data) - 1)
  3038.     endif
  3039.     if (##GetRoomLog == 1) call LogStart #Log
  3040.     send #Cmd + #Data + "^M"
  3041.     call Prompt
  3042.     if (##GetRoomLog == 1)
  3043.         call DefaultLogStart
  3044. ;        call LogAppend #Log
  3045.     endif
  3046.     goto GetJobDetail
  3047.  
  3048. ;///// PERSONAL FILE SUBROUTINE /////
  3049. PerFile:
  3050.     if (#Content != "")
  3051.         if (search(#Content, "\") == "")
  3052.             #Content = @UpPath + #Content
  3053.         endif
  3054.         if (not existfile(#Content))
  3055.             @@ErrorLevel = 9
  3056.             goto ErrorCheck
  3057.         endif
  3058.     endif
  3059.     if (#IdBook != "")
  3060.         if (search(#IdBook, "\") == "")
  3061.             #IdBook = @UpPath + #IdBook
  3062.         endif
  3063.         if (not existfile(#IdBook))
  3064.             @@ErrorLevel = 9
  3065.             goto ErrorCheck
  3066.         endif
  3067.     endif
  3068.     switch #Name
  3069.         case "LOA"
  3070.             #Cmd = "LOA " + #Data + "^M"
  3071.             if (#Content != "" and #IdBook == "")
  3072.                 #IdBook = #Content
  3073.                 #Content = ""
  3074.                 openfile #IdBook
  3075.                 readfile #IdBook, #Line
  3076.                 if (no)
  3077.                     closefile #IdBook
  3078.                     return
  3079.                 endif
  3080.             endif
  3081.         case "DOW"
  3082.             #Cmd = "DOW " + #Data + "PROT:BPL^M"
  3083.         case "UPL"
  3084.             if (part(#Type, 0, 1) == "B") #Type == "BIN"
  3085.             else #Type == "TXT"
  3086.             #Cmd = "UPL TYPE:" + #Type + " PROT:BPL^M"
  3087.     endswitch
  3088.     send #Cmd
  3089.     port autobplus = off
  3090.     call MesLoop #ToId, #Sub, "PR", #Data, #IdBook, ""
  3091.     port autobplus = on
  3092.     if (#Name == "LOA" and #IdBook != "")
  3093.         beginloop
  3094.             call GetMailId #IdBook
  3095.             if (#return != "")
  3096.                 send "EDIT^M"
  3097.                 call MesLoop #return, #Sub, "PR", #Content, #IdBook
  3098.             else
  3099.                 closefile #IdBook
  3100.                 breakloop
  3101.             endif
  3102.         endloop
  3103.     endif
  3104.     if (##FileFlag == 1) delfile #Content
  3105.     goto GetJobDetail
  3106.  
  3107. ;///// MESSAGE SUBROUTINE /////
  3108. SubMes:
  3109.     if (#Content != "")
  3110.         if (search(#Content, "\") == "")
  3111.             #Content = @UpPath + #Content
  3112.         endif
  3113.         if (not existfile(#Content))
  3114.             @@ErrorLevel = 9
  3115.             goto ErrorCheck
  3116.         endif
  3117.     endif
  3118.     if (#IdBook != "")
  3119.         if (search(#IdBook, "\") == "")
  3120.             #IdBook = @UpPath + #IdBook
  3121.         endif
  3122.         if (not existfile(#IdBook))
  3123.             @@ErrorLevel = 9
  3124.             goto ErrorCheck
  3125.         endif
  3126.     endif
  3127.     switch #Func
  3128.         case "HP"
  3129.             #Sub = @NifHandle + "/" + #Sub
  3130.             send "COM^M"
  3131.             call MesLoop "", #Sub, #Func, "", "", ""
  3132.             if (#Data != "")
  3133.                 send "RE:" + #Data + "^M"
  3134.                 wait postmilliidle(@@sProp) "^M^J"
  3135.             endif
  3136.             goto MesUpload
  3137.         case "PT"
  3138.             if (#PrevName != #Name)
  3139.                 send "1^M"
  3140.                 call Prompt
  3141.             endif
  3142.         case default
  3143.             if (not(#PrevName == #Name and #PrevRoom == #Room))
  3144.                 send "MES " + #Room + "^M"
  3145.                 call Prompt
  3146.                 if (@@ErrorLevel > 0) goto ErrorCheck
  3147.                 readbuffer 0, #PropLine
  3148.                 if (#PropLine == ">") ##i = 2
  3149.                 else ##i = 1
  3150.                 readbuffer ##i, #ChkReadOnly
  3151.                 if (#ChkReadOnly == "-この会議室はリードオンリーです-")
  3152.                     @@ErrorLevel = 3
  3153.                     goto ErrorCheck
  3154.                 endif
  3155.             endif
  3156.     endswitch
  3157.     if (#Job == "SAY" and #Data != "") send "RE " + #Data + "^M"
  3158.     else send "COM^M"
  3159.  
  3160. MesUpStart:
  3161.     switch
  3162.         case "終了は行頭で/E)^M^J"
  3163.             if (#Job == "MAL" and #ToId != "")
  3164.                 if (search(#ToId, ",") != "")
  3165.                 elseif (search(#ToId, "INET:") != "")
  3166.                 else
  3167.                     send "TO:" + #ToId + "^M"
  3168.                     wait postmilliidle(@@sProp) "^M^J"
  3169.                 endif
  3170.             endif
  3171.             if (#Sub != "")
  3172.                 send "SUB:" + #Sub + "^M"
  3173.                 wait postmilliidle(@@sProp) "^M^J"
  3174.             endif
  3175.         case "◆既に削除されています◆", \
  3176.              "◆該当する発言はありません◆"
  3177.             call Prompt
  3178.             @@ErrorLevel = 10
  3179.             goto Errorcheck
  3180.         case "-登録個数が最大のため登録出来ません-"
  3181.             call Prompt
  3182.             @@ErrorLevel = 11
  3183.             goto Errorcheck
  3184.     endswitch
  3185.  
  3186. MesUpload:
  3187.     getini @AppIni, @App, "Footer", ##Foot
  3188.     if (##Delay == 0 and #Content != "")
  3189.         upload #Content, none
  3190.     endif
  3191.     beginloop
  3192.         readfile #File, #Line
  3193.         if (no)
  3194.             if (##Delay == 1 and #Content != "") upload #Content, none
  3195.             if (##Foot == 1 and #Func != "HP") call MesFooter #Job
  3196.             send "/POST^M"
  3197.             if (#IdBook != "") openfile #IdBook
  3198.             call MesLoop #ToId, #Sub, #Func, "", #IdBook, ""
  3199.             if (##FileFlag == 1) delfile #Content
  3200.             goto GetJobDetail
  3201.         endif
  3202.         writefile #File2, #Line
  3203.         #Head = part(#line, 0, 1)
  3204.         #ChkLine = toupper(#Line)
  3205.         if (#Head == @sRem) loopagain
  3206.         if (#Head == "@") breakloop
  3207.         if (#ChkLine == "/E")
  3208.         elseif (#ChkLine == "/POST")
  3209.         elseif (part(#ChkLine, 0, 3) == "RE:")
  3210.         else
  3211.             if (part(#ChkLine, 0, 3) == "TO:" and #ToId == "")
  3212.                 #ToId = part(#Line, 3, 256)
  3213.             endif
  3214.             if (part(#ChkLine, 0, 4) == "SUB:" and #Sub == "")
  3215.                 #Sub = part(#Line, 4, 256)
  3216.             endif
  3217.             send #Line + "^M"
  3218.             switch
  3219.                 case postmilliidle(@@sProp) "^M^J"
  3220.                 ;
  3221.                 case "◆最大行数を越えました◆"
  3222.                     call MesLoop #ToId, #Sub, #Func, "", "", "N"
  3223.                     goto MesUploadEnd
  3224.             endswitch
  3225.         endif
  3226.     endloop
  3227.     if (##Delay == 1 and #Content != "")
  3228.         upload #Content, none
  3229.     endif
  3230.     if (##Foot == 1 and #Func != "HP") call MesFooter #Job
  3231.     send "/POST^M"
  3232.     if (#IdBook != "") openfile #IdBook
  3233.     call MesLoop #ToId, #Sub, #Func, "", #IdBook, ""
  3234.  
  3235. MesUploadEnd:
  3236.     if (##FileFlag == 1) delfile #Content
  3237.     goto GetJobParameter
  3238.  
  3239. MesFooter:
  3240.     send "^M"
  3241.     wait postmilliidle(@@sProp) "^M^J"
  3242.     switch #1
  3243.         case "SAY"
  3244.             getini @AppIni, @App, "SayFooter" + (@@LoginId + 1), #SFoot
  3245.             if (#SFoot != "") send #SFoot + "^M"
  3246.             else call MyHandle
  3247.         case default
  3248.             getini @AppIni, @App, "MailFooter" + (@@LoginId + 1), #MFoot
  3249.             if (#MFoot != "") send #MFoot + "^M"
  3250.             else send @NameJ + " (" + @NifId + ")" + "^M"
  3251.     endswitch
  3252. return
  3253.  
  3254. BMailStart:
  3255.     port autobplus = off
  3256.     if (#IdBook != "") openfile #IdBook
  3257.     call MesLoop #ToId, #Sub, "", #Data, #IdBook, ""
  3258.     port autobplus = on
  3259.     goto GetJobDetail
  3260.  
  3261. MesLoop:
  3262.     #ToId = #1
  3263.     #Sub = #2
  3264.     #Func = #3
  3265.     #Data = #4
  3266.     #IdBook = #5
  3267.     #ActFlag = #6
  3268.     if (search(#ToId, ",") != "")
  3269.         ##i = 1
  3270.         #ToId = #ToId + ","
  3271.         while (length(#ToId) > 2)
  3272.             #SendId[##i] = drop(#ToId, ",")
  3273.             #ToId = part(search(#ToId, ","), 1, 256)
  3274.             if (search(#SendId[##i], "CIS>") != "")
  3275.                 #SendId[##i] = #SendId[##i] + "," + drop(#ToId, ",")
  3276.                 #ToId = part(search(#ToId, ","), 1, 256)
  3277.             endif
  3278.             if (##i > 10) breakloop
  3279.             ##i = ##i + 1
  3280.         endwhile
  3281.     else
  3282.         #SendId[1] = #ToId
  3283.     endif
  3284.     ##Count = 1
  3285.     ##IdError = 0
  3286.     if (#ActFlag = "") #ActFlag = "Y"
  3287.     if (#IdBook != "") ##SendIdBook = 0
  3288.     loopswitch
  3289.         case "終了は行頭で/E"
  3290.             wait "^M^J"
  3291.             if (#Func == "HP") breakloop
  3292.             send "/E^M"
  3293.          case "修正 (1:修正する 2:しない)"
  3294.             call Prompt
  3295.             send "2^M"
  3296.         case "ファイル名"
  3297.             call Prompt
  3298.             send #Data + "^M"
  3299.         case "題名 (漢字で20文字まで)"
  3300.             call Prompt
  3301.             if (#Sub == "")
  3302.                 input "題名を入力して下さい。", #Sub
  3303.                 if (cancel)
  3304.                     send "DUMMY^M"
  3305.                     #ActFlag = "N"
  3306.                 endif
  3307.             endif
  3308.             send #Sub + "^M"
  3309.         case "ハンドルネームとタイトル (漢字モードで20文字以内)"
  3310.              call Prompt
  3311.             if (#Sub == "")
  3312.                 input "題名を入力して下さい。", #Sub
  3313.                 if (cancel)
  3314.                     send @NifHandle + "/" + "題名忘れ" + "^M"
  3315.                     #ActFlag = "N"
  3316.                 endif
  3317.             endif
  3318.             send #Sub + "^M"
  3319.         case "宛先 (IDか同報グループ名 改行で終了)", \
  3320.              "宛先 (IDか同報グループ名又は FAX番号 改行で終了)", \
  3321.              "宛先 (例 abc@cc.xyz.ac.jp 改行で終了)"
  3322.             call Prompt
  3323.             if (##Count == 1)
  3324.                 if (#SendId[1] == "")
  3325.                     if (#IdBook != "")
  3326.                         call GetMailId #IdBook
  3327.                         send #return + "^M"
  3328.                     else
  3329.                         call MailToId
  3330.                     endif
  3331.                 else
  3332.                     send #SendId[1] + "^M"
  3333.                 endif
  3334.             else
  3335.                 if (#IdBook != "" and #SendId[##Count] == "")
  3336.                     call GetMailId #IdBook
  3337.                     send #return + "^M"
  3338.                 else
  3339.                     send #SendId[##Count] + "^M"
  3340.                 endif
  3341.             endif
  3342.             ##Count = ##Count + 1
  3343.         case "送信(1:送信する  2:しない  3:期日指定)", \
  3344.              "送信 (1:送信する 2:しない)", \
  3345.              "送信(1:送信する 2:しない)", \
  3346.              "登録 (1:登録する  2:しない)"
  3347.             call Prompt
  3348.             if (#ActFlag != "N") send "1^M"
  3349.             else send "2^M"
  3350.         case "(1:OK  2:NG)", "(1:OK 2:NG)", "項目 (1:OK  2:NG  3:修正)", \
  3351.              "削除 (1:削除する  2:しない)"
  3352.             call Prompt
  3353.             send "1^M"
  3354.         case "削除メッセージの入力 (漢字で14文字まで  改行のみ :省略) "
  3355.             call Prompt
  3356.             #Mes = "送信ミスのため"
  3357.             input "削除メッセージを入力して下さい。", #DelMes, #Mes
  3358.             if (cancel) #DelMes = #Mes
  3359.             send #DelMes + "^M"
  3360.         case "^M^J続き (改行で"
  3361.             call Prompt
  3362.             send "^M"
  3363.         case postmilliidle(@@sProp) "^Jmore>"
  3364.             send "^M"
  3365.         case "-ダウンロード開始-^M^J"
  3366.             wait "^E"
  3367.             download #Data, bplus
  3368.         case "-アップロード開始-^M^J"
  3369.             upload #Data, bplus
  3370.         case "◆登録されていません◆"
  3371.             call Prompt
  3372.             ##IdError = 1
  3373.         case "◆宛先を指定して下さい◆"
  3374.             call Prompt
  3375.             send "^M"
  3376.             if (##IdError == 1) breakloop
  3377.             call Prompt
  3378.             breakloop
  3379.         case "-送信完了-"
  3380.             call Prompt
  3381.             if (#IdBook == "")
  3382.                 breakloop
  3383.             else
  3384.                 call GetMailId #IdBook
  3385.                 if (#return == "")
  3386.                     breakloop
  3387.                 else
  3388.                     send "EDIT^M"
  3389.                     #SendId[##Count] = #return
  3390.                 endif
  3391.             endif
  3392.         case "-登録完了-", "-削除完了-", \
  3393.              "◆コメントがついているため削除出来ません◆", \
  3394.              "◆正しい番号を入力してください◆", \
  3395.              "◆番号又はコマンドを入力して下さい◆", \
  3396.              "^M^J番号 発言 (未読)  最新  会議室名^M^J"
  3397.             call Prompt
  3398.             breakloop
  3399.     endloop
  3400. return
  3401.  
  3402. ;///// DATA UPLOAD & DOWNLOAD SUBROUTINE /////
  3403. SubLib:
  3404.     if (not(#PrevName == #Name and #PrevLib == #Lib))
  3405.         send "LIB " + #Lib + "^M"
  3406.         call Prompt
  3407.         if (@@ErrorLevel > 0) goto ErrorCheck
  3408.         call LibKey
  3409.     endif
  3410.     if (#Job == "UPL") goto Upload
  3411.     while (#Data == "")
  3412.         input "データ番号は?", #Data
  3413.     endwhile
  3414.     send "DOW " + #Data + " PROT:BPL^M"
  3415.     if (#Content != "")
  3416.         if (search(#Content, "\") != "")
  3417.             #Data = #Content
  3418.         else
  3419.             #Data = @DownPath + #Content
  3420.         endif
  3421.     else
  3422.         #Data = ""
  3423.     endif
  3424.     goto LibEnd
  3425.  
  3426. Upload:
  3427.     if (#Key == "")
  3428.         @@ErrorLevel = 8
  3429.         #p = "キーワード"
  3430.         goto ErrorCheck
  3431.     endif
  3432.     ##i = 1
  3433.     while (##i < 6)
  3434.         #Keyword[##i] = ""
  3435.         ##i = ##i + 1
  3436.     endwhile
  3437.     #Key = #Key + ","
  3438.     ##i = 0
  3439.     ##h = 1
  3440.     beginloop
  3441.         #a = part(#Key, ##i, 1)
  3442.         if ( #a == "," )
  3443.             #Keyword[##h] = toupper(part(#Key, 0, ##i))
  3444.             ##h = ##h + 1
  3445.             ##i = ##i + 1
  3446.             #Key = part(#Key, ##i, 256)
  3447.             if (length(#Key) <= 1 ) breakloop
  3448.             ##i = 0
  3449.         endif
  3450.         if (length(#Key) <= 1) breakloop
  3451.         ##i = ##i + 1
  3452.     endloop
  3453.     switch #Type
  3454.         case "T", "TXT", "TEXT"
  3455.             #Type = "TXT"
  3456.             ##Type = 1
  3457.         case "B", "BIN"
  3458.             #Type = "BIN"
  3459.             ##Type = 2
  3460.         case "N", "NAPLPS"
  3461.             #Type = "NAPLPS"
  3462.             ##Type = 3
  3463.         case "J", "JPEG"
  3464.             #Type = "JPEG"
  3465.             ##Type = 4
  3466.         case default
  3467.             @@ErrorLevel = 8
  3468.             #p = "データタイプ"
  3469.             goto ErrorCheck
  3470.     endswitch
  3471.     if (#Content != "")
  3472.         if (search(#Content, "\") == "")
  3473.             #Content = @UpPath + #Content
  3474.         endif
  3475.         if (not existfile(#Content))
  3476.             @@ErrorLevel = 9
  3477.             goto ErrorCheck
  3478.         endif
  3479.     endif
  3480.     ##Count = 1
  3481.     send "UPL TYPE:" + #Type + " PROT:BPL^M"
  3482.     loopswitch
  3483.         case "データ名 (漢字20字まで)"
  3484.             call Prompt
  3485.             send #Sub + "^M"
  3486.         case "属性 (1:テキスト  2:バイナリ  3:NAPLPS  4:JPEG)"
  3487.             call Prompt
  3488.             send ##Type + "^M"
  3489.         case "修正 (1:修正する  2:しない)"
  3490.             call Prompt
  3491.             send "2^M"
  3492.         case "(1:OK  2:NG)", "確認 (1:OK  2:NG)"
  3493.             call Prompt
  3494.             send "1^M"
  3495.         case "検索キー (漢字10字以内/1KEY 入力可能数:"
  3496.             call Prompt
  3497.             send #Keyword[##Count] + "^M"
  3498.             ##Count = ##Count + 1
  3499.         case "補足説明"
  3500.             wait postmilliidle(@@sProp) "^M^J"
  3501.             breakloop
  3502.     endloop
  3503.     if (#Content != "") upload #Content, none
  3504.     beginloop
  3505.         readfile #File, #Line
  3506.         if (no)
  3507.             send "/POST^M"
  3508.             goto LibEnd
  3509.         endif
  3510.         writefile #File2, #Line
  3511.         #Head = part(#line, 0, 1)
  3512.         if (#Head == @sRem) loopagain
  3513.         if (#Head == "@") breakloop
  3514.         if (toupper(#Line) == "/E")
  3515.         elseif (toupper(#Line) == "/POST")
  3516.         else
  3517.             send #Line + "^M"
  3518.             wait postmilliidle(@@sProp) "^M^J"
  3519.         endif
  3520.     endloop
  3521.     send "/POST^M"
  3522.     port autobplus = off
  3523.     call LibLoop #Data, #Job
  3524.     if (##FileFlag == 1) delfile #Content
  3525.     goto GetJobParameter
  3526.  
  3527. LibEnd:
  3528.     port autobplus = off
  3529.     call LibLoop #Data, #Job
  3530.     port autobplus = on
  3531.     goto GetJobDetail
  3532.  
  3533. LibLoop:
  3534.     #Data = #1
  3535.     #Job = #2
  3536.     loopswitch
  3537.         case "処理 (1:ダウンロード  ", "(1:OK  2:NG)", \
  3538.              "項目 (1:OK  2:NG  3:修正)"
  3539.             call Prompt
  3540.             send "1^M"
  3541.         case "プロトコル (1:XMODEM  2:", "修正 (1:修正する  2:しない)"
  3542.             call Prompt
  3543.             send "2^M"
  3544.         case "項目 (1:OK  2:NG  E:終了)"
  3545.             call Prompt
  3546.             if (#Job == "BRO")
  3547.                 send "E^M"
  3548.                 call Prompt
  3549.                 breakloop
  3550.             else
  3551.                 send "1^M"
  3552.             endif
  3553.         case "ファイル名 (改行のみで終了)"
  3554.             call Prompt
  3555.             if (#Data == "")
  3556.                 call DownFileName
  3557.                 #Data = @DownPath + #return
  3558.             else
  3559.                 send #Data + "^M"
  3560.             endif
  3561.         case "-ダウンロード開始-^M^J"
  3562.             wait "^E"
  3563.             if (existfile(#Data))
  3564.                 download #Data, bplus, resume
  3565.             else
  3566.                 download #Data, bplus
  3567.             endif
  3568.         case "-アップロード開始-"
  3569.             upload #Data, bplus
  3570.         case "続き (改行で表示 E:終了)^M^J>", \
  3571.              postmilliidle(@@sProp) "^Jmore>"
  3572.             send "^M"
  3573.         case "◆不当なタイプのパケットを転送した◆"
  3574.             send "^M"
  3575.             call Prompt
  3576.             breakloop
  3577.         case "-ダウンロード終了-", "-アップロード終了-", \
  3578.              "データライブラリ (1:データ一覧", "処理 (1:検索", \
  3579.              "◆データ件数が最大のためアップロード出来ません◆", \
  3580.              "◆番号又はコマンドを入力して下さい◆", \
  3581.              "◆ファイルアクセスでエラーが発生した◆", \
  3582.              "-該当するデータはありません-"
  3583.             call Prompt
  3584.             breakloop
  3585.     endloop
  3586. return
  3587.  
  3588. ;///// SHAREWARE SOKIN SUBROUTINE /////
  3589. SwSokin:
  3590.     #SwNum = #1
  3591.     send "GO SWREG^M"
  3592.     call Prompt
  3593.     send "3^M"
  3594.     @PrevJob = "SWS"
  3595.     call Prompt
  3596.     while (#SwNum == "")
  3597.         input "シェアウェア番号を入力して下さい。", #SwNum
  3598.         if (cancel) return
  3599.     endwhile
  3600.     send "2^M"
  3601.  
  3602. SwSokinLoop:
  3603.     loopswitch
  3604.         case "送金システム (1:シェアウェア番号指定  2:作者ID指定  3:送金代行"
  3605.             call Prompt
  3606.             send "1^M"
  3607.         case "シェアウェア番号 (改行のみでソフト種別一覧  E:終了)"
  3608.             call Prompt
  3609.             send #SwNum + "^M"
  3610.         case "送金希望 (1:希望する 2:しない  E:終了)"
  3611.             call Prompt
  3612.             #Msg = "送金するシェアウェアは "
  3613.             #Msg =#Msg + #SwNum + " で良いですか?"
  3614.             timeoutquestion #Msg, @@sDisp
  3615.             if (yes)
  3616.                 send "1^M"
  3617.             else
  3618.                 send "E^M"
  3619.                 breakloop
  3620.             endif
  3621.         case "送金確認 (1:送金する  2:しない)"
  3622.             call Prompt
  3623.             #Msg ="送金して良いですか?"
  3624.             timeoutquestion #Msg, @@sDisp
  3625.             if (yes)
  3626.                 send "1^M"
  3627.             else
  3628.                 send "2^M"
  3629.                 breakloop
  3630.             endif
  3631.         case "-送金受領-", "今回の送金代行番号は"
  3632.             breakloop
  3633.         case "◆該当するシェアウェアはありません◆"
  3634.             send "E^M"
  3635.             breakloop
  3636.     endloop
  3637.     wait "シェアウェア番号 (改行のみでソフト種別一覧  E:終了)"
  3638.     call Prompt
  3639.     send "E^M"
  3640.     call Prompt
  3641.     call MainMenuKey
  3642. return
  3643.  
  3644. CheckSwReg:
  3645.     switch @@LoginId
  3646.         case 1
  3647.             #ChkSwNum = "SwNum1"
  3648.             #ChkSwLog = "SwLog1"
  3649.             #ChkLast = ""LastChkSwNum1"
  3650.         case default
  3651.             #ChkSwNum = "SwNum0"
  3652.             #ChkSwLog = "SwLog0"
  3653.             #ChkLast = "LastChkSwNum0"
  3654.     endswitch
  3655.     ##n = 1
  3656.     while (##n < 3)
  3657.         getini @AppIni, "SwReg", #ChkSwNum + ##n, #SwNum[##n]
  3658.         getini @AppIni, "SwReg", #ChkSwLog + ##n, #SwLog[##n]
  3659.         getini @AppIni, "SwReg", #ChkLast + ##n, #LastChk[##n]
  3660.         ##n = ##n + 1
  3661.     endwhile
  3662.     if (#SwNum[1] == "") return
  3663.     getini @AppIni, "SwReg", "LastCheckDate", #LastCheckDate
  3664.     getini @AppIni, "SwReg", "SwLogMethod", ##SwLogMtd
  3665.     send "GO SWREG^M"
  3666.     call Prompt
  3667.     @PrevJob = "SWR"
  3668.     send "3^M"
  3669.     call Prompt
  3670.     ##n = 0
  3671.     send "2^M"
  3672.     loopswitch
  3673.         case "4:シェアウェア登録・修正申請  5:作者送金代行確認"
  3674.             call Prompt
  3675.             ##n = ##n + 1
  3676.             if (#SwNum[##n] == "" or ##n > 2)
  3677.                 send "E^M"
  3678.                 call Prompt
  3679.                 breakloop
  3680.             else
  3681.                 send "5^M"
  3682.             endif
  3683.         case "SW番号  作者ID    作者名            金額(\) シェアウェア名"
  3684.             call Prompt
  3685.             send #SwNum[##n] + "^M"
  3686.         case "検索開始月日 (例: 0801 8月 1日分検索  2カ月前まで検索可)"
  3687.             call Prompt
  3688.             send #LastCheckDate + "^M"
  3689.         case "検索終了月日 (例: 0801 8月 1日分検索  2カ月前まで検索可)"
  3690.             call Prompt
  3691.             send "^M"
  3692.             if (##SwLogMtd == 1) call LogStart #SwLog[##n]
  3693.         case "月日  時間        金額(\) ID        送金者名"
  3694.             call Prompt
  3695.             if (##SwLogMtd == 0)
  3696.             elseif (##SwLogMtd == 1)
  3697.                 call DefaultLogStart
  3698.                 call LogAppend #SwLog[##n]
  3699.             else
  3700.                 ##i = 1
  3701.                 beginloop
  3702.                     readbuffer ##i, #buf
  3703.                     if (part(#buf, 0, 4) == "月日") breakloop
  3704.                     ##i = ##i + 1
  3705.                 endloop
  3706.                 millisleep 1
  3707.                 ##i = ##i - 1
  3708.                 beginloop
  3709.                     if (##i == 0)
  3710.                         call LogAppend #SWRegFile
  3711.                         breakloop
  3712.                     endif
  3713.                     readbuffer ##i, #buf
  3714.                     #SWRegDate = @Yr + "/" + part(#buf, 0, 14) + ","
  3715.                     #SWRegId = part(#buf, 26, 8) + @sRem
  3716.                     #SwRegName = part(#buf, 36, 16)
  3717.                     ##j = 14
  3718.                     beginloop
  3719.                         #c1 = part(#SwRegName, ##j , 1)
  3720.                         #c2 = part(#SwRegName, ##j , 2)
  3721.                         if (#c1 == " " or #c2 == " ")
  3722.                             ##j = ##j - 2
  3723.                             loopagain
  3724.                         endif
  3725.                         #SwRegName = part(#SwRegName, 0, ##j +2) + ","
  3726.                         breakloop
  3727.                     endloop
  3728.                     #SwRegNumChk = part(#buf, 55, 14)
  3729.                     if (#SwRegNumChk > #LastChk[##n])
  3730.                         #SwRegNum = #SwRegNumChk + ","
  3731.                         #SwRegLine = #SwRegId + #SwRegName
  3732.                         #SwRegLine = #SwRegLine + #SWRegDate + #SwRegNum
  3733.                         if (search(#SwLog[##n], "\") == "")
  3734.                             #SWRegFile = @UpPath + #SwLog[##n]
  3735.                         else
  3736.                             #SWRegFile = #SwLog[##n]
  3737.                         endif
  3738.                         appendfile #SWRegFile
  3739.                         if (no) createfile #SWRegFile
  3740.                         writefile #SWRegFile, #SWRegLine
  3741.                         closefile #SWRegFile
  3742.                         putini @AppIni, "SwReg", #ChkLast + ##n, #SwRegNumChk
  3743.                     endif
  3744.                     ##i = ##i - 1
  3745.                 endloop
  3746.             endif
  3747.             send "E^M"
  3748.         case "◆番号又はコマンドを入力して下さい◆", \
  3749.              "◆データが登録されていません◆"
  3750.             send "E^M"
  3751. ;            call Prompt
  3752. ;            breakloop
  3753.     endloop
  3754.     call DateAdjust 24
  3755.     #LastCheckDate = part(#return, 2, 4)
  3756.     putini @AppIni, "SwReg", "LastCheckDate", #LastCheckDate
  3757. return
  3758.  
  3759. ;///// FORUM OPTION CHANGE SUBROUTINE /////
  3760. SubForumOption:
  3761.     #Func = #1
  3762.     getini @AppIni, @App, "ForumOption", #FoptSet
  3763.     ##Menu = value(part(#FoptSet, 0, 1))
  3764.     ##Page = value(part(#FoptSet, 1, 1))
  3765.     ##Stop = value(part(#FoptSet, 2, 1))
  3766.     ##Read = value(part(#FoptSet, 3, 1))
  3767.     if (##Menu != 1) ##Menu = 2
  3768.     if (##Page != 1) ##Page = 2
  3769.     if (##Stop != 1) ##Stop = 2
  3770.     if (##Read != 1) ##Read = 2
  3771.     ##i = 1
  3772.     while (##i < 7)
  3773.         #FoptNum[##i] = ##i
  3774.         ##i = ##i + 1
  3775.     endwhile
  3776.     if (#Func == "PT") #FoptNum[4] = "E"
  3777.     else #FoptNum[7] = "E"
  3778.     if (#Func != "")
  3779.         ##Count = 1
  3780.         send "OPT^M"
  3781.     else
  3782.         send "MEMBER^M"
  3783.         call Prompt
  3784.         send "7^M"
  3785.     endif
  3786.     @PrevJob = "FOP"
  3787.     loopswitch
  3788.         case "オプション (1:メニュー表示  2:ページ制御  3:氏名変更"
  3789.             call Prompt
  3790.             send #FoptNum[##Count] + "^M"
  3791.             if (#FoptNum[##Count] == "E") breakloop
  3792.             ##Count = ##Count + 1
  3793.         case "フォーラム・オプション (1:設定・変更  2:解除  改行のみ終了)"
  3794.             send "1^M"
  3795.         case "メニュー表示 (1:行う  2:行わない"
  3796.             call Prompt
  3797.             send ##Menu + "^M"
  3798.         case "ページ制御 (1:行う  2:行わない"
  3799.             call Prompt
  3800.             send ##Page + "^M"
  3801.         case "新氏名の入力"
  3802.             call Prompt
  3803.             send @NifHandle + "^M"
  3804.         case "(1:OK  2:NG)"
  3805.                call Prompt
  3806.                send "1^M"
  3807.         case "登録する会議室番号"
  3808.             call Prompt
  3809.             send "^M"
  3810.         case "会議室発言の読み方 (1:発言番号順  2:ペアレントリンク"
  3811.             call Prompt
  3812.             send ##Read + "^M"
  3813.         case "各発言ごとに停止 (1:停止する  2:しない"
  3814.             call Prompt
  3815.             send ##Stop + "^M"
  3816.         case "確認(1:登録する 2:しない)"
  3817.             send "1^M"
  3818.             breakloop
  3819.     endloop
  3820.     call Prompt
  3821. return
  3822.  
  3823. ;///// TERMINAL SET CHANGE SUBROUTINE /////
  3824. SubTerminalSet:
  3825.     getini @AppIni, @App, "TermLine",##TermLine
  3826.     getini @AppIni, @App, "Terminal", #TermSet
  3827.     ##TermControl = value(part(#TermSet, 0, 1))
  3828.     ##TermPage = value(part(#TermSet, 1, 1))
  3829.     ##TermMenu = value(part(#TermSet, 2, 1))
  3830.     ##TermPBreak = value(part(#TermSet, 3, 1))
  3831.     if (##TermControl != 1) ##TermControl = 2
  3832.     if (##TermPage != 1) ##TermPage = 2
  3833.     if (##TermMenu != 1) ##TermMenu = 2
  3834.     if (##TermPBreak != 1) ##TermPBreak = 2
  3835.     call MainMenuKey
  3836.     ##Count = 1
  3837.     send "TERMINAL^M"
  3838.     @PrevJob = "TRM"
  3839.     loopswitch
  3840.         case "^M^J端末設定 (1:画面行数  2:コントロールコード  3:"
  3841.             call Prompt
  3842.             if (##Count == 6)
  3843.                 send "E^M"
  3844.                 breakloop
  3845.             endif
  3846.             send ##Count + "^M"
  3847.             ##Count = ##Count + 1
  3848.         case "^J画面行数(9~99"
  3849.             call Prompt
  3850.             send ##TermLine + "^M"
  3851.         case "^Jコントロールコード (1:出力する 2:"
  3852.             call Prompt
  3853.             send ##TermControl + "^M"
  3854.         case "^Jページ制御 (1:行う  2:"
  3855.             call Prompt
  3856.             send ##TermPage + "^M"
  3857.         case "^Jメニュー表示 (1:行う  2:"
  3858.             call Prompt
  3859.             send ##TermMenu + "^M"
  3860.         case "^J改ページ制御 (1:行う  2:"
  3861.             call Prompt
  3862.             send ##TermPBreak + "^M"
  3863.     endloop
  3864.     call Prompt
  3865. return
  3866.  
  3867. ;///// SEND REACTION SUBROUTINE /////
  3868. SendReact:
  3869.     #SendId = part(search(#1, "-"), 2, 8)
  3870.     #Msg = "SEND " + #SendId + " 私は、オートパイロット中です。"
  3871.     #Msg = #Msg + "失礼します。 " + @NifHandle
  3872.     send "^M"
  3873.     call Prompt
  3874.     send #Msg + "^M"
  3875. return
  3876.  
  3877. ;///// ERROR SUBROUTINE /////
  3878. ErrorCheck:
  3879.     switch @@ErrorLevel
  3880.         case 1
  3881.             #Msg = "エラーが発生したので電話を切ります。"
  3882.             goto ErrorHangup
  3883.         case 2
  3884.             #Msg = "移動できませんでした"
  3885.             if (#Name != "") #Msg = #Name + "へ" + #Msg
  3886.         case 3
  3887.             #Msg = "会議室へ移動できませんでした"
  3888.             if (#Name != "") #Msg = #Name + "の" + #Msg
  3889.         case 4
  3890.             #Msg = "ライブラリへ移動できませんでした"
  3891.             if (#Name != "") #Msg = #Name + "の" + #Msg
  3892.         case 5
  3893.             #Msg = #File + "のヘッダー形式が不正です"
  3894.         case 6
  3895.             #Msg = #File + "の " + #Job + " の形式が不正です"
  3896.         case 7
  3897.             #Msg = #File + "の " + #Name
  3898.             #Msg = #Msg + " のファンクション形式が不正です"
  3899.         case 8
  3900.             #Msg = #File + "の " + #Job
  3901.             #Msg = #Msg + " のパラメータ(" + #p + ")が不正です"
  3902.         case 9
  3903.             #Msg = #Data + "がありません"
  3904.         case 10
  3905.             #Msg = "コメント先発言がありません"
  3906.         case 11
  3907.             #Msg = "登録個数が最大のため登録出来ません"
  3908.     endswitch
  3909.     timeoutmessage #Msg, @@sDisp
  3910.     appendfile @ErrLog
  3911.     if (no) createfile @ErrLog
  3912.     writefile @ErrLog, "[" + @Yr + "年" + @Mon + "月" + @Day + "日]"
  3913.     writefile @ErrLog, #Msg
  3914.     switch #Section
  3915.         case "Mes", "Lib", "SRead"
  3916.             writefile @ErrLog, #ActLine
  3917.             writefile #File2, "--- " + #Msg + " ---"
  3918.             beginloop
  3919.                 readfile #File, #Line
  3920.                 if (no)
  3921.                     closefile @ErrLog
  3922.                     @@ErrorLevel = 0
  3923.                     goto GetJobDetail
  3924.                 endif
  3925.                 #Head = part(#line, 0, 1)
  3926.                 if (#Head == "@") breakloop
  3927.                 writefile @ErrLog, #Line
  3928.             endloop
  3929.             closefile @ErrLog
  3930.             @@ErrorLevel = 0
  3931.             writefile #File2, #Line
  3932.             goto GetJobParameter
  3933.         case "FAct"
  3934.             closefile #File
  3935.             closefile @ErrLog
  3936.             @@ErrorLevel = 0
  3937.             return
  3938.         case default
  3939.             closefile @ErrLog
  3940.             @@ErrorLevel = 0
  3941.             return
  3942.     endswitch
  3943.  
  3944. ErrorHangup:
  3945.     timeoutmessage #Msg, 5
  3946.     hangup
  3947.     exit
  3948.