home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 March
/
VPR9603A.ISO
/
fwindows
/
nah126
/
nifauto.scr
< prev
next >
Wrap
Text File
|
1995-10-28
|
95KB
|
3,948 lines
;/////////////////////////////////////////////////
;/// NIFAUTO FOR HIDETERM
;/// VERSION:1.26
;/// DATE:OCTOBER 29, 1995
;/// COPYRIGHT (C) 1992 - 1995
;/// YOSHIKI OSAKO (NIFTYSERVE NCC00744)
;/////////////////////////////////////////////////
;///// INITIAL SETTING /////
SetAppIni:
endscroll
gethostname #HostName
getini "HIDETERM.INI", #HostName, "ScriptFile", #Script
@App = drop(toupper(#Script), ".SCR")
if (@App == "")
#Msg = "ホスト名の取得に失敗しました。"
goto ErrorHangup
endif
@AppIni = @App + ".INI"
getini @AppIni, @App, "sDisp", @@sDisp
getini @AppIni, @App, "sProp", @@sProp
CheckVersion:
getversion ##Ver
if (##Ver < 219)
#Msg = "秀Term Version 2.19以上で使用して下さい。"
goto ErrorHangup
endif
getini @AppIni, @App, "Version", ##AppVer
if (##AppVer < 126)
#Msg = @AppIni + "のアップデートをして下さい。"
goto ErrorHangup
endif
if ((not %%NAH01) or (not %%NAH02))
#Msg = "Nifautoから起動させてください。"
goto ErrorHangup
endif
@@AppSet = length(search(%%NAH01, %%NAH02))
CheckIniFile:
getwindir #WinDir
if (not existfile(#WinDir + "\" + @AppIni))
#Msg = @AppIni + "がありません。^M"
#Msg = #Msg + "NIFAUTO.EXEを使用してINI FILEを作成して下さい。"
goto ErrorHangup
endif
SetTitle:
if (@@AppSet == 0) title @App + " (未登録)"
else title @App
CheckNode:
##i = 1
while(##i < 6)
getini @AppIni, "External", "Host" + ##i, #CurHost
if (#CurHost == #HostName)
getini @AppIni, "External", "Node" + ##i, ##Node
breakloop
endif
##i = ##i + 1
endwhile
CheckPath:
getini "HIDETERM.INI", "HideTerm", "UploadPath", @UpPath
getini "HIDETERM.INI", "HideTerm", "DownloadPath", @DownPath
getini "HIDETERM.INI", "HideTerm", "LogPath", @LogPath
if (part(@UpPath, length(@UpPath) - 1, 1) != "\")
@UpPath = @UpPath + "\"
endif
if (part(@DownPath, length(@DownPath) - 1, 1) != "\")
@DownPath = @DownPath + "\"
endif
if (part(@LogPath, length(@LogPath) - 1, 1) != "\")
@LogPath = @LogPath + "\"
endif
CheckId:
call SetId
getini @AppIni, "Personal", "ExtraId", #Hello
if (#Hello != "") @@Hello = 1
else @@Hello = 0
CheckActFileExist:
call SetActFile 0
##MesFlag = part(#return, 0, 1)
##LibFlag = part(#return, 1, 1)
##SelFlag = part(#return, 2, 1)
##FreFlag = part(#return, 3, 1)
##SwRgFlag = part(#return, 4, 1)
@ErrLog = @LogPath + "NIFERR.LOG"
getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
CheckSign:
getini @AppIni, @App, "sPara", @sPara
getini @AppIni, @App, "sRem", @sRem
if (@sPara == "") @sPara = "/"
if (@sRem == "") @sRem = ";"
CheckDate:
getini @AppIni, @App, "TimeDiff", ##TDiff
if (##TDiff != 0)
call DateAdjust ##TDiff
#Date = part(#return, 0, 6)
#Time = part(#return, 6, 4)
else
getdate #Date
gettime #Time
endif
getweek #Week
@Yr = part(#Date, 0, 2)
@Mon = part(#Date, 2, 2)
@Day = part(#Date, 4, 2)
@LogDate = @Mon + @Day
##Now = value(part(#Time, 0, 4))
datetolinear #Date, ##TD
getini @AppIni, @App, "LogTime", ##STime
CheckJobLevel:
getini @AppIni, "Level", "Read", #ReadLevel
getini @AppIni, "Level", "List", #ListLevel
getini @AppIni, "Level", "News", #NewsLevel
getini @AppIni, "Level", "Bill", ##BillDate
getini @AppIni, "Level", "Clip", #ClipLevel
getini @AppIni, "Level", "ClipLimit", ##ClipLimit
getini @AppIni, @App, "TermChange", ##TermFlag
getini @AppIni, @App, "FoptChange", ##FoptFlag
getini @AppIni, @App, "ChangeRPattern", ##CRPattern
getini @AppIni, @App, "ChangeLPattern", ##CLPattern
getini @AppIni, @App, "ChangeNPattern", ##CNPattern
getini @AppIni, @App, "ChangeBPattern", ##CBPattern
getini @AppIni, @App, "ChangeCPattern", ##CCPattern
if (##BillDate == value(@Day)) @@BillLevel = 1
else @@BillLevel = 0
##p = length(drop("日月火水木金土", #Week)) / 2
@@ReadLevel = value(part(#ReadLevel, ##p, 1))
@@ListLevel = value(part(#ListLevel, ##p, 1))
@@ClipLevel = value(part(#ClipLevel, ##p, 1))
@@NewsLevel = value(part(#NewsLevel, ##p, 1))
if (@@ClipLevel == 1 and ##ClipLimit == 0) ##CCPattern = 1
SetAdjustTime:
getini @AppIni, @App, "AdjustTime", ##AdjTime
getini @AppIni, "External", "HtDir", #HtDir
if (part(#HtDir, length(#HtDir) - 1, 1) != "\") #HtDir = #HtDir + "\"
if (##AdjTime == 1)
if (existfile(#HtDir + "SETCLKD.EXE"))
@AdjustClock = #HtDir + "SETCLKD /DS:10 "
else
#Msg = "SETCLKD.EXEがありません。^M"
#Msg = #Msg + "PC内部時刻の補正は行いません。"
timeoutmessage #Msg, @@sDisp
##AdjTime = 0
putini @AppIni, @App, "AdjustTime", ##AdjTime
endif
endif
SetAutoHang:
getini @AppIni, @App, "AutoHang", @@HangMin
setautohangup @@HangMin
CheckTermSetting:
getini @AppIni, @App, "Terminal", #TermSet
@@tPage = value(part(#TermSet, 1, 1))
CheckDlmOn:
getini @AppIni, @App, "DlmOn", ##DlmOn
if(##DlmOn == 1) @@DlmOn = 0
else @@DlmOn = 1
CheckLoginPattern:
getini @AppIni, @App, "LoginPattern", @@LoginPattern
;///// LOGIN PROCEDURE /////
ConnectNif:
Afterhangup Atoshimatsu
@@ErrorLevel = 0
switch ##Node
case 0 ;Road 1
#LoginCmd = ".00+"
send #LoginCmd
case 1 ;Road 2
#LoginCmd = "C NIF^M"
send " P^M"
case 3 ;CompuServe
#LoginCmd = "CIS^M"
send "^M"
case 4 ;CompuPass
#LoginCmd = "NIFTY^M"
send "^M"
case 5 ;Internet
send "TELNET R2.NIFTYSERVE.OR.JP^M"
call DefaultLogStart
case default
#LoginCmd = "C NIF^M"
endswitch
Login:
timeout 30
##i = 0
##j = 0
loopswitch
case "01+", "*", "Host Name:"
if (##i < 5)
send #LoginCmd
##i = ##i + 1
else
@@ErrorLevel = 1
goto ErrorCheck
endif
case "User ID:"
millisleep 1
send %CISID +"^M"
case "Password:"
millisleep 1
send %%CISPassword + "^M"
case postmilliidle(@@sProp) "Enter choice !", "enter choice !"
millisleep 1
send "GO NIF-4^M"
case "<CR> for more !", "^G^G^G^G"
send "^M"
case "COM"
call DefaultLogStart
case "tion-ID --->"
millisleep 1
; if (#LoginCmd == "NIFTY^M" or #LoginCmd == "CIS^M")
if (##Node > 2)
call DefaultLogStart
port data=8 parity=none
endif
send "SVC^M"
case "User-ID --->"
millisleep 1
send @NifId + "^M"
case "User-ID Error"
#Msg = @NifID + "はエラーです。^M"
#Msg = #Msg + "正しいユーザIDを入力して下さい。"
input #Msg, @NifID
if (cancel)
hangup
exit
endif
if (@@LoginId == 0)
putini @AppIni, "Personal", "DefaultId", @NifId
else
putini @AppIni, "Personal", "ExtraId", @NifId
endif
send @NifId + "^M"
case "Password --->"
millisleep 1
send @NifPass + "^M"
case "Password ERROR"
#Msg = @NifPass + "はエラーです。^M"
#Msg = #Msg + "正しいパスワードを入力して下さい。"
secretinput #Msg, @NifPass
if (cancel)
hangup
exit
endif
if (@@LoginId == 0)
putini @AppIni, "Personal", "DefaultPassword", @NifPass
%%NifPassword = @NifPass
else
putini @AppIni, "Personal", "ExtraPassword", @NifPass
%%NifPassword2 = @NifPass
endif
send @NifPass + "^M"
case "ようこそNIF"
breakloop
case "NO CARRIER"
hangup
exit
case "ERROR INC", "本日は定期メンテナンスのためサービス開始を", \
"Service is currently unavailable"
@@ErrorLevel = 1
goto ErrorCheck
case timeout
@@ErrorLevel = 1
goto ErrorCheck
endloop
CheckFirstLogin:
timeout 0
wait "前回LOG OUT "
getline #Last
#LD = part(#Last, 0, 2) + part(#Last, 3, 2) + part(#Last, 6, 2)
##LT = value(part(#Last, 12, 2) + part(#Last, 15, 2))
datetolinear #LD, ##LD
##D = ##TD - ##LD
##S = ##Now - ##STime
##T = ##LT - ##STime
if (##D == 0)
if ((##S < 0 and ##T <= 0) or (##S >= 0 and ##T > 0))
##FirstLogin = 0
else
##FirstLogin = 1
endif
elseif (##D == 1)
if (##S < 0 and ##T > 0)
#FirstLogin = 0
else
##FirstLogin = 1
endif
else
##FirstLogin = 1
endif
if (##FirstLogin == 0)
@@ReadLevel = ##CRPattern
@@ListLevel = ##CLPattern
@@NewsLevel = ##CNPattern
@@BillLevel = ##CBPattern
@@ClipLevel = ##CCPattern
endif
CheckMailReceive:
##MailFlag = 0
##ClipFlag = 0
loopswitch
case "届いています(未読"
##MailFlag = 1
case "」に記事が"
##ClipFlag = 1
case "今週のお知らせ"
loopswitch
case "番号またはコマンド (改行で次頁)^M^J>", \
"番号またはコマンド (改行でトップメニュー)^M^J>"
send "^M"
case postmilliidle(100) "^M^J>"
goto MainPreApp
endloop
case postmilliidle(100) "^M^J>"
breakloop
endloop
;///// MAIN ROUTINE /////
MainPassChangeWarning:
if (@Day == "01" and ##FirstLogin == 1)
#Msg = "月が変わりました。パスワード盗用防止のために^M"
#Msg = #Msg + "パスワードを変更しましょう。但し、変更はユー^M"
#Msg = #Msg + "ザーの責任において、手動で変更してください。"
timeoutmessage #Msg, @@sDisp
endif
MainPreApp:
call MainMenuKey
call SubPreApp
MainChangeSetting:
if (##TermFlag == 1)
call SubTerminalSet
putini @AppIni, @App, "TermChange", 0
endif
if (##FoptFlag == 1)
call SubForumOption
putini @AppIni, @App, "FoptChange", 0
endif
MainMailRead:
if (##MailFlag == 1) call SubMailRead
MainCheckSwReg:
if (##SwRgFlag == 1)
#Msg = "送金代行確認をしますか?"
timeoutquestion #Msg, @@sDisp
if (yes)
call CheckSwReg
endif
endif
MainMesUpFirst:
if (##MesUpFirst == 1 and ##MesFlag == 1) call IdentifyOperation "Mes"
MainChoice:
switch @@LoginPattern
case 1
goto MainJob
case 2
goto MainAct
case 3
goto WaitEnd
case default
#Msg1 = "本日、再度のアクセスです。^M"
#Msg2 = "パターン"+ tozenkaku(@@ReadLevel) + "で巡回しますか?"
switch ##FirstLogin
case 0
#Msg = #Msg1 + #Msg2
case default
#Msg = #Msg2
endswitch
endswitch
timeoutquestion #Msg, @@sDisp
if (yes) goto MainRead
else goto MainJob
MainRead:
call IdentifyOperation "Read"
MainJob:
if (@@ListLevel == 1) call IdentifyOperation "List"
; if (##ClipFlag == 1 and @@ClipLevel == 1) call SubClipRead
if (@@ClipLevel == 1) call SubClipRead
if (@@NewsLevel == 1) call SubNewsRead
if (@@BillLevel == 1) call SubBill
MainAct:
if (##SelFlag == 1) call IdentifyOperation "SRead"
if (##MesUpFirst == 0 and ##MesFlag == 1) call IdentifyOperation "Mes"
if (##LibFlag == 1) call IdentifyOperation "Lib"
MainFree:
if (##FreFlag == 1) call SubFreeAction
MainEnd:
call AutoEnd
goto WaitEnd
WaitEnd:
timeout 0
setautohangup 0
if (##AdjTime == 1)
wait "^M^J LOG OUT --- "
getline #AdjustTime
#AdjustTime = drop(#AdjustTime, "M^J")
run @AdjustClock + #AdjustTime
else
wait "^M^J ご利用誠にありがとうございました。"
endif
goto Logout
;///// LOGOUT PROCEDURE /////
Logout:
if (#LoginCmd == "NIFTY^M" or #LoginCmd = "CIS^M")
port data=7 parity=even
send "^M"
endif
loopswitch
case postidle(1) "!"
millisleep 1
send "BYE^M"
case "HOST NAME?", "Host Name:"
millisleep 1
send "OFF^M"
case "NO CARRIER", "OK", "01+"
hangup
breakloop
case "^G^G^G^G", "^G^G^G^G^G"
send "^M"
endloop
exit
Atoshimatsu:
#App = "NIFAUTO"
#AppIni = #App + ".INI"
getini #AppIni, #App, "LoginId", ##LoginId
getini #AppIni, #App, "LoginPattern", ##LoginPattern
getini #AppIni, #App, "CloseHt", ##CloseFlag
getini #AppIni, #App, "sDisp", ##sDisp
getini #AppIni, "External", "PostApp", #PostApp
getini #AppIni, #App, "StartPostApp", ##StartApp
getini #AppIni, #App, "ChangeRPattern", ##ReadLevel
getini #AppIni, #App, "ChangeLPattern", ##ListLevel
getini #AppIni, #App, "ChangeNPattern", ##NewsLevel
getini #AppIni, #App, "ChangeBPattern", ##BillLevel
if (##LoginId != 0) putini #AppIni, #App, "LoginId", 0
if (##LoginPattern != 0) putini #AppIni, #App, "LoginPattern", 0
if (##ReadLevel != 0) putini #AppIni, #App, "ChangeRPattern", 0
if (##ListLevel != 0) putini #AppIni, #App, "ChangeLPattern", 0
if (##NewsLevel != 0) putini #AppIni, #App, "ChangeNPattern", 0
if (##BillLevel != 0) putini #AppIni, #App, "ChangeBPattern", 0
#Hour = part(#1, 0, 2)
#Minute = part(#1, 2, 2)
#Second = part(#1, 4, 2)
#Msg = "通話時間は"
if (#Hour != "00") #Msg = #Msg + #Hour + "時間"
#Msg = #Msg + #Minute + "分" + #Second + "秒でした。"
timeoutmessage #Msg, ##sDisp
if (##StartApp == 1 and #PostApp != "") runsync #PostApp
if (##CloseFlag == 1) closehideterm
return
AutoEnd:
call MainMenuKey
if (@@Hello == 1)
call SetActFile 1
#FileCheck = #return
if (value(#FileCheck) > 0)
call SetHello
if (value(#return) == 1)
call ChangeLoginIdFlag
call SetId
##MesFlag = part(#FileCheck, 0, 1)
##LibFlag = part(#FileCheck, 1, 1)
##SelFlag = part(#FileCheck, 2, 1)
##FreFlag = part(#FileCheck, 3, 1)
##SwRgFlag = part(#FileCheck, 4, 1)
@@NewsLevel = 0
getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
send "HELLO^M"
goto Login
endif
endif
endif
#Msg = "オートパイロット終了。^Mログアウトしますか?"
timeoutquestion #Msg, @@sDisp
if (yes)
send "BYE^M"
return
endif
@PrevJob = ""
@PrevName = ""
if (@@Hello == 1)
call AutoHello
endif
return
SetHello:
##Hello = 0
@PrevJob = ""
@PrevName = ""
getini @AppIni, "Personal", "ExtraId", #Hello
if (#Hello == "") return ##Hello
#Msg = "別IDでログインしますか?"
timeoutquestion #Msg, @@sDisp
if (yes) ##Hello = 1
else ##Hello = 0
return ##Hello
SetId:
getini @AppIni, @App, "LoginId", @@LoginId
getini @AppIni, "Personal", "Name", @NameJ
switch @@LoginId
case 0
getini @AppIni, "Personal", "DefaultId", @NifId
getini @AppIni, "Personal", "DefaultPassword", @NifPass
getini @AppIni, "Personal", "DefaultHandle", @NifHandle
if (@NifId == "") @NifId = %NIFID
if (@NifPass == "") @NifPass = %%NIFPASSWORD
case 1
getini @AppIni, "Personal", "ExtraId", @NifId
getini @AppIni, "Personal", "ExtraPassword", @NifPass
getini @AppIni, "Personal", "ExtraHandle", @NifHandle
if (@NifId == "") @NifId = %NIFID2
if (@NifPass == "") @NifPass = %%NIFPASSWORD2
endswitch
return
ChangeLoginIdFlag:
if (@@LoginId == 0) @@LoginId = 1
else @@LoginId = 0
putini @AppIni, @App, "LoginId", @@LoginId
return
SetActFile:
switch @@LoginId
case 1
if (#1 == 0) #FName = @UpPath + "NIFEXTR"
else #FName = @UpPath + @App
getini @AppIni, "SwReg", "SwNum11", #SwNum
case default
if (#1 == 0) #FName = @UpPath + @App
else #FName = @UpPath + "NIFEXTR"
getini @AppIni, "SwReg", "SwNum01", #SwNum
endswitch
@MesFile = #FName + ".MES"
@LibFile = #FName + ".LIB"
@SelFile = #FName + ".SEL"
@FreFile = #FName + ".FRE"
#FileExist = ""
if (existfile(@MesFile)) #FileExist = #FileExist + "1"
else #FileExist = #FileExist + "0"
if (existfile(@LibFile)) #FileExist = #FileExist + "1"
else #FileExist = #FileExist + "0"
if (existfile(@SelFile)) #FileExist = #FileExist + "1"
else #FileExist = #FileExist + "0"
if (existfile(@FreFile)) #FileExist = #FileExist + "1"
else #FileExist = #FileExist + "0"
if (#SwNum != "") #FileExist = #FileExist + "1"
else #FileExist = #FileExist + "0"
return #FileExist
DateAdjust:
##TDiff = value(#1) * (-1)
if (##TDiff == 0) return ""
getdate #Date
gettime #Time
##Yr = Value(part(#Date, 0, 2)) + 1900
##Mon = Value(part(#Date, 2, 2))
##Day = Value(part(#Date, 4, 2))
##Hr = Value(part(#Time, 0, 2)) + ##TDiff
#Min = part(#Time, 2, 2)
if (##Hr > 23)
##Hr = ##Hr - 24
##Day = ##Day + 1
elseif (##Hr < 0)
##Hr = 24 + ##Hr
##Day = ##Day - 1
endif
switch ##Mon
case 1
if (##Day < 1)
##Day = 31
##Mon = 12
##Yr = ##Yr - 1
elseif (##Day > 31)
##Day = 1
##Mon = 2
endif
case 2
if (##Day < 1)
##Day = 31
##Mon = 1
elseif (##Day > 28)
if (##Yr % 4 == 0)
if (##Yr % 400 == 0)
##Day = 1
##Mon = 3
endif
else
##Day = 1
##Mon = 3
endif
endif
case 3
if (##Day < 1)
if (##Yr % 4 == 0)
if (##Yr % 400 == 0)
##Day = 28
else
##Day = 29
endif
else
##Day = 28
endif
##Mon = 2
elseif (##Day > 31)
##Day = 1
##Mon = ##Mon + 1
endif
case 5, 7, 8, 10
if (##Day < 1)
##Day = 30
##Mon = ##Mon - 1
elseif (##Day > 31)
##Day = 1
##Mon = ##Mon + 1
endif
case 12
if (##Day < 1)
##Day = 31
##Mon = ##Mon - 1
elseif (##Day > 31)
##Day = 1
##Mon = 1
##Yr = ##Yr + 1
endif
case default
if (##Day < 1)
##Day = 30
##Mon = ##Mon - 1
elseif (##Day > 31)
##Day = 1
##Mon = ##Mon + 1
endif
endswitch
#Yr = ##Yr -1900
if (##Mon < 10) #Mon = "0" + ##Mon
else #Mon = ##Mon
if (##Day < 10) #Day = "0" + ##Day
else #Day = ##Day
if (##Hr < 10) #Hr = "0" + ##Hr
else #Hr = ##Hr
#Now = #Yr + #Mon + #Day + #Hr + #Min
return #Now
;///// SUB ROUTINE MODULES /////
;///// PROMPT SUBROUTINE /////
Prompt:
@@ErrorLevel = 0
loopswitch
case "^J◆現在このフォーラムはメンテナンス作業中につき", \
"^J-保守作業の為しばらくの間御利用頂けません-", \
"^J現在、サービスは大変混雑しています。後ほどの", \
"^J◆この機能は本フォーラムではご利用できません◆", \
"^J◆コマンドを入力してください◆";, \
; "^J◆番号又はコマンドを入力して下さい◆", \
; "^J◆番号の選択に誤りがあります◆"
@@ErrorLevel = 2
case "^J◆該当する会議室がありません◆"
@@ErrorLevel = 3
case "^J◆該当するライブラリがありません◆"
@@ErrorLevel = 4
case "^J◆次頁はありません◆"
;
case "^J◆現在未読の発言はありません◆
;
case "^J1:フォーラム概要 2:一時利用 3:入会手続き"
timeoutquestion "入会処理をしますか?", @@sDisp
if (yes) call ForumJoin
case "^J同意しますか (1: 同意する 2: しない)^M^J:"
timeoutquestion "パティオの入会処理をしますか?", @@sDisp
if (yes) call PatioJoin
; case "のユーザーからのメッセージです-^M^J"
; readbuffer 1, #GetSend
; call SendReact #GetSend
case "^J続き (改行", "^J続き(改行", \
"^J番号 (改行", "^J番号(改行"
wait postmilliidle(@@sProp) "^J>"
send "^M"
case postmilliidle(@@sProp) "^Jmore>", \
postmilliidle(@@sProp) "^Jnext>"
send "^M"
case postmilliidle(@@sProp) "^J>", \
postmilliidle(@@sProp) "^JCCS(N)>", \
postmilliidle(@@sProp) "^JCCS(C)>", \
postmilliidle(@@sProp) "^JCCS(R)>", \
postmilliidle(@@sProp) "^JCCS(P)>", \
postmilliidle(@@sProp) "^JPATIO(N)>", \
postmilliidle(@@sProp) "^JPATIO(P)>", \
postmilliidle(@@sProp) "^JMAIL>", \
postmilliidle(@@sProp) "^JBBS>", \
postmilliidle(@@sProp) "^JHP>", \
postmilliidle(@@sProp) "^JLIB>", \
postmilliidle(@@sProp) "^JFORUM>", \
postmilliidle(@@sProp) "^JFILE>", \
postmilliidle(@@sProp) "^J:", \
postmilliidle(@@sProp) "^J:"
breakloop
endloop
return
;///// LOG SUBROUTINE /////
DefaultLogStart:
getini @AppIni, @App, "DefaultLog", ##DefaultLog
if (##DefaultLog == 1) #DefaultLog = "NIFTY.LOG"
else #DefaultLog = @LogPath + "NIF" + @LogDate + ".LOG"
call LogStart #DefaultLog
return
LogStart:
log #1
return
LogAppend:
appendfile #1
writefile #1, "^M"
closefile #1
return
GetLogFile:
#Func = #1
#Log = #2
#Room = #3
getini @AppIni, @App, "MesLog", ##ReadLog
if (#Func == "LL" and ##ReadLog == 2) ##ReadLog = 0
switch ##ReadLog
case 2
#Log = @LogPath + #Log
case 1
#Log = @LogPath + part(drop(#Log, "."), 0, 8) + "."
switch #Func
case "HP", "PT"
#Log = #Log + #Func
case "LL"
#Log = #Log + "LST"
case default
if (value(#Room) < 10) #Log = #Log + "00" + #Room
else #Log = #Log + "0" + #Room
endswitch
case default
#Log = @LogPath + part(drop(#Log, "."), 0, 6)
switch #Func
case "HP", "PT", "LL"
#Log = #Log + #Func + ".LOG"
case default
if (value(#Room) < 10) #Log = #Log + "0" + #Room + ".LOG"
else #Log = #Log + #Room + ".LOG"
endswitch
endswitch
return #Log
GetJobLogFile:
#JobName = #1
#LogHead = part(#JobName, 0, 1) + part(#JobName,3, 1)
getini @AppIni, @App, "DateLog", ##DateLog
switch ##DateLog
case 1
#Log = @LogPath + "NF"+ #LogHead + @LogDate + ".LOG"
case default
#Log = @LogPath + "NIF" + #JobName + ".LOG"
endswitch
return #Log
;///// MOVE SUBROUTINE /////
RegisteredMove:
if (#2 == "") addmenu "移動先は?"
else addmenu "巡回先は?"
addmenu 0
addmenu "キー変更"
##i = 1
##j = 2
beginloop
getini @AppIni, #1, ##i, #Name[##i]
if (#Name[##i] == "") breakloop
getini @AppIni, #Name[##i], "Comment", #Rem
if (#Rem != "") #GetName = #Name[##i] + @sRem + #Rem
else #GetName = #Name[##i]
if (#2 == "")
if (search(#Name[##i], "-") == "")
addmenu #GetName
else
if (#1 == "HP" or #1 == "Patio")
addmenu #GetName
else
#GetName = ""
endif
endif
else
getini @AppIni, #Name[##i], "ReadId", ##ReadId
if (@@LoginId == ##ReadId)
addmenu #GetName
else
#GetName = ""
endif
endif
if (#GetName != "")
#Name2[##j] = drop(#GetName, @sRem)
##j = ##j + 1
endif
##i = ##i + 1
if (@@AppSet == 0 and ##i > 3) breakloop
endloop
showmenu
if (result <= 0) return ""
if (result == 1)
switch #1
case "Forum", "PriForum"
call ForumKey
case "HP"
call HpKey
case "Patio"
call PatioKey
endswitch
return ""
endif
#Register = #Name2[result]
if (#2 != "") return #Register
getini @AppIni, #Register, "Function", #Func
getini @AppIni, #Register, "Password", #Pass
call Move #Func, drop(#Register, "-"), #Pass
if (#Func == "FM" or "PF") call ForumKey
if (#Func == "HP") call HpKey
if (#Func == "PT") call PatioKey
return
Move:
#Func = #1
#Name = #2
#Password = #3
if (#Name == "PER")
#Func = "NO"
#Password = "NO"
endif
switch #Func
case "FM"
send "GO " + #Name + "^M"
call Prompt
call ForumKey
case "HP"
send "GO HP^M"
call Prompt
send "1^M"
call HpPtEnter #Name, #Password
call HpKey
case "PT"
send "GO PATIO^M"
call Prompt
send "2^M"
call HpPtEnter #Name, #Password
call PatioKey
case "PF"
send "GO " + #Name + "^M"
call Prompt
send #Password + "^M"
call Prompt
call ForumKey
case default
send "GO " + #Name + "^M"
call Prompt
call MainMenuKey
endswitch
return
HpPtEnter:
loopswitch
case "ID (改行のみ:自分の"
call Prompt
if (#1 == @NifId or #1 == "")
send "^M"
breakloop
else
send #1 + "^M"
endif
case "パスワード"
call Prompt
send #2 + "^M"
breakloop
case " (1:設定する 2:しない)"
call Prompt
send "2^M"
@@ErrorLevel = 2
breakloop
case "^J◆該当する利用者のHome Partyはありません◆", \
"^J◆該当するパティオはありません◆", \
"^J-保守作業の為しばらくの間御利用頂けません-", \
"^J現在、サービスは大変混雑しています。後ほどの"
@@ErrorLevel = 2
breakloop
endloop
call Prompt
return
;///// KEY ASSIGN SUBROUTINE /////
MainMenuKey:
keyassign f1, "READ", script, AutoRead
keyassign f2, "LIST", script, AutoList
keyassign f3, "SREAD", script, AutoSre
keyassign f4, "MES", script, AutoMes
keyassign f5, "LIB", script, AutoLib
keyassign f6, "FREE", script, AutoFreeAct
keyassign f7, "CLIP", script, AutoClip
keyassign f8, "NEWS", script, AutoNews
keyassign f9, "BILL", script, AutoBill
keyassign f10, "MAIL", script, SubMailRead
keyassign b1, "FOPT", script, AutoFOption
keyassign b2, "TERM", script, AutoTerminal
keyassign b3, "SWS", script, SwSokin
keyassign b4, "NO MRE", script, AutoNoMread
keyassign b5, "CSC", script, CSCStart
keyassign b6, "BREAK", script, Break
keyassign b7, "ENTER", string, "^M"
keyassign b8, "MEN ON", script, MenuOn
keyassign b9, "PAG OFF", script, PageOff
keyassign b10, "PAU OFF", script, PauseOff
keyassign c1, "FORUM", script, ForumMove
keyassign c2, "HP", script, HPMove
keyassign c3, "PATIO", script, PatioMove
keyassign c4, "PFORUM", script, PriForumMove
keyassign c5, "MAIL", script, MailKey
keyassign c6, "HELLO", script, AutoHello
keyassign c7, "SCR1", script, ExeExtScr1
keyassign c8, "SCR2", script, ExeExtScr2
keyassign c9, "SCR3", script, ExeExtScr3
keyassign c10, "BYE", script, AutoLogout
keyassign d1, "BBS", string, "BBS^M"
keyassign d2, "CB", string, "CB^M"
keyassign d3, "WEATH", string, "GO WEATHER^M"
keyassign d4, "BUSIN", string, "GO BUSINESS^M"
keyassign d5, "LIFE", string, "GO LIFE^M"
keyassign d6, "SHOP", string, "GO SHOPPING^M"
keyassign d7, "INFOC", string, "GO INFOCUE^M"
keyassign d8, "GTWAY", string, "GO GATEWAY^M"
keyassign d9, "SWREG", script, AutoCheckSwReg
keyassign d10, "", string, ""
return
MailKey:
keyassign f1, "GO MAL", string, "MAIL^M"
keyassign f2, "READ", script, AutoMailRead
keyassign f3, "DEL", script, MailDelete
keyassign f4, "CAN", script, MailCancel
keyassign f5, "SDL", string, "SDL^M"
keyassign f6, "RCV", string, "RVL^M"
keyassign f7, "REP", string, "REP^M"
keyassign f8, "FORW", string, "FOR^M"
keyassign f9, "EDIT", string, "EDIT^M"
keyassign f10, "MAIN", script, MainMenuKey
keyassign b1, "ADD", string, "ADD^M"
keyassign b2, "ADDRSS", script, AddressBook
keyassign b3, "PER", script, PerFileKey
keyassign b4, "LOAD", string, "LOA^M"
keyassign b5, "STORE", string, "STO^M"
return
PerFileKey:
keyassign f1, "GO PER", string, "GO PER^M"
keyassign f2, "READ", string, "REA^M"
keyassign f3, "UPD", string, "UPD^M"
keyassign f4, "DEL", string, "DEL^M"
keyassign f5, "COPY", string, "COP^M"
keyassign f6, "UPL", string, "UPL^M"
keyassign f7, "DOW", string, "DOW^M"
keyassign f8, "PRO", string, "PRO^M"
keyassign f9, "", string, ""
keyassign f10, "MAIN", script, MainMenuKey
keyassign b1, "", string, ""
keyassign b2, "", string, ""
keyassign b3, "", string, ""
keyassign b4, "", string, ""
keyassign b5, "", string, ""
return
ForumKey:
keyassign f1, "ANN", string, "ANN^M"
keyassign f2, "BUL", string, "BUL^M"
keyassign f3, "ROOM", script, MesRoomMove
keyassign f4, "LIB", script, LibMove
keyassign f5, "MEM", string, "MEM^M"
keyassign f6, "RTC", string, "RTC^M"
keyassign f7, "SYSOP", script, ForumSysopMail
keyassign f8, "OPT", script, ForumOptChange
keyassign f9, "CSC", script, CSCStartF
keyassign f10, "MAIN", script, MainMenuKey
keyassign b1, "CHAT", script, ChatKey
keyassign b2, "JOIN", script, ForumJoin
keyassign b3, "", string, ""
keyassign b4, "", string, ""
keyassign b5, "", string, ""
return
MesRoomKey:
keyassign f1, "RTN", string, "RTN^M"
keyassign f2, "RMN", string, "RMN^M"
keyassign f3, "RC MAX", string, "RC MAX^M"
keyassign f4, "RC D", string, "RC D^M"
keyassign f5, "NO MRE", script, NoMRead
keyassign f6, "MES DEL", script, MesDelete
keyassign f7, "RX", string, "RX^M"
keyassign f8, "RESP", string, "RESP^M"
keyassign f9, "GO LIB", script, LibMove
keyassign f10, "TOP", script, ForumTopMove
keyassign b1, "ID", script, MyId
keyassign b2, "NAME", script, MyName
keyassign b3, "HANDLE", script, MyHandle
keyassign b4, "SMAIL", string, "SMAIL^M"
keyassign b5, "", string, ""
return
LibKey:
keyassign f1, "SEARCH", script, LibSearch
keyassign f2, "BROWSE", script, LibBrowse
keyassign f3, "DOWN", script, LibDown
keyassign f4, "FNAME", script, DownFileName
keyassign f5, "FLIST", script, ListFileName
keyassign f6, "LIST", script, GetList
keyassign f7, "LX", string, "LX^M"
keyassign f8, "DIR", string, "DIR^M"
keyassign f9, "GO MES", script, MesRoomMove
keyassign f10, "TOP", script, ForumTopMove
keyassign b1, "SEA", string, "SEA"
keyassign b2, "KEY", string, "KEY^M"
keyassign b3, "BRO", string, "BRO^M"
keyassign b4, "SCAN", string, "SCA^M"
keyassign b5, "", string, ""
return
HpKey:
keyassign f1, "GUEST", string, "GUE^M"
keyassign f2, "TITLE", string, "TITLE^M"
keyassign f3, "NEW", string, "REA NEW^M"
keyassign f4, "TODAY", string, "REA TODAY^M"
keyassign f5, "COM", string, "COM^M"
keyassign f6, "DEL", string, "DEL "
keyassign f7, "REV", string, "REA REV^M"
keyassign f8, "MOVE", string, "MOVE^M"
keyassign f9, "SETUP", string, "SETUP^M"
keyassign f10, "MAIN", script, MainMenuKey
keyassign b1, "ID", script, MyId
keyassign b2, "NAME", script, MyName
keyassign b3, "HANDLE", script, MyHandle
keyassign b4, "CANCEL", string, "CAN^M"
keyassign b5, "EXPAND", string, "EXP^M"
return
PatioKey:
keyassign f1, "RTN", string, "RTN^M"
keyassign f2, "RMN", string, "RMN^M"
keyassign f3, "RC MAX", string, "RC MAX^M"
keyassign f4, "RC D", string, "RC D^M"
keyassign F5, "MRE", string, "MRE^M"
keyassign f6, "MES DEL", script, MesDelete
keyassign f7, "RESP", string, "RESP^M"
keyassign f8, "GUEST", string, "GUE^M"
keyassign f9, "OPTION", script, PatioOptChange
keyassign f10, "MAIN", script, MainMenuKey
keyassign b1, "ID", script, MyId
keyassign b2, "NAME", script, MyName
keyassign b3, "HANDLE", script, MyHandle
keyassign b4, "SETUP", string, "SETUP^M"
keyassign b5, "INIT", string, "INIT^M"
return
ChatKey:
keyassign f1, "/PROF", string, "/PR "
keyassign f2, "/USERS", string, "/U^M"
keyassign f3, "HELLO", string, "はろ>"
keyassign f4, "BYE BYE", string, "ではそろそろ失礼します>all"
keyassign f5, "/STATUS", string, "/S^M"
keyassign f6, "/JOB", string, "/J^M"
keyassign f7, "/HELP", string, "/?^M"
keyassign f8, "ECH OFF", script, ChatEchoOff
keyassign f9, "WIN OFF", script, ChatWinOff
keyassign f10, "END", script, ChatEnd
keyassign b1, "ID", script, MyId
keyassign b2, "NAME", script, MyName
keyassign b3, "HANDLE", script, MyHandle
keyassign b4, "/WHO", string, "/W "
keyassign b5, "/PAGE", string, "/P "
return
;///// SUBROUTINES FOR KEY ASSIGN /////
MenuOff:
send "SET MENU OFF^M"
call Prompt
keyassign b8, "MEN ON", script, MenuOn
return
MenuOn:
send "SET MENU ON^M"
call Prompt
keyassign b8, "MEN OFF", script, MenuOff
return
PageOff:
send "SET PAGE OFF^M"
call Prompt
if (#1 != "") return
keyassign b9, "PAG ON", script, PageOn
return
PageOn:
send "SET PAGE ON^M"
call Prompt
if (#1 != "") return
keyassign b9, "PAG OFF", script, PageOff
return
PauseOff:
send "SET PAUSE OFF^M"
call Prompt
if (#1 != "") return
keyassign b10, "PAU ON", script, PauseOn
return
PauseOn:
send "SET PAUSE ON^M"
call Prompt
keyassign b10, "PAU OFF", script, PauseOff
return
DlmOn:
if (@@DlmOn == 1) return
send "SET DLM ON^M"
call Prompt
; @@DlmOn = 1
return
ChatWinOff:
chat off
keyassign f9, "WIN ON", script, ChatWinOn
return
ChatWinOn:
chat on
keyassign f9, "WIN OFF", script, ChatWinOff
return
ChatEchoOff:
send "/EC OFF^M"
keyassign f8, "ECH ON", script, ChatEchoOn
return
ChatEchoOn:
send "/EC ON^M"
keyassign f8, "ECH OFF", script, ChatEchoOff
return
MyHandle:
send @NifHandle + "^M"
return
MyId:
send @NifId + "^M"
return
MyName:
send @NameJ + "^M"
return
ExeExtScr1:
getini @AppIni, "External", "ExtScript1", #ExtScr
call ExeExtScript #ExtScr
return
ExeExtScr2:
getini @AppIni, "External", "ExtScript2", #ExtScr
call ExeExtScript #ExtScr
return
ExeExtScr3:
getini @AppIni, "External", "ExtScript3", #ExtScr
call ExeExtScript #ExtScr
return
ExeExtScript:
#ExtScr = #1
checklabel #ExtScr
if (no) return
callvarlabel #ExtScr
return
Break:
sendbreak
return
ChatStart:
chat on
call ChatKey
return
CSCStart:
keyassign reset
call "CSC.SCR"
call MainMenuKey
call DefaultLogStart
return
CSCStartF:
keyassign reset
call "CSC.SCR"
call ForumKey
call DefaultLogStart
return
ChatEnd:
send "/E^M"
chat off
call ForumKey
return
ForumMove:
call RegisteredMove "Forum", ""
return
HPMove:
call RegisteredMove "HP", ""
return
PatioMove:
call RegisteredMove "Patio", ""
return
PriForumMove:
call RegisteredMove "PriForum", ""
return
AutoLogout:
send "BYE^M"
return
AutoHello:
call SetHello
if (value(#return) != 1) return
call SetActFile 1
##MesFlag = part(#return, 0, 1)
##LibFlag = part(#return, 1, 1)
##SelFlag = part(#return, 2, 1)
##FreFlag = part(#return, 3, 1)
##SwRgFlag = part(#return, 4, 1)
@@NewsLevel = 0
call ChangeLoginIdFlag
call SetId
@@LoginPattern = 0
getini @AppIni, @App, "MesUpFirst", ##MesUpFirst
send "HELLO^M"
goto Login
return
AutoNews:
setautohangup @@HangMin
call SubNewsRead
goto AutoEnd
AutoBill:
setautohangup @@HangMin
call SubBill
goto AutoEnd
AutoClip:
setautohangup @@HangMin
call SubClipRead
goto AutoEnd
AutoRead:
setautohangup @@HangMin
addmenu "巡回パターンは?"
addmenu 0
addmenu "個別フォーラム"
addmenu "個別ホームパーティー"
addmenu "個別パティオ"
addmenu "個別Pフォーラム"
##i = 0
while(##i < 20)
if (##i < 10)
#Item = "パターン" + tozenkaku(##i) + ":巡回レベル"
#Item = #Item + tozenkaku(##i) + "以下"
else
#Item = "パターン" + ##i + ":巡回レベル"
#Item = #Item + tozenkaku(##i - 10) + "のみ"
endif
addmenu #Item
##i = ##i + 1
endwhile
showmenu
if (result < 1)
return
elseif (result >= 1 and result <= 4)
if (result == 1) call RegisteredMove "Forum", "1"
if (result == 2) call RegisteredMove "HP", "1"
if (result == 3) call RegisteredMove "Patio", "1"
if (result == 4) call RegisteredMove "PriForum", "1"
if (#return == "") return
#Name = #return
getini @AppIni, #Name, "Function", #Func
call DlmOn
call GetDoDetal "Read", #Name, #Func, "", ""
else
@@ReadLevel = result - 5
call IdentifyOperation "Read"
endif
goto AutoEnd
AutoSre:
call SetActFile 0
if (value(part(#return, 2, 1)) == 0 ) return
setautohangup @@HangMin
call IdentifyOperation "SRead"
goto AutoEnd
AutoList:
setautohangup @@HangMin
call IdentifyOperation "List"
goto AutoEnd
AutoMes:
call SetActFile 0
if (value(part(#return, 0, 1)) == 0) return
setautohangup @@HangMin
call IdentifyOperation "Mes"
goto AutoEnd
AutoLib:
call SetActFile 0
if (value(part(#return, 1, 1)) == 0) return
setautohangup @@HangMin
call IdentifyOperation "Lib"
goto AutoEnd
AutoFreeAct:
call SetActFile 0
if (value(part(#return, 3, 1)) == 0) return
setautohangup @@HangMin
call SubFreeAction
goto AutoEnd
AutoTerminal:
setautohangup @@HangMin
call SubTerminalSet
goto AutoEnd
AutoFOption:
setautohangup @@HangMin
call SubForumOption
goto AutoEnd
AutoMailRead:
setautohangup @@HangMin
call SubMailRead
goto AutoEnd
AutoCheckSwReg:
setautohangup @@HangMin
call CheckSwReg
goto AutoEnd
AutoNoMread:
setautohangup @@HangMin
##i = 1
##j = 1
##Count = 1
beginloop
if(##Count > 3) breakloop
if(##Count == 1) getini @AppIni, "Forum", ##i, #Name
if(##Count == 2) getini @AppIni, "Patio", ##i, #Name
if(##Count == 3) getini @AppIni, "PriForum", ##i, #Name
if (#Name != "")
#GoName[##j] = #Name
##i = ##i + 1
##j = ##j + 1
millisleep 1
if (@@AppSet == 0 and ##j > 3)
##i = 1
##Count = ##Count + 1
millisleep 1
endif
else
##i = 1
##Count = ##Count + 1
millisleep 1
endif
endloop
##i = 1
while (##i < ##j + 1)
getini @AppIni, #GoName[##i], "Function", #Func
getini @AppIni, #GoName[##i], "Password", #Pass
call Move #Func, #GoName[##i], #Pass
if (@@ErrorLevel == 2) loopagain
switch #Func
case "PT"
send "1^M"
call Prompt
send "RC MAX^M"
call Prompt
case default
call NoMread
endswitch
##i = ##i + 1
millisleep 1
endwhile
return
;///// FREE ACTION SUBROUTINE /////
SubFreeAction:
#File = @FreFile
#Section = "FAct"
if (not existfile(#File)) return
openfile #File
beginloop
readfile #File, #Line
if (no) breakloop
#Head = part(#Line, 0, 1)
switch #Head
case @sRem
loopagain
case "@"
call ExeSubFreFile, #Line
loopagain
case "$"
call ExeSubFreScript, #Line
loopagain
endswitch
#Line = drop(dropback(#Line, @sRem), "^I")
if (toupper(#Line) == "BYE")
closefile #File
delfile #File
send #Line + "^M"
goto WaitEnd
endif
send #Line + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
endloop
closefile #File
delfile #File
return
ExeSubFreFile:
#ExeFile = part(#1, 1, 256)
if (not existfile(#ExeFile)) return
openfile #ExeFile
beginloop
readfile #ExeFile, #Line
if (no) breakloop
#Head = part(#Line, 0, 1)
switch #Head
case @sRem, "@"
loopagain
case "$"
call ExeSubFreScript, #Line
loopagain
endswitch
#Line = drop(dropback(#Line, @sRem), "^I")
send #Line + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
endloop
closefile #ExeFile
return
ExeSubFreScript:
#ExeScr = part(#1, 1, 256)
checklabel #ExeScr
if (no)
#Msg = "スクリプトが見つかりません。"
timeoutmessage #Msg, @@sDisp
return
endif
callvarlabel #ExeScr
return
;///// APP BEFORE OPERATION SUBROUTINE /////
SubPreApp:
timeout 0
setautohangup 0
getini @AppIni, @App, "StartPreApp", ##StartPreApp
getini @AppIni, "External", "PreApp", #PreApp
if (##StartPreApp == 1 and #PreApp != "")
runsync2 #PreApp
; run #PreApp
endif
setautohangup @@HangMin
return
;///// NEWS OPERATION SUBROUTINES/////
SubNewsRead:
getini @AppIni, @App, "NewsLog", ##NewsLog
if (@PrevJob != "NEW") send "GO NEW^M"
call Prompt
@PrevJob = "NEW"
call MainMenuKey
if (@@tPage == 1) call PageOff @@tPage
if (##NewsLog == 1)
call GetJobLogFile "NEWS"
call LogStart #return
endif
if (@@NewsLevel == 1)
#NewsNo = "ALL"
else
input "読みだし希望番号を入力して下さい。", #NewsNo, "ALL"
if (cancel)
if (##NewsLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
return
endif
endif
send #NewsNo + "^M"
call Prompt
if (##NewsLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
send "NEWOFF^M"
call Prompt
return
;///// BILL SUBROUTINE /////
SubBill:
getini @AppIni, @App, "BillLog", ##BillLog
getini @AppIni, "Level", "BillDetail", ##BillDetail
#Date = @Yr + @LogDate
if (@PrevJob != "BIL") send "GO BILL^M"
wait "^J利用料金情報"
call Prompt
@PrevJob = "BIL"
call MainMenuKey
if (@@tPage == 1) call PageOff @@tPage
if (##BillLog == 1)
call GetJobLogFile "BILL"
call LogStart #return
endif
##BillCheck = 0
##DetailCheck = 0
send "2^M"
loopswitch
case "表示情報選択 (1:日毎合計表示"
call Prompt
if (##BillDetail == 1 and ##BillCheck == 0)
send "1^M"
##BillCheck = ##BillCheck + 1
else
send "E^M"
breakloop
endif
case "表示月選択 (数字で月日指定 改行で前々月から表示"
call Prompt
if (##DetailCheck > 0)
send "E^M"
else
##Mon = value(@Mon) - 1
if (##Mon == 0) ##Mon = 12
send ##Mon + "^M"
##DetailCheck = #DetailCheck + 1
endif
case postmilliidle(@@sProp) "^Jmore>"
send "^M"
case "^J続き"
call Prompt
send "^M"
endloop
call Prompt
if (##BillLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
return
;///// CLIPPING SERVICE SUBROUTINE /////
SubClipRead:
getini @AppIni, @App, "ClipId", ##ClipId
getini @AppIni, @App, "ClipLog", ##ClipLog
if (##ClipId < 2)
if (##ClipId != @@LoginId) return
endif
if (@PrevJob != "CLP") send "GO CLIP^M"
call Prompt
@PrevJob = "CLP"
call MainMenuKey
if (@@tPage == 1) call PageOff @@tPage
send "3^M"
switch
case "ニュースを読む"
call Prompt
millisleep 1
##i = 1
while (##i < 4)
readbuffer ##i, #Line
if (#Line == "ニュースを読む") breakloop
else ##HolderNum = ##i
##i = ##i + 1
endwhile
case "◆現在クリッピングは設定されていません◆"
call Prompt
return
endswitch
##ReadHolder = 1
DoClipRead:
if (##ClipLog == 1)
call GetJobLogFile "CLIP"
call LogStart #return
endif
#ClipNum = ""
send ##ReadHolder + "^M"
switch
case "◆現在ニュースはクリップされていません◆"
call Prompt
goto ClipReadEnd
case "番号 (改行で次頁)^M^J>"
send "^M"
case ":"
##i = 0
beginloop
getchar #Number
if (##i == 3) breakloop
if (#Number == " " or #Number == "") breakloop
#ClipNum = #ClipNum + #Number
##i = ##i + 1
endloop
endswitch
call Prompt
#ClipNo = #ClipNum + "-1"
switch @@ClipLevel
case 0
#DelCmd = "2"
#Msg = "読みだし希望番号を入力して下さい。"
input #Msg, #ClipNo, #ClipNo
if (cancel) send "E^M"
else send #ClipNo + "^M"
case default
#DelCmd = "1"
send #ClipNo + "^M"
endswitch
call Prompt
if (##ClipLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
send "^M"
loopswitch
case "記事削除 (1:全記事削除 2:今読んだ記事 改行で終了)^M^J:"
send #DelCmd + "^M"
case "削除 (1:削除する 2:しない)^M^J:"
send "1^M"
case "ニュースを読む"
call Prompt
breakloop
endloop
ClipReadEnd:
##ReadHolder = ##ReadHolder + 1
if (##ReadHolder <= ##HolderNum) goto DoClipRead
return
ClipSet:
#Holder = #1
#NewsPaper = #2
#SavDay = #3
#Key = #4
if (#Holder == "") #Holder = "Clipping"
if (#Key == "")
@@ErrorLevel = 8
#p = "キーワード"
goto ErrorCheck
endif
while (##i < 8)
#Keyword[##i] = ""
##i = ##i + 1
endwhile
#Key = #Key + ","
##i = 0
##h = 1
beginloop
#a = part(#Key, ##i, 1)
if ( #a == "," )
#Keyword[##h] = tozenkaku(part(#Key, 0, ##i))
##h = ##h + 1
##i = ##i + 1
#Key = part(#Key, ##i, 256)
if (length(#Key) <= 1 ) breakloop
##i = 0
endif
if (length(#Key) <= 1) breakloop
##i = ##i + 1
endloop
send "1^M"
##Count = 1
loopswitch
case "ホルダー名の設定 (全角10文字まで)"
call Prompt
send #Holder + "^M"
case "記事の保存期間を入力してください "
call Prompt
send #SavDay + "^M"
case "(1:OK 2:NG)"
call Prompt
send "1^M"
case "番号選択 (複数選択可):"
send #NewsPaper + "^M"
case "番号選択 (改行のみ終了):"
send "^M"
case "キーワードの入力 (全角のみ10文字まで"
call Prompt
send #Keyword[##Count] + "^M"
##Count = ##Count + 1
case "記事数表示 (1:表示する 2:表示しない)"
send "1^M"
case "確認 利用設定 (1:する 2:しない)", \
"確認 設定内容変更 (1:する 2:しない)"
call Prompt
send "1^M"
case "クリッピング設定/解除"
call Prompt
breakloop
endloop
return
;///// MAIL SUBROUTINE /////
SubMailRead:
getini @AppIni, @App, "MailLog", ##MailLog
if (@@LoginId == 0)
getini @AppIni, @App, "MailRead", ##MailRead
getini @AppIni, @App, "MailAct", ##MailAct
else
getini @AppIni, @App, "ExtraMailRead", ##MailRead
getini @AppIni, @App, "ExtraMailAct", ##MailAct
endif
if (@PrevJob != "MAL") send "MAIL^M"
call Prompt
call MailKey
if (@@tPage == 1) call PageOff @@tPage
if (##MailLog == 1)
call GetJobLogFile "MAIL"
call LogStart #return
endif
DoMailRead:
call CheckMailList "1"
#List = #return
if (#List == "")
if (##MailLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
@PrevName = "TXT"
@PrevJob = "MAL"
return
endif
if (##MailRead == 1)
timeoutquestion "未読メールをすべて読みますか。", @@sDisp
if (no)
#Msg = "メールの識別子を指定してください。バイナリー^M"
#Msg = #Msg + "メールの場合は、識別子の前に @ が必要です。^M"
#Msg = #Msg + "キャンセルは、メール処理を終了します。"
#Num = ""
while (#Num == "")
input #Msg, #Num, #List
if (cancel)
if (##MailLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
@PrevName = "TXT"
@PrevJob = "MAL"
return
endif
endwhile
#List = #Num
if (part(#List, length(#List) - 1, 1) != ",")
#List = #List + ","
endif
endif
endif
while (length(#List) > 1)
#MailName = drop(#List, ",")
#List = search(#List, ",")
if (part(#MailName, 0, 1) == "@")
#MailName = part(#MailName, 1, 8)
call DownBinMail #MailName
else
send "REA " + #MailName + "^M"
endif
if (##MailAct == 1) call MailLoop "SAV"
else call MailLoop "DEL"
#List = part(#List, 1, 256)
if (length(#List) > 1 and length(#List) < 9) goto DoMailRead
endwhile
if (##MailLog == 1)
call DefaultLogStart
; call LogAppend #LogFile
endif
call MainMenuKey
@PrevName = "TXT"
@PrevJob = "MAL"
return
MailDelete:
if (@@tPage == 1) call PageOff @@tPage
call CheckMailList "2"
#List = #return
if (#List == "") return
while (length(#List) > 1)
#DelName = drop(#List, ",")
send "DEL " + #DelName + "^M"
call MailLoop "DEL"
#List = part(search(#List, ","), 1, 256)
if (length(#List) > 1 and length(#List) < 9) goto MailDelete
endwhile
@PrevName = "TXT"
@PrevJob = "MAL"
return
MailDownload:
if (@@tPage == 1) call PageOff @@tPage
call CheckMailList "3"
#List = #return
if (#List == "") return
while (length(#List) > 1)
#DowName = drop(#List, ",")
call DownBinMail #DowName
getini @AppIni, @App, "MailAct", ##MailAct
if (##MailAct == 1) call MailLoop "SAV"
else call MailLoop "DEL"
#List = part(search(#List, ","), 1, 256)
if (length(#List) > 1 and length(#List) < 9) goto MailDownload
endwhile
return
DownBinMail:
port autobplus = off
send "DOW " + #1 + " PROT:BPL^M"
wait "ファイル名 (改行のみで終了)^M^J:"
send #1 + ".BML^M"
wait "^E"
download #1 + ".BML", bplus
wait "-ダウンロード終了-"
port autobplus = on
return
CheckMailList:
#Number = ""
#Num = ""
send "LIST^M"
switch
case ":"
##i = 0
beginloop
getchar #Number
if (##i == 2) breakloop
if (#Number == " " or #Number == "") breakloop
#Num = #Num + #Number
##i = ##i + 1
endloop
endswitch
call Prompt
##Num = value(#Num)
if (##Num < 1) return ""
#NewList = ""
#DelList = ""
#DowList = ""
readbuffer 0, #Line
##i = 1
if (#Line == ">")
##Num = ##Num + 1
##i = ##i + 1
endif
while (##i <= ##Num)
readbuffer ##i, #Buf
#MailName = part(#Buf, 71, 8)
if (part(#Buf, 0, 1) != "*")
if (part(#Buf, 29, 1) == "B")
#NewList = #NewList + "@" + #MailName + ","
#DowList = #DowList + #MailName + ","
else
#NewList = #NewList + #MailName + ","
endif
else
#DelList = #DelList + #MailName + ","
endif
##i = ##i + 1
endwhile
if (#1 == "1") #RetList = #NewList
if (#1 == "2") #RetList = #DelList
if (#1 == "3") #RetList = #DowList
return #RetList
MailToId:
input "宛先を入力して下さい。", #ToId
if (cancel) #ToId = ""
send toupper(#ToId) + "^M"
return
GetMailId:
readfile #1, #Id
if (no)
closefile #1
#Id = ""
endif
if (part(#Id, 0, 1) == @sRem)
beginloop
readfile #1, #Id
if (part(#Id, 0, 1) == @sRem) loopagain
if (part(#Id, 0, 1) == "@") #Id = ""
breakloop
endloop
endif
#Id = toupper(drop(drop(drop(#Id, @sRem), "^I"), ","))
return #Id
MailCancel:
#CanId = ""
while (#CanId == "")
input "キャンセルするメールの相手のIDは?", #CanId
if (cancel) return
endwhile
send "CAN^M"
call MailLoop "DEL", toupper(#CanId)
return
AddressBook:
#File = #1
if (#File == "")
#File = dropback(@UpPath, "\")
chdir #Path
inputfilename "ファイル名", #File
restoredir
if (cancel) return
#File = @UpPath + #File
else
if (search(#File, "\") == "") #File = @UpPath + #File
if (not existfile(#File))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
openfile #File
beginloop
readfile #File, #Line
if (no)
closefile #File
return
endif
if (part(#Line, 0, 1) == @sRem) loopagain
if (part(#Line, 0, 1) == "@")
#Name = part(#Line, 1, 256)
#Name = drop(drop(#Name, @sRem), "^I")
else
closefile #File
return
endif
breakloop
endloop
send "1^M"
call MailLoop "", "", #Name, #File
if (value(#return > 0)
#Msg = #return + "人分のIDを送信しました。"
timeoutmessage #Msg, @@sDisp
endif
return
MailLoop:
#Act = #1
#Id = #2
#Name = #3
#File = #4
##i = 0
loopswitch
case "^J続き (改行で"
call Prompt
send "^M"
case postmilliidle(@@sProp) "^Jmore>"
send "^M"
case "^J受信後"
call Prompt
send #Act + "^M"
case "action:"
send #Act + "^M"
case "削除 (1:削除する 2:しない)"
call Prompt
if (#Act == "DEL") send "1^M"
else send "2^M"
case "削除対象IDの入力(改行で終了)"
call Prompt
send #Id + "^M"
#Id = ""
case "削除対象メール数:"
call Prompt
send "1^M"
case "削除メッセージの入力(漢字で20文字まで 改行のみ省略)"
call Prompt
#Msg1 = "内容不備のため"
#Msg = ""
input "削除メッセージを入力して下さい。", #Msg, #Msg1
send #Msg + "^M"
case "同報グループ名 (改行で終了)"
call Prompt
send #Name + "^M"
if (#Name == "") breakloop
#Name = ""
case "ID (改行で終了)"
call Prompt
call GetMailId #File
send #return + "^M"
if (#return != "")
##i = ##i + 1
else
call Prompt
send "E^M"
call Prompt
breakloop
endif
case "(1:OK 2:NG)"
call Prompt
send "1^M"
case "◆現在アドレスブックには、登録されていません◆", \
"◆宛先IDが最大個数のため登録出来ません◆", \
"-宛先ID最終登録-"
closefile #4
call Prompt
send "E^M"
call Prompt
breakloop
case postmilliidle(@@sProp) "^J>", \
postmilliidle(@@sProp) "^JMAIL>", \
"^J◆削除対象テキストがありません◆", \
"^J◆登録されていません◆", \
"^J◆番号又はコマンドを入力して下さい◆", \
"^J◆番号の選択に誤りがあります◆", \
"^J◆入力データエラー◆" ;, \
; "^J◆正しい番号を入力してください◆", \
; "^J-未読メールはありません-"
breakloop
endloop
return ##i
;///// FORUM SUBROUTINE /////
ForumJoin:
send "3^M"
wait "氏名 (漢字で8文字以内 改行のみ実名)"
call Prompt
call MyHandle
call MesLoop
send "^M"
return
PatioJoin:
send "1^M"
wait "氏名 (漢字で 8文字以内 改行で登録名)"
call Prompt
call MyHandle
call MesLoop
send "^M"
return
ForumSysopMail:
send "SYM^M"
call Prompt
send "1^M"
return
ForumTopMove:
send "T^M"
call Prompt
call ForumKey
return
MesRoomMove:
send "MES^M"
call Prompt
call MesRoomKey
return
LibMove:
send "LIB^M"
call Prompt
call LibKey
return
MesDelete:
#DelNum = ""
while (#DelNum == "")
input "削除する発言番号は?", #DelNum
if (cancel) return
endwhile
send "RD " + #DelNum + "^M"
call MesLoop
return
ForumOptChange:
call SubForumOption "FM"
return
PatioOptChange:
call SubForumOption "PT"
return
NoMRead:
call GetRoomList
if (#return == "") return
#RoomList = #return
##h = 0
while (length(#RoomList) > 1)
#Room = drop(#RoomList, ",")
#YetList = search(#RoomList, ",")
call MakeNoMRead #Room, ##h
#RoomList = part(#YetList, 1, 256)
##h = ##h + 1
endwhile
return
MakeNoMRead:
#Room = #1
##h = value(#2)
if (##h == 0) send #Room + "^M"
else send "RX " + #Room + "^M"
call Prompt
; send "RMN^M"
; call Prompt
send "RC MAX^M"
call Prompt
return
GetRoomList:
getini @AppIni, @App, "ForumOption", #FoptSet
##fPage = value(part(#FoptSet, 1, 1))
if (##fPage == 1) call PageOff ##fPage
send "MES^M"
switch
case "^J◆この機能は本フォーラムではご利用できません◆", \
"^J現在、サービスは大変混雑しています。"
@@ErrorLevel = 3
goto ErrorCheck
case "^J番号 発言 (未読) 最新 会議室名^M^J"
;
endswitch
#RoomList = ""
beginloop
getchar #a
if(#a == ">") breakloop
getline #Line
#Line = #a + #Line
if (part(#Line, 13, 3) != " 0")
if (part(#Line, 0, 1) == " ")
#RoomList = #RoomList + part(#Line, 1, 1) + ","
else
#RoomList = #RoomList + part(#Line, 0, 2) + ","
endif
endif
endloop
return #RoomList
ListFileName:
##Num = 10
##MaxBuf = 100
#SeaStr1 = ".LZH"
#SeaStr2 = ".EXE"
#SeaStr3 = ".ZIP"
#SearchBuf = ""
#CutStr = ""
addmenu "ファイル名は?"
addmenu 0
##j = 1
while (##j <= ##Num)
beginloop
if (##i > ##MaxBuf) breakloop
readbuffer ##i, #buf
#buf = toupper(#buf)
if (search(#buf, #SeaStr1) != "")
#CutStr = #SeaStr1
breakloop
endif
if (search(#buf, #SeaStr2) != "")
#CutStr = #SeaStr2
breakloop
endif
if (search(#buf, #SeaStr3) != "")
#CutStr = #SeaStr3
breakloop
endif
##i = ##i + 1
millisleep 1
endloop
if (##i > ##MaxBuf) breakloop
#FileHead = drop(#buf, #CutStr)
#FileHead = part(#FileHead, length(#FileHead) - 8, 8)
call TrimFileName #FileHead, #CutStr
#DownFile[##j] = #return
addmenu #DownFile[##j]
endif
##j = ##j + 1
##i = ##i + 1
millisleep 1
endwhile
showmenu
if (result <= 0) return
send #DownFile[result] + "^M"
return
DownFileName:
#SeaStr = "データ名:"
call SearchFileName #SeaStr
#File = part(search(#return, #SeaStr), 10, 255)
#Ext = part(search(#File, "."), 0, 4)
#Head = drop(#File, #Ext)
if (#Head != "")
call TrimFileName #Head, #Ext
#DownFile = #return
call ConfirmFileName #DownFile
if (#return == "YES")
send #DownFile + "^M"
return #DownFile
endif
endif
#SeaStr = ".LZH"
call SearchFileName #SeaStr
#Head = drop(#return, #SeaStr)
#Head = part(#Head, length(#Head) - 8, 8)
if (#Head != "")
call TrimFileName #Head, #SeaStr
#DownFile = #return
call ConfirmFileName #DownFile
if (#return == "YES")
send #DownFile + "^M"
return #DownFile
endif
endif
#SeaStr = "ファイル名は"
call SearchFileName #SeaStr
#File = part(search(#return, #SeaStr), 12, 255)
#Ext = part(search(#File, "."), 0, 4)
#Head = drop(#File, #Ext)
if (#Head != "")
call TrimFileName #Head, #Ext
#DownFile = #return
call ConfirmFileName #DownFile
if (#return == "YES")
send #DownFile + "^M"
return #DownFile
endif
endif
call ListFileName
if (#return == "") call InputFileName #DownFile
send toupper(#return) + "^M"
return toupper(#return)
SearchFileName:
##i = 0
#SearchStr = #1
#SearchBuf = ""
while (#SearchBuf == "")
##i = ##i + 1
if(##i > 150) return ""
readbuffer ##i, #buf
#buf = toupper(#buf)
#SearchBuf = search(#buf, #SearchStr)
endwhile
return #buf
TrimFileName:
##a = length(#1)
#Ext = #2
##i = 0
while (##i < ##a + 1)
#Char[##i] = part(#1, ##i, 1)
##i = ##i + 1
endwhile
##j= 0
#Head = ""
while(##j < ##i + 1)
if (#Char[##j] >= "^024" and #Char[##j] <= "^07E")
if (#Char[##j] >= "^02A" and #Char[##j] <= "^02D")
elseif (#Char[##j] == "^02F")
elseif (#Char[##j] >= "^03A" and #Char[##j] <= "^040")
elseif (#Char[##j] >= "^05B" and #Char[##j] <= "^05D")
elseif (#Char[##j] >= "^060" and #Char[##j] <= "^07A")
elseif (#Char[##j] == "^07C")
else
#Head = #Head + #Char[##j]
endif
endif
##j = ##j + 1
endwhile
if(#Head == "") return ""
if (length(#Head) > 9) #Head = part(#Head, length(#Head) - 8, 8)
#FileName = #Head + #Ext
return #FileName
ConfirmFileName:
#Msg = "ダウンロードファイル名は、^M" + #1 + "で良いですか?"
timeoutquestion #Msg, @@sDisp
if (yes) #Ret = "YES"
else #Ret = "NO"
return #Ret
InputFileName:
#Def = #1
#DownFile = ""
#Mes = "ダウンロードファイル名を入力して下さい。"
input #Mes, #DownFile, #Def
if (cancel) #Ret = ""
else #Ret = #DownFile
return #Ret
LibBrowse:
#Key = ""
#LibDate = ""
while (#Key == "")
input "キーワードは?", #Key
if (cancel) return
endwhile
while (#LibDate == "")
input "日付(YYMMDD)は?", #LibDate, "931101"
if (cancel) #LibDate = "931101"
endwhile
send "BRO KEY:" + toupper(#Key) + " DATE:" + #LibDate + "^M"
call Prompt
return
LibSearch:
#Data = ""
while (#Data == "")
input "検索するファイル名は?", #Data
if (cancel) return
endwhile
send "SEA FN:" + toupper(#Data) + "^M"
call Prompt
return
LibDown:
#Lib = ""
#Data = ""
input "ライブラリ番号は?(キャンセル/現在のLIB)", #Lib
if (cancel) #Lib = ""
if (#Lib != "")
send "LIB " + #Lib + "^M"
call Prompt
endif
while (#Data == "")
#Msg = "ダウンロードデータ番号を入力してください。^M"
#Msg = #Msg + "ファイル名も指定する場合は、番号-ファイ^M"
#Msg = #Msg + "ル名としてください。 (例) 123-NAH100.LZH"
input #Msg, #Data
if (cancel) return
endwhile
#DowNum = drop(#Data, "-")
#FName = part(search(#Data, "-"), 1, 256)
send "DOW " + #DowNum + " PROT:BPL^M"
port autobplus = off
call LibLoop #FName
port autobplus = on
return
;///// JOB IDENTIFY SUBROUTINE /////
IdentifyOperation:
#Section = #1
#PrevName = @PrevName
switch #Section
case "Read"
call DlmOn
goto GetDoName
case "List"
goto GetDoName
case default
switch #Section
case "SRead"
call DlmOn
#File = @SelFile
case "Mes"
#File = @MesFile
case "Lib"
#File = @LibFile
endswitch
if (not existfile(#File)) return
goto GetJobSpec
endswitch
GetDoName:
##i = 1
##j = 1
beginloop
if(##j > 4) breakloop
if(##j == 1) getini @AppIni, "Forum", ##i, #Name
if(##j == 2) getini @AppIni, "HP", ##i, #Name
if(##j == 3) getini @AppIni, "Patio", ##i, #Name
if(##j == 4) getini @AppIni, "PriForum", ##i, #Name
if (#Name != "")
getini @AppIni, #Name, "ReadID", ##ReadId
if (@@LoginId == ##ReadId)
if (#Section == "Read")
getini @AppIni, #Name, "Read", ##Level
if (@@ReadLevel < 10)
if (##Level > @@ReadLevel)
##i = ##i + 1
loopagain
endif
else
if (##Level != (@@ReadLevel - 10))
##i = ##i + 1
loopagain
endif
endif
endif
if (#Section == "List")
getini @AppIni, #Name, "List", ##ListLev
if (##ListLev < 1)
##i = ##i + 1
loopagain
endif
endif
else
##i = ##i + 1
loopagain
endif
getini @AppIni, #Name, "Function", #Func
call GetDoDetal #Section, #Name, #Func, #PrevName, #PrevFunc
##i = ##i + 1
#PrevName = drop(#Name, "-")
#PrevFunc = #Func
millisleep 1
if (@AppSet == 1 and ##i > 3)
##i = 1
##j = ##j + 1
millisleep 1
endif
else
##i = 1
if (#Section = "List") ##j = ##j + 3
else ##j = ##j + 1
millisleep 1
endif
endloop
if (#Section == "List")
call DateAdjust 24
#LastListDate = part(#return, 0, 6)
putini @AppIni, "Level", "LastListDate", #LastListDate
endif
@PrevName = #Name
@PrevJob = #Job
return
GetDoDetal:
#Section = #1
#Name = #2
#Func = #3
#PrevName = #4
#PrevFunc = #5
goto CheckFunc
GetJobSpec:
#Name = @PrevName
#Job = @PrevJob
getini @AppIni, @App, "MesLib", ##FileFlag
#File2 = @LogPath + "NAH" + @Yr + @Mon + searchback(#File, ".")
appendfile #File2
if (no) createfile #File2
writefile #File2, "[" + @Yr + "年" + @Mon + "月" + @Day + "日]"
openfile #File
GetJobDetail:
beginloop
readfile #File, #Line
if (no)
closefile #File
closefile #File2
delfile #File
if (##FileFlag == 1) delfile #File2
@PrevJob = #Job
@PrevName = #Name
return
else
writefile #File2, #Line
endif
#Head = part(#Line, 0, 1)
if (#Head == @sRem) loopagain
if (#Head == "@")
breakloop
else
@@ErrorLevel = 5
goto ErrorCheck
endif
endloop
GetJobParameter:
#PrevJob = #Job
#PrevFunc = #Func
#PrevName = #Name
#PrevRoom = #Room
#PrevLib = #Lib
#Job = ""
#IdBook = ""
#Content = ""
#Data = ""
##Delay = 0
#Func = ""
#Key = ""
#Lib = ""
#Name = ""
#Password = ""
#Room = ""
#SavDay = ""
#Sub = ""
#ToId = ""
#Type = ""
#ActLine = #Line
#Line = part(drop(dropback(#Line, @sRem), "^I"), 1, 256) + @sPara
##i = 0
beginloop
#a = part(#Line, ##i, 1)
if (#a == @sPara) breakloop
##i = ##i + 1
endloop
#Job = toupper(drop(part(#Line, 0, ##i), " "))
##i = ##i + 1
#Line = part(#Line, ##i, 256)
if (length(#Line) <= 1) goto CheckJobSpec
##i = 0
beginloop
#a = part(#Line, ##i, 1)
if (#a == @sPara)
#p = toupper(part(#Line, 0, 2))
#t = (part(#Line, 2, ##i - 2)
#v = toupper(#t)
#x = (part(#v, length(#v) - 1, 1))
if (#x == " ")
#t = part(#t, 0, length(#t) - 1)
#v = part(#v, 0, length(#v) - 1)
endif
switch #p
case "B="
#IdBook = #v
case "C="
#Content = #v
case "D="
#Data = #v
case "F="
#Func = #v
case "I="
#ToId = #v
case "K="
#Key = #v
case "L="
#Lib = #v
case "N="
#Name = #v
case "P="
#Password = #v
case "R="
#Room = #v
case "S="
#Sub = #t
case "T="
#Type = #v
case "V="
#SavDay = #v
case "Y="
##Delay = value(#v)
case default
@@ErrorLevel = 8
#p = "Unknown"
goto ErrorCheck
endswitch
##i = ##i + 1
#Line = part(#Line, ##i, 256)
if (length(#Line) <= 1) breakloop
##i = 0
loopagain
endif
if (length(#Line) <= 1) breakloop
##i = ##i + 1
loopagain
endloop
CheckJobSpec:
if (#Name == "PER")
#JobChange = #Name
#NameChange = #Job
#Job = #JobChange
#Name = #NameChange
#JobChange = ""
#NameChange = ""
endif
switch #Job
case "MAL"
if (#PrevJob != #Job)
send "MAIL^M"
call Prompt
call MailKey
endif
switch #Name
case "ADB"
send "ADD^M"
call Prompt
call AddressBook #Data
goto GetJobDetail
case "BIN"
if (search(#Data, "\") == "") #Data = @UpPath + #Data
if (not existfile(#Data))
@@ErrorLevel = 9
goto ErrorCheck
endif
send "UPL TYPE:BIN PROT:BPL^M"
goto BMailStart
case "LOA"
goto PerFile
case default
send "COM^M"
goto MesUpStart
endswitch
case "CEN"
if (#PrevJob != #Job)
send "GO CENTER^M"
call Prompt
call MainMenuKey
endif
send "1^M"
call Prompt
send "1^M"
goto MesUpStart
case "SYM"
if (#Func == "")
getini @AppIni, #Name, "Function", #Func
endif
if (#Password == "")
getini @AppIni, #Name, "Password", #Password
endif
if (#PrevName != #Name)
call Move #Func, #Name, #Password
if (@@ErrorLevel > 0) goto ErrorCheck
call ForumKey
endif
send "SYM^M"
call Prompt
send "1^M"
goto MesUpStart
case "PER"
if (#PrevJob != #Job)
send "GO PER^M"
call Prompt
call PerFileKey
endif
send "2^M"
call Prompt
goto PerFile
case "SAY", "DOW", "UPL", "BRO", "SRE"
if (#Job == "UPL")
if (search(#Data, "\") == "") #Data = @UpPath + #Data
if (not existfile(#Data))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
if (#Name == "") #Name = @NifId
if (#Func == "")
getini @AppIni, #Name, "Function", #Function
if (#Function == "")
@@ErrorLevel = 7
goto ErrorCheck
endif
#Func = #Function
endif
goto CheckFunc
case "SWS"
call SwSokin #Data
goto GetJobDetail
case "CLP"
send "GO CLIP^M"
call Prompt
send "2^M"
call Prompt
call ClipSet #Name, #Data, #SavDay, #Key
goto GetJobDetail
case default
@@ErrorLevel = 6
goto ErrorCheck
endswitch
CheckFunc:
#OrgName = drop(#Name, "-")
#PrevOrgName = drop(#PrevName, "-")
if (#Func != "FM") getini @AppIni, #Name, "Password", #Password
switch #Func
case "FM", "PF"
if (#PrevOrgName != #OrgName) call Move #Func, #OrgName, #Password
case "HP"
if (#Name == "") #Name = @NifId
if (#PrevFunc != #Func)
call Move #Func, #OrgName, #Password
else
if (#PrevName != #Name)
send "MOVE^M"
call HpPtEnter #OrgName, #Password
endif
endif
case "PT"
if (#Name == "") #Name = @NifId
if (#PrevName != #Name or #PrevFunc != #Func)
call Move #Func, #OrgName, #Password
endif
case default
@@ErrorLevel = 7
endswitch
if (@@ErrorLevel > 0)
goto ErrorCheck
if (#Func == "HP" or #Func == "PT")
#Func = #Func + "E"
if (#Section == "Read")
return
endif
endif
endif
switch #Section
case "Read"
goto SubRead
case "List"
goto SubList
case "Mes"
goto SubMes
case "Lib"
goto SubLib
case "SRead"
goto SubSelRead
endswitch
;///// READ SUBROUTINE /////
SubRead:
getini @AppIni, #Name, "Room", #Room
getini @AppIni, #Name, "RoomLog", #RoomLog
getini @AppIni, #Name, "Log", #Log
if (#RoomLog == "") #RoomLog = "00000000000000000000"
switch #Func
case "HP"
if (@@tPage == 1) call PageOff @@tPage
##ReadMethod = value(part(#Room, 0, 1))
##GetRoomLog = value(part(#RoomLog, 0, 1))
if (##ReadMethod == 0) return
if (##GetRoomLog == 1)
call GetLogFile #Func, #Log, ""
#HpLog = #return
call LogStart #HpLog
endif
switch ##ReadMethod
case 1
send "REA NEW^M"
case 3
send "TITLE NEW^M"
endswitch
call Prompt
if (##GetRoomLog == 1) call DefaultLogStart
return
case "PT"
readbuffer 1, #Line
if (part(#Line, 13, 3) != " 0") #YetList = "1,"
else return
if (#Room == "") #Room = "1"
case "FM", "PF"
send "SEND OFF^M"
call Prompt
call MesRoomKey
call GetRoomList
#YetList = #return
if (length(#YetList) <= 1) return
if (#Room == "") #Room = "00000000000000000000"
endswitch
getini @AppIni, #Name, "ReadLimit", ##RLimit
switch ##RLimit
case 0
#MreRoom = ""
#OtherRoom = ""
while (length(#YetList) > 1)
#YetRoom = drop(#YetList, ",")
#YetList = part(#YetList, length(#YetRoom) + 1, 256)
##ReadMethod = value(part(#Room, value(#YetRoom) - 1, 1))
##GetRoomLog = value(part(#RoomLog, value(#YetRoom) - 1, 1))
if (##ReadMethod == 1 and ##GetRoomLog == 0)
#MreRoom = #MreRoom + #YetRoom + ","
else
#OtherRoom = #OtherRoom + #YetRoom + ","
endif
endwhile
if (#MreRoom != "")
if (#Func == "PT")
send "MRE^M"
else
#MreRoom = dropback(#MreRoom, ",")
send "MRE ROOM:" + #MreRoom + "^M"
endif
call Prompt
endif
#YetList = #OtherRoom
case default
;
endswitch
##j = 1
#YetRoom = ""
beginloop
#YetRoom = drop(#YetList, ",")
#YetList = part(#YetList, length(#YetRoom) + 1, 256)
##ReadMethod = value(part(#Room, value(#YetRoom) - 1, 1))
##GetRoomLog = value(part(#RoomLog, value(#YetRoom) - 1, 1))
if (##ReadMethod > 0)
call DoRead #Name, #YetRoom, ##ReadMethod, ##GetRoomLog, #Log, ##j
##j = ##j + 1
endif
if (length(#YetList) <= 1) breakloop
endloop
return
DoRead:
#Name = #1
#Room = #2
##ReadMethod = value(#3)
##GetRoomLog = value(#4)
#Log = #5
##Count = value(#6)
getini @AppIni, #Name, "Function", #Func
if (#Log == "") #Log = #Name
call GetLogFile #Func, #Log, #Room
#Log = #return
getini @AppIni, #Name, "ReadLimit", ##RLimit
getini @AppIni, "Level", "ReadLimit", ##LimitNum
if (##LimitNum == 0) ##RLimit = 0
if (#Func == "PT")
readbuffer 1, #Line
#Exist = part(#Line, 5, 6)
#MreNum = part(#Line, 12, 4)
send "1^M"
if (##GetRoomLog == 1 and ##ReadMethod == 3) call LogStart #Log
call Prompt
else
if (##GetRoomLog == 1 and ##ReadMethod == 3) call LogStart #Log
if (##Count == 1) send "MES " + #Room + "^M"
else send "RX " + #Room + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
readbuffer 0, #Line
if (#Line == ">") ##Num = 2
else ##Num = 1
readbuffer ##Num, #Line
if (search(#Line, "リードオンリ") != "")
##Num = ##Num + 1
readbuffer ##Num, #Line
endif
#Exist = part(drop(search(#Line, "発言数 :"), " 未読"), 8, 256)
#MreNum = part(drop(search(#Line, "未読 :"), "-"), 6, 256)
endif
##OffSet = value(#Exist) - ##LimitNum + 1
#GetNum = ""
if (##RLimit == 0)
#GetNum = "NEW"
else
if (value(#MreNum) <= ##LimitNum)
#GetNum = "NEW"
else
#GetNum = ##OffSet + "-" + #Exist
endif
endif
DoReadStart:
switch ##ReadMethod
case 1
#Cmd = "MRE"
if (#GetNum != "NEW") #Cmd = #Cmd + " MODE:" + ##OffSet
case 2
#Cmd = "DOW " + #GetNum + " PROT:BPL"
case 3
#Cmd = "RTN"
; #Cmd = "RMN"
endswitch
send #Cmd + "^M"
switch ##ReadMethod
case 1
if (##GetRoomLog == 1) call LogStart #Log
call Prompt
case 2
switch
case "^J:"
port autobplus = off
case "◆現在未読の発言はありません◆"
return
endswitch
send #Log + "^M"
wait "^E"
download #Log, bplus, append
switch
case "@ヤ"
sendbreak
call Prompt
##ReadMethod = 1
port autobplus = on
goto DoReadStart
case "-ダウンロード終了-"
call Prompt
port autobplus = on
endswitch
case 3
call Prompt
send "RC MAX^M"
call Prompt
endswitch
if (##GetRoomLog == 1 and ##ReadMethod != 2)
call DefaultLogStart
; call LogAppend #Log
endif
return
;///// LIST SUBROUTINE /////
SubList:
getini @AppIni, #Name, "Lib", #Lib
getini @AppIni, #Name, "LibLog", #LibLog
getini @AppIni, #Name, "Log", #Log
if (#Lib == "") #Lib = "00000000000000000000"
if (#Log == "") #Log = #Name
if (search(#LibLog, "1") == "") ##GetLibLog = 0
else ##GetLibLog = 1
if (search(#Lib, "0") == "")
#ListLib = "ALL"
else
##i = 1
#ListLib = ""
while (##i <= 20)
##a = value(part(#Lib, ##i - 1, 1))
if (##a > 0) #ListLib = #ListLib + ##i + ","
##i = ##i + 1
endwhile
if (length(#ListLib) <= 1) return
#ListLib = dropback(#ListLib, ",")
endif
call LibMove
if (@@ErrorLevel > 0) goto ErrorCheck
if (##GetLibLog == 1)
call GetLogFile "LL", #Log, ""
call LogStart #return
endif
call GetList #ListLib
if (##GetLibLog == 1)
call DefaultLogStart
; call LogAppend #Log
endif
return
GetList:
#Lib = #1
#Cmd = "SEA"
while (#Lib == "")
input "ライブラリ番号は?", #Lib
if (cancel) #Lib = "ALL"
endwhile
if (#Lib != "ALL") #Cmd = #Cmd + " LIB:" + #Lib
getini @AppIni, "Level", "ListDay", ##Day
while (##Day == "")
input "何日前からのデータリストを取りますか?", ##Day, "10"
if (cancel) return
endwhile
if (##Day == 0)
getini @AppIni, "Level", "LastListDate", #LastDate
if (#LastDate != "")
#Cmd = #Cmd + " DATE:>" + #LastDate
endif
elseif (##Day > 0 and ##Day < 100)
#Cmd = #Cmd + " DAY:" + ##Day
endif
send #Cmd + "^M"
call Prompt
return
;///// TITLE SELECT READ SUBROUTINE /////
SubSelRead:
if (#Func == "HP")
#Room = "1"
#Cmd = "REA "
#Data = drop(#Data, ",")
else
if (#PrevName != #Name)
getini @AppIni, @App, "ForumOption", #FoptSet
##fPage = value(part(#FoptSet, 1, 1))
##fStop = value(part(#FoptSet, 2, 1))
if (##fPage == 1) call PageOff ##fPage
if (##fStop == 1) call PauseOff ##fStop
endif
#Cmd = "#"
endif
getini @AppIni, #Name, "RoomLog", #RoomLog
##GetRoomLog = value(part(#RoomLog, value(#Room) - 1, 1)
getini @AppIni, #Name, "Log", #Log
if (#Log == "") #Log = #Name
call GetLogFile #Func, #Log, #Room
#Log = #return
switch #Func
case "PT"
if (#PrevName != #Name)
send "1^M"
call Prompt
endif
case "HP"
;
case default
if (not(#PrevName == #Name and #PrevRoom == #Room))
send "MES " + #Room + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
endif
endswitch
#a = part(#Data, length(#Data) - 1, 1)
if (#a == "^02D")
elseif (#a >= "^030" and #a <= "^039")
else
#Data = part(#Data, 0, length(#Data) - 1)
endif
if (##GetRoomLog == 1) call LogStart #Log
send #Cmd + #Data + "^M"
call Prompt
if (##GetRoomLog == 1)
call DefaultLogStart
; call LogAppend #Log
endif
goto GetJobDetail
;///// PERSONAL FILE SUBROUTINE /////
PerFile:
if (#Content != "")
if (search(#Content, "\") == "")
#Content = @UpPath + #Content
endif
if (not existfile(#Content))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
if (#IdBook != "")
if (search(#IdBook, "\") == "")
#IdBook = @UpPath + #IdBook
endif
if (not existfile(#IdBook))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
switch #Name
case "LOA"
#Cmd = "LOA " + #Data + "^M"
if (#Content != "" and #IdBook == "")
#IdBook = #Content
#Content = ""
openfile #IdBook
readfile #IdBook, #Line
if (no)
closefile #IdBook
return
endif
endif
case "DOW"
#Cmd = "DOW " + #Data + "PROT:BPL^M"
case "UPL"
if (part(#Type, 0, 1) == "B") #Type == "BIN"
else #Type == "TXT"
#Cmd = "UPL TYPE:" + #Type + " PROT:BPL^M"
endswitch
send #Cmd
port autobplus = off
call MesLoop #ToId, #Sub, "PR", #Data, #IdBook, ""
port autobplus = on
if (#Name == "LOA" and #IdBook != "")
beginloop
call GetMailId #IdBook
if (#return != "")
send "EDIT^M"
call MesLoop #return, #Sub, "PR", #Content, #IdBook
else
closefile #IdBook
breakloop
endif
endloop
endif
if (##FileFlag == 1) delfile #Content
goto GetJobDetail
;///// MESSAGE SUBROUTINE /////
SubMes:
if (#Content != "")
if (search(#Content, "\") == "")
#Content = @UpPath + #Content
endif
if (not existfile(#Content))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
if (#IdBook != "")
if (search(#IdBook, "\") == "")
#IdBook = @UpPath + #IdBook
endif
if (not existfile(#IdBook))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
switch #Func
case "HP"
#Sub = @NifHandle + "/" + #Sub
send "COM^M"
call MesLoop "", #Sub, #Func, "", "", ""
if (#Data != "")
send "RE:" + #Data + "^M"
wait postmilliidle(@@sProp) "^M^J"
endif
goto MesUpload
case "PT"
if (#PrevName != #Name)
send "1^M"
call Prompt
endif
case default
if (not(#PrevName == #Name and #PrevRoom == #Room))
send "MES " + #Room + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
readbuffer 0, #PropLine
if (#PropLine == ">") ##i = 2
else ##i = 1
readbuffer ##i, #ChkReadOnly
if (#ChkReadOnly == "-この会議室はリードオンリーです-")
@@ErrorLevel = 3
goto ErrorCheck
endif
endif
endswitch
if (#Job == "SAY" and #Data != "") send "RE " + #Data + "^M"
else send "COM^M"
MesUpStart:
switch
case "終了は行頭で/E)^M^J"
if (#Job == "MAL" and #ToId != "")
if (search(#ToId, ",") != "")
elseif (search(#ToId, "INET:") != "")
else
send "TO:" + #ToId + "^M"
wait postmilliidle(@@sProp) "^M^J"
endif
endif
if (#Sub != "")
send "SUB:" + #Sub + "^M"
wait postmilliidle(@@sProp) "^M^J"
endif
case "◆既に削除されています◆", \
"◆該当する発言はありません◆"
call Prompt
@@ErrorLevel = 10
goto Errorcheck
case "-登録個数が最大のため登録出来ません-"
call Prompt
@@ErrorLevel = 11
goto Errorcheck
endswitch
MesUpload:
getini @AppIni, @App, "Footer", ##Foot
if (##Delay == 0 and #Content != "")
upload #Content, none
endif
beginloop
readfile #File, #Line
if (no)
if (##Delay == 1 and #Content != "") upload #Content, none
if (##Foot == 1 and #Func != "HP") call MesFooter #Job
send "/POST^M"
if (#IdBook != "") openfile #IdBook
call MesLoop #ToId, #Sub, #Func, "", #IdBook, ""
if (##FileFlag == 1) delfile #Content
goto GetJobDetail
endif
writefile #File2, #Line
#Head = part(#line, 0, 1)
#ChkLine = toupper(#Line)
if (#Head == @sRem) loopagain
if (#Head == "@") breakloop
if (#ChkLine == "/E")
elseif (#ChkLine == "/POST")
elseif (part(#ChkLine, 0, 3) == "RE:")
else
if (part(#ChkLine, 0, 3) == "TO:" and #ToId == "")
#ToId = part(#Line, 3, 256)
endif
if (part(#ChkLine, 0, 4) == "SUB:" and #Sub == "")
#Sub = part(#Line, 4, 256)
endif
send #Line + "^M"
switch
case postmilliidle(@@sProp) "^M^J"
;
case "◆最大行数を越えました◆"
call MesLoop #ToId, #Sub, #Func, "", "", "N"
goto MesUploadEnd
endswitch
endif
endloop
if (##Delay == 1 and #Content != "")
upload #Content, none
endif
if (##Foot == 1 and #Func != "HP") call MesFooter #Job
send "/POST^M"
if (#IdBook != "") openfile #IdBook
call MesLoop #ToId, #Sub, #Func, "", #IdBook, ""
MesUploadEnd:
if (##FileFlag == 1) delfile #Content
goto GetJobParameter
MesFooter:
send "^M"
wait postmilliidle(@@sProp) "^M^J"
switch #1
case "SAY"
getini @AppIni, @App, "SayFooter" + (@@LoginId + 1), #SFoot
if (#SFoot != "") send #SFoot + "^M"
else call MyHandle
case default
getini @AppIni, @App, "MailFooter" + (@@LoginId + 1), #MFoot
if (#MFoot != "") send #MFoot + "^M"
else send @NameJ + " (" + @NifId + ")" + "^M"
endswitch
return
BMailStart:
port autobplus = off
if (#IdBook != "") openfile #IdBook
call MesLoop #ToId, #Sub, "", #Data, #IdBook, ""
port autobplus = on
goto GetJobDetail
MesLoop:
#ToId = #1
#Sub = #2
#Func = #3
#Data = #4
#IdBook = #5
#ActFlag = #6
if (search(#ToId, ",") != "")
##i = 1
#ToId = #ToId + ","
while (length(#ToId) > 2)
#SendId[##i] = drop(#ToId, ",")
#ToId = part(search(#ToId, ","), 1, 256)
if (search(#SendId[##i], "CIS>") != "")
#SendId[##i] = #SendId[##i] + "," + drop(#ToId, ",")
#ToId = part(search(#ToId, ","), 1, 256)
endif
if (##i > 10) breakloop
##i = ##i + 1
endwhile
else
#SendId[1] = #ToId
endif
##Count = 1
##IdError = 0
if (#ActFlag = "") #ActFlag = "Y"
if (#IdBook != "") ##SendIdBook = 0
loopswitch
case "終了は行頭で/E"
wait "^M^J"
if (#Func == "HP") breakloop
send "/E^M"
case "修正 (1:修正する 2:しない)"
call Prompt
send "2^M"
case "ファイル名"
call Prompt
send #Data + "^M"
case "題名 (漢字で20文字まで)"
call Prompt
if (#Sub == "")
input "題名を入力して下さい。", #Sub
if (cancel)
send "DUMMY^M"
#ActFlag = "N"
endif
endif
send #Sub + "^M"
case "ハンドルネームとタイトル (漢字モードで20文字以内)"
call Prompt
if (#Sub == "")
input "題名を入力して下さい。", #Sub
if (cancel)
send @NifHandle + "/" + "題名忘れ" + "^M"
#ActFlag = "N"
endif
endif
send #Sub + "^M"
case "宛先 (IDか同報グループ名 改行で終了)", \
"宛先 (IDか同報グループ名又は FAX番号 改行で終了)", \
"宛先 (例 abc@cc.xyz.ac.jp 改行で終了)"
call Prompt
if (##Count == 1)
if (#SendId[1] == "")
if (#IdBook != "")
call GetMailId #IdBook
send #return + "^M"
else
call MailToId
endif
else
send #SendId[1] + "^M"
endif
else
if (#IdBook != "" and #SendId[##Count] == "")
call GetMailId #IdBook
send #return + "^M"
else
send #SendId[##Count] + "^M"
endif
endif
##Count = ##Count + 1
case "送信(1:送信する 2:しない 3:期日指定)", \
"送信 (1:送信する 2:しない)", \
"送信(1:送信する 2:しない)", \
"登録 (1:登録する 2:しない)"
call Prompt
if (#ActFlag != "N") send "1^M"
else send "2^M"
case "(1:OK 2:NG)", "(1:OK 2:NG)", "項目 (1:OK 2:NG 3:修正)", \
"削除 (1:削除する 2:しない)"
call Prompt
send "1^M"
case "削除メッセージの入力 (漢字で14文字まで 改行のみ :省略) "
call Prompt
#Mes = "送信ミスのため"
input "削除メッセージを入力して下さい。", #DelMes, #Mes
if (cancel) #DelMes = #Mes
send #DelMes + "^M"
case "^M^J続き (改行で"
call Prompt
send "^M"
case postmilliidle(@@sProp) "^Jmore>"
send "^M"
case "-ダウンロード開始-^M^J"
wait "^E"
download #Data, bplus
case "-アップロード開始-^M^J"
upload #Data, bplus
case "◆登録されていません◆"
call Prompt
##IdError = 1
case "◆宛先を指定して下さい◆"
call Prompt
send "^M"
if (##IdError == 1) breakloop
call Prompt
breakloop
case "-送信完了-"
call Prompt
if (#IdBook == "")
breakloop
else
call GetMailId #IdBook
if (#return == "")
breakloop
else
send "EDIT^M"
#SendId[##Count] = #return
endif
endif
case "-登録完了-", "-削除完了-", \
"◆コメントがついているため削除出来ません◆", \
"◆正しい番号を入力してください◆", \
"◆番号又はコマンドを入力して下さい◆", \
"^M^J番号 発言 (未読) 最新 会議室名^M^J"
call Prompt
breakloop
endloop
return
;///// DATA UPLOAD & DOWNLOAD SUBROUTINE /////
SubLib:
if (not(#PrevName == #Name and #PrevLib == #Lib))
send "LIB " + #Lib + "^M"
call Prompt
if (@@ErrorLevel > 0) goto ErrorCheck
call LibKey
endif
if (#Job == "UPL") goto Upload
while (#Data == "")
input "データ番号は?", #Data
endwhile
send "DOW " + #Data + " PROT:BPL^M"
if (#Content != "")
if (search(#Content, "\") != "")
#Data = #Content
else
#Data = @DownPath + #Content
endif
else
#Data = ""
endif
goto LibEnd
Upload:
if (#Key == "")
@@ErrorLevel = 8
#p = "キーワード"
goto ErrorCheck
endif
##i = 1
while (##i < 6)
#Keyword[##i] = ""
##i = ##i + 1
endwhile
#Key = #Key + ","
##i = 0
##h = 1
beginloop
#a = part(#Key, ##i, 1)
if ( #a == "," )
#Keyword[##h] = toupper(part(#Key, 0, ##i))
##h = ##h + 1
##i = ##i + 1
#Key = part(#Key, ##i, 256)
if (length(#Key) <= 1 ) breakloop
##i = 0
endif
if (length(#Key) <= 1) breakloop
##i = ##i + 1
endloop
switch #Type
case "T", "TXT", "TEXT"
#Type = "TXT"
##Type = 1
case "B", "BIN"
#Type = "BIN"
##Type = 2
case "N", "NAPLPS"
#Type = "NAPLPS"
##Type = 3
case "J", "JPEG"
#Type = "JPEG"
##Type = 4
case default
@@ErrorLevel = 8
#p = "データタイプ"
goto ErrorCheck
endswitch
if (#Content != "")
if (search(#Content, "\") == "")
#Content = @UpPath + #Content
endif
if (not existfile(#Content))
@@ErrorLevel = 9
goto ErrorCheck
endif
endif
##Count = 1
send "UPL TYPE:" + #Type + " PROT:BPL^M"
loopswitch
case "データ名 (漢字20字まで)"
call Prompt
send #Sub + "^M"
case "属性 (1:テキスト 2:バイナリ 3:NAPLPS 4:JPEG)"
call Prompt
send ##Type + "^M"
case "修正 (1:修正する 2:しない)"
call Prompt
send "2^M"
case "(1:OK 2:NG)", "確認 (1:OK 2:NG)"
call Prompt
send "1^M"
case "検索キー (漢字10字以内/1KEY 入力可能数:"
call Prompt
send #Keyword[##Count] + "^M"
##Count = ##Count + 1
case "補足説明"
wait postmilliidle(@@sProp) "^M^J"
breakloop
endloop
if (#Content != "") upload #Content, none
beginloop
readfile #File, #Line
if (no)
send "/POST^M"
goto LibEnd
endif
writefile #File2, #Line
#Head = part(#line, 0, 1)
if (#Head == @sRem) loopagain
if (#Head == "@") breakloop
if (toupper(#Line) == "/E")
elseif (toupper(#Line) == "/POST")
else
send #Line + "^M"
wait postmilliidle(@@sProp) "^M^J"
endif
endloop
send "/POST^M"
port autobplus = off
call LibLoop #Data, #Job
if (##FileFlag == 1) delfile #Content
goto GetJobParameter
LibEnd:
port autobplus = off
call LibLoop #Data, #Job
port autobplus = on
goto GetJobDetail
LibLoop:
#Data = #1
#Job = #2
loopswitch
case "処理 (1:ダウンロード ", "(1:OK 2:NG)", \
"項目 (1:OK 2:NG 3:修正)"
call Prompt
send "1^M"
case "プロトコル (1:XMODEM 2:", "修正 (1:修正する 2:しない)"
call Prompt
send "2^M"
case "項目 (1:OK 2:NG E:終了)"
call Prompt
if (#Job == "BRO")
send "E^M"
call Prompt
breakloop
else
send "1^M"
endif
case "ファイル名 (改行のみで終了)"
call Prompt
if (#Data == "")
call DownFileName
#Data = @DownPath + #return
else
send #Data + "^M"
endif
case "-ダウンロード開始-^M^J"
wait "^E"
if (existfile(#Data))
download #Data, bplus, resume
else
download #Data, bplus
endif
case "-アップロード開始-"
upload #Data, bplus
case "続き (改行で表示 E:終了)^M^J>", \
postmilliidle(@@sProp) "^Jmore>"
send "^M"
case "◆不当なタイプのパケットを転送した◆"
send "^M"
call Prompt
breakloop
case "-ダウンロード終了-", "-アップロード終了-", \
"データライブラリ (1:データ一覧", "処理 (1:検索", \
"◆データ件数が最大のためアップロード出来ません◆", \
"◆番号又はコマンドを入力して下さい◆", \
"◆ファイルアクセスでエラーが発生した◆", \
"-該当するデータはありません-"
call Prompt
breakloop
endloop
return
;///// SHAREWARE SOKIN SUBROUTINE /////
SwSokin:
#SwNum = #1
send "GO SWREG^M"
call Prompt
send "3^M"
@PrevJob = "SWS"
call Prompt
while (#SwNum == "")
input "シェアウェア番号を入力して下さい。", #SwNum
if (cancel) return
endwhile
send "2^M"
SwSokinLoop:
loopswitch
case "送金システム (1:シェアウェア番号指定 2:作者ID指定 3:送金代行"
call Prompt
send "1^M"
case "シェアウェア番号 (改行のみでソフト種別一覧 E:終了)"
call Prompt
send #SwNum + "^M"
case "送金希望 (1:希望する 2:しない E:終了)"
call Prompt
#Msg = "送金するシェアウェアは "
#Msg =#Msg + #SwNum + " で良いですか?"
timeoutquestion #Msg, @@sDisp
if (yes)
send "1^M"
else
send "E^M"
breakloop
endif
case "送金確認 (1:送金する 2:しない)"
call Prompt
#Msg ="送金して良いですか?"
timeoutquestion #Msg, @@sDisp
if (yes)
send "1^M"
else
send "2^M"
breakloop
endif
case "-送金受領-", "今回の送金代行番号は"
breakloop
case "◆該当するシェアウェアはありません◆"
send "E^M"
breakloop
endloop
wait "シェアウェア番号 (改行のみでソフト種別一覧 E:終了)"
call Prompt
send "E^M"
call Prompt
call MainMenuKey
return
CheckSwReg:
switch @@LoginId
case 1
#ChkSwNum = "SwNum1"
#ChkSwLog = "SwLog1"
#ChkLast = ""LastChkSwNum1"
case default
#ChkSwNum = "SwNum0"
#ChkSwLog = "SwLog0"
#ChkLast = "LastChkSwNum0"
endswitch
##n = 1
while (##n < 3)
getini @AppIni, "SwReg", #ChkSwNum + ##n, #SwNum[##n]
getini @AppIni, "SwReg", #ChkSwLog + ##n, #SwLog[##n]
getini @AppIni, "SwReg", #ChkLast + ##n, #LastChk[##n]
##n = ##n + 1
endwhile
if (#SwNum[1] == "") return
getini @AppIni, "SwReg", "LastCheckDate", #LastCheckDate
getini @AppIni, "SwReg", "SwLogMethod", ##SwLogMtd
send "GO SWREG^M"
call Prompt
@PrevJob = "SWR"
send "3^M"
call Prompt
##n = 0
send "2^M"
loopswitch
case "4:シェアウェア登録・修正申請 5:作者送金代行確認"
call Prompt
##n = ##n + 1
if (#SwNum[##n] == "" or ##n > 2)
send "E^M"
call Prompt
breakloop
else
send "5^M"
endif
case "SW番号 作者ID 作者名 金額(\) シェアウェア名"
call Prompt
send #SwNum[##n] + "^M"
case "検索開始月日 (例: 0801 8月 1日分検索 2カ月前まで検索可)"
call Prompt
send #LastCheckDate + "^M"
case "検索終了月日 (例: 0801 8月 1日分検索 2カ月前まで検索可)"
call Prompt
send "^M"
if (##SwLogMtd == 1) call LogStart #SwLog[##n]
case "月日 時間 金額(\) ID 送金者名"
call Prompt
if (##SwLogMtd == 0)
elseif (##SwLogMtd == 1)
call DefaultLogStart
call LogAppend #SwLog[##n]
else
##i = 1
beginloop
readbuffer ##i, #buf
if (part(#buf, 0, 4) == "月日") breakloop
##i = ##i + 1
endloop
millisleep 1
##i = ##i - 1
beginloop
if (##i == 0)
call LogAppend #SWRegFile
breakloop
endif
readbuffer ##i, #buf
#SWRegDate = @Yr + "/" + part(#buf, 0, 14) + ","
#SWRegId = part(#buf, 26, 8) + @sRem
#SwRegName = part(#buf, 36, 16)
##j = 14
beginloop
#c1 = part(#SwRegName, ##j , 1)
#c2 = part(#SwRegName, ##j , 2)
if (#c1 == " " or #c2 == " ")
##j = ##j - 2
loopagain
endif
#SwRegName = part(#SwRegName, 0, ##j +2) + ","
breakloop
endloop
#SwRegNumChk = part(#buf, 55, 14)
if (#SwRegNumChk > #LastChk[##n])
#SwRegNum = #SwRegNumChk + ","
#SwRegLine = #SwRegId + #SwRegName
#SwRegLine = #SwRegLine + #SWRegDate + #SwRegNum
if (search(#SwLog[##n], "\") == "")
#SWRegFile = @UpPath + #SwLog[##n]
else
#SWRegFile = #SwLog[##n]
endif
appendfile #SWRegFile
if (no) createfile #SWRegFile
writefile #SWRegFile, #SWRegLine
closefile #SWRegFile
putini @AppIni, "SwReg", #ChkLast + ##n, #SwRegNumChk
endif
##i = ##i - 1
endloop
endif
send "E^M"
case "◆番号又はコマンドを入力して下さい◆", \
"◆データが登録されていません◆"
send "E^M"
; call Prompt
; breakloop
endloop
call DateAdjust 24
#LastCheckDate = part(#return, 2, 4)
putini @AppIni, "SwReg", "LastCheckDate", #LastCheckDate
return
;///// FORUM OPTION CHANGE SUBROUTINE /////
SubForumOption:
#Func = #1
getini @AppIni, @App, "ForumOption", #FoptSet
##Menu = value(part(#FoptSet, 0, 1))
##Page = value(part(#FoptSet, 1, 1))
##Stop = value(part(#FoptSet, 2, 1))
##Read = value(part(#FoptSet, 3, 1))
if (##Menu != 1) ##Menu = 2
if (##Page != 1) ##Page = 2
if (##Stop != 1) ##Stop = 2
if (##Read != 1) ##Read = 2
##i = 1
while (##i < 7)
#FoptNum[##i] = ##i
##i = ##i + 1
endwhile
if (#Func == "PT") #FoptNum[4] = "E"
else #FoptNum[7] = "E"
if (#Func != "")
##Count = 1
send "OPT^M"
else
send "MEMBER^M"
call Prompt
send "7^M"
endif
@PrevJob = "FOP"
loopswitch
case "オプション (1:メニュー表示 2:ページ制御 3:氏名変更"
call Prompt
send #FoptNum[##Count] + "^M"
if (#FoptNum[##Count] == "E") breakloop
##Count = ##Count + 1
case "フォーラム・オプション (1:設定・変更 2:解除 改行のみ終了)"
send "1^M"
case "メニュー表示 (1:行う 2:行わない"
call Prompt
send ##Menu + "^M"
case "ページ制御 (1:行う 2:行わない"
call Prompt
send ##Page + "^M"
case "新氏名の入力"
call Prompt
send @NifHandle + "^M"
case "(1:OK 2:NG)"
call Prompt
send "1^M"
case "登録する会議室番号"
call Prompt
send "^M"
case "会議室発言の読み方 (1:発言番号順 2:ペアレントリンク"
call Prompt
send ##Read + "^M"
case "各発言ごとに停止 (1:停止する 2:しない"
call Prompt
send ##Stop + "^M"
case "確認(1:登録する 2:しない)"
send "1^M"
breakloop
endloop
call Prompt
return
;///// TERMINAL SET CHANGE SUBROUTINE /////
SubTerminalSet:
getini @AppIni, @App, "TermLine",##TermLine
getini @AppIni, @App, "Terminal", #TermSet
##TermControl = value(part(#TermSet, 0, 1))
##TermPage = value(part(#TermSet, 1, 1))
##TermMenu = value(part(#TermSet, 2, 1))
##TermPBreak = value(part(#TermSet, 3, 1))
if (##TermControl != 1) ##TermControl = 2
if (##TermPage != 1) ##TermPage = 2
if (##TermMenu != 1) ##TermMenu = 2
if (##TermPBreak != 1) ##TermPBreak = 2
call MainMenuKey
##Count = 1
send "TERMINAL^M"
@PrevJob = "TRM"
loopswitch
case "^M^J端末設定 (1:画面行数 2:コントロールコード 3:"
call Prompt
if (##Count == 6)
send "E^M"
breakloop
endif
send ##Count + "^M"
##Count = ##Count + 1
case "^J画面行数(9~99"
call Prompt
send ##TermLine + "^M"
case "^Jコントロールコード (1:出力する 2:"
call Prompt
send ##TermControl + "^M"
case "^Jページ制御 (1:行う 2:"
call Prompt
send ##TermPage + "^M"
case "^Jメニュー表示 (1:行う 2:"
call Prompt
send ##TermMenu + "^M"
case "^J改ページ制御 (1:行う 2:"
call Prompt
send ##TermPBreak + "^M"
endloop
call Prompt
return
;///// SEND REACTION SUBROUTINE /////
SendReact:
#SendId = part(search(#1, "-"), 2, 8)
#Msg = "SEND " + #SendId + " 私は、オートパイロット中です。"
#Msg = #Msg + "失礼します。 " + @NifHandle
send "^M"
call Prompt
send #Msg + "^M"
return
;///// ERROR SUBROUTINE /////
ErrorCheck:
switch @@ErrorLevel
case 1
#Msg = "エラーが発生したので電話を切ります。"
goto ErrorHangup
case 2
#Msg = "移動できませんでした"
if (#Name != "") #Msg = #Name + "へ" + #Msg
case 3
#Msg = "会議室へ移動できませんでした"
if (#Name != "") #Msg = #Name + "の" + #Msg
case 4
#Msg = "ライブラリへ移動できませんでした"
if (#Name != "") #Msg = #Name + "の" + #Msg
case 5
#Msg = #File + "のヘッダー形式が不正です"
case 6
#Msg = #File + "の " + #Job + " の形式が不正です"
case 7
#Msg = #File + "の " + #Name
#Msg = #Msg + " のファンクション形式が不正です"
case 8
#Msg = #File + "の " + #Job
#Msg = #Msg + " のパラメータ(" + #p + ")が不正です"
case 9
#Msg = #Data + "がありません"
case 10
#Msg = "コメント先発言がありません"
case 11
#Msg = "登録個数が最大のため登録出来ません"
endswitch
timeoutmessage #Msg, @@sDisp
appendfile @ErrLog
if (no) createfile @ErrLog
writefile @ErrLog, "[" + @Yr + "年" + @Mon + "月" + @Day + "日]"
writefile @ErrLog, #Msg
switch #Section
case "Mes", "Lib", "SRead"
writefile @ErrLog, #ActLine
writefile #File2, "--- " + #Msg + " ---"
beginloop
readfile #File, #Line
if (no)
closefile @ErrLog
@@ErrorLevel = 0
goto GetJobDetail
endif
#Head = part(#line, 0, 1)
if (#Head == "@") breakloop
writefile @ErrLog, #Line
endloop
closefile @ErrLog
@@ErrorLevel = 0
writefile #File2, #Line
goto GetJobParameter
case "FAct"
closefile #File
closefile @ErrLog
@@ErrorLevel = 0
return
case default
closefile @ErrLog
@@ErrorLevel = 0
return
endswitch
ErrorHangup:
timeoutmessage #Msg, 5
hangup
exit