home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
New Horizons Shareware Collection
/
HORIZONS1.BIN
/
TOP.PPE
(
.txt
)
< prev
next >
Wrap
PCBoard Programming Language Executable
|
1995-02-19
|
18KB
|
1,099 lines
;------------------------------------------------------------------------------
; .ss.
; `²²'
; .,sS$Ss,,s$ .,sS$$$Ss. .,sS$Ss,,s$ .ss. .sSs.
; .d$$²^°²$$$$'.d$P²°^^²$P'.d$$²^°²$$$$'.$$$' .$$$²Sb,.
; $$$' .$$$' $$$²Sçsµ²' .$$$' .$$$'.$$$' .$$$' `$$b.
; $$$b,,d$$$' ,$$$b,....,s$$$$b,,d$$$'.$$$;.,$$$' ;$$$
; `²S$$S²²S$$S²°²S$$$$S²°°²S$$$$$$',$$S²°²S$S'.sS$$$P²'
; .sS²°$$$²²°"' d²°'
; .$$² .$$'
; $$$.,d$$'
; `²S$$S²'
;------------------------------------------------------------------------------
; P.P.L.X. 2.OO (C)1996 - Lone Runner / AEGiS CoRP'96
;------------------------------------------------------------------------------
; PPE 3.O1 (Encryption type I) - Analysis ON - Postprocessing ON
;------------------------------------------------------------------------------
Boolean BOOLEAN001
Boolean BOOLEAN002
Boolean BOOLEAN003
Boolean BOOLEAN004
Boolean BOOLEAN005
Boolean BOOLEAN006
Boolean BOOLEAN007
Boolean BOOLEAN008
Boolean BOOLEAN009
Boolean BOOLEAN010
Boolean BOOLEAN011
Boolean BOOLEAN012
Boolean BOOLEAN013
Boolean BOOLEAN014
Boolean BOOLEAN015
Boolean BOOLEAN016
Boolean BOOLEAN017
Boolean BOOLEAN018
Boolean BOOLEAN019
Boolean BOOLEAN020
Date DATE001
Date DATE002
Date DATE003
Date DATE004
Date DATE005
Date DATE006
Integer INTEGER001
Integer INTEGER002
Integer INTEGER003
Integer INTEGER004
Integer INTEGER005
Integer INTEGER006
Integer INTEGER007
Integer INTEGER008
Integer INTEGER009
Integer INTEGER010
Integer INTEGER011
Integer INTEGER012
Integer INTEGER013
Integer INTEGER014
Integer INTEGER015
Integer INTEGER016
Integer INTEGER017
Integer INTEGER018
Integer INTEGER019
Integer INTEGER020
Integer INTEGER021
Integer INTEGER022
Integer INTEGER023
Integer INTEGER024
Integer INTEGER025
Integer INTEGER026
Integer INTEGER029
Integer INTEGER030
Integer TINTEGER031(25)
Integer TINTEGER032(25)
Integer INTEGER033
Integer INTEGER034
Integer INTEGER035
Integer INTEGER036
Integer INTEGER037
Integer INTEGER038
Integer INTEGER039
Integer INTEGER040
Real REAL001
Real REAL002
Real REAL003
Real REAL004
Real REAL005
Real REAL006
Real REAL007
Real REAL008
Real REAL009
String STRING001
String STRING002
String STRING003
String STRING004
String STRING005
String STRING006
String STRING007
String STRING008
String STRING009
String STRING010
String STRING011
String STRING012
String TSTRING013(9)
String STRING014
String STRING015
String STRING016
String STRING017
String STRING018
String STRING019
String STRING020
String STRING021
String STRING022
String STRING023
String STRING024
String STRING025
String STRING026
String STRING027
String TSTRING028(8)
String STRING029
String STRING030
String TSTRING032(25)
String TSTRING033(25)
String STRING034
String STRING036
String STRING037
String STRING038
String STRING045
String STRING046
Int INT001
Int INT002
Int INT003
Int INT004
BigStr TBIGSTR001(8)
Double DOUBLE001
Declare Function FUNCTION001(String STRING047) Boolean
Declare Function FUNCTION002(String STRING035) String
Declare Procedure PROC001(String STRING049)
Declare Procedure PROC002(Var Date DATE007, Var Date DATE008)
Declare Procedure PROC003(String STRING050)
Declare Procedure PROC004()
Declare Procedure PROC005()
Declare Procedure PROC006(String STRING031, Integer INTEGER027, Integer INTEGER028)
Declare Procedure PROC007(String STRING039, String STRING040, String STRING041, String STRING042, String STRING043, String STRING044)
Declare Procedure PROC008(Integer INTEGER041)
;------------------------------------------------------------------------------
STRING014 = PPEPath() + "last"
STRING003 = PPEPath() + "weekbul.dat"
STRING004 = PPEPath() + "weekbdl.dat"
STRING005 = PPEPath() + "weekful.dat"
STRING006 = PPEPath() + "weekfdl.dat"
STRING007 = PPEPath() + "monthbul.dat"
STRING009 = PPEPath() + "monthbdl.dat"
STRING008 = PPEPath() + "monthful.dat"
STRING010 = PPEPath() + "monthfdl.dat"
STRING015 = PPEPath() + "week.tot"
STRING016 = PPEPath() + "month.tot"
STRING012 = PPEPath() + "top.cfg"
STRING011 = PPEPath() + "top." + String(PcbNode())
If (!Exist(STRING011)) End
If (Upper((ReadLine(STRING011, 1) <> U_Name()))) Then
FClose -1
Delete STRING011
End
Endif
FClose -1
FreshLine
PrintLn "@X08[PWA] @X07BlackCat @X08WMTop PPE v1.00.."
PrintLn "@X08Reading exclusion file"
FOpen 1, PPEPath() + "top.exc", 0, 0
FRead 1, STRING017, 2048
If (Ferr(1)) Goto LABEL001
FreshLine
PrintLn "@X07Exclusion string exhausted, no additions possible"
:LABEL001
FClose 1
If (InStr(STRING017, """" + Upper(U_Name()) + """")) Then
PrintLn "@X08User found in exclusion list"
FClose -1
If (Exist(STRING011)) Delete STRING011
End
Endif
STRING023 = ReadLine(PCBDat(), 29)
Tokenize ReadLine(STRING012, 1)
INTEGER008 = GetToken()
If (GetToken() == "YES") Then
BOOLEAN001 = 1
Endif
INTEGER002 = GetToken()
If (GetToken() == "YES") Then
BOOLEAN016 = 1
INT001 = GetToken()
Endif
STRING030 = GetToken()
Tokenize ReadLine(STRING012, 2)
INTEGER009 = GetToken()
If (GetToken() == "YES") Then
BOOLEAN002 = 1
Endif
INTEGER003 = GetToken()
If (GetToken() == "YES") Then
BOOLEAN017 = 1
INT002 = GetToken()
Endif
Tokenize ReadLine(STRING012, 3)
INTEGER004 = ReadLine(STRING012, 12)
If (GetToken() == "YES") Then
BOOLEAN003 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN004 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN005 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN006 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN007 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN008 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN009 = 1
Endif
If (GetToken() == "YES") Then
BOOLEAN010 = 1
Endif
DATE003 = Date()
BOOLEAN011 = 0
STRING002 = PPEPath() + "TOP.DBF"
If (Exist(STRING014)) Then
DATE004 = ReadLine(STRING014, 1)
FClose -1
Else
DATE004 = DATE003
FCreate 1, STRING014, 1, 3
FPutLn 1, DATE003
FClose 1
Endif
If (DATE004 <> DATE003) Then
FCreate 1, STRING014, 1, 3
FPutLn 1, DATE003
FClose 1
Endif
PROC002(DATE001, DATE002)
If (Exist(STRING002)) Then
Gosub LABEL004
Else
Gosub LABEL005
BOOLEAN011 = 1
Endif
If (FUNCTION001(U_Name())) Goto LABEL002
PROC001(U_Name())
Goto LABEL003
:LABEL002
PROC003(U_Name())
:LABEL003
PROC004()
PROC005()
FClose -1
Delete STRING011
End
:LABEL004
DOpen 0, PPEPath() + "TOP", 0
DnOpen 0, PPEPath() + "TOP.NDX"
DTag 0, "top"
Return
:LABEL005
TSTRING013(0) = "name,C,30,0"
TSTRING013(1) = "date,D,10,0"
TSTRING013(2) = "bupw,N,10,0"
TSTRING013(3) = "bupm,N,10,0"
TSTRING013(4) = "fupw,N,10,0"
TSTRING013(5) = "fupm,N,10,0"
TSTRING013(6) = "bdlw,N,10,0"
TSTRING013(7) = "bdlm,N,10,0"
TSTRING013(8) = "fdlw,N,10,0"
TSTRING013(9) = "fdlm,N,10,0"
DCreate 0, PPEPath() + "TOP", 0, TSTRING013(BOOLEAN000)
DnCreate 0, PPEPath() + "TOP.NDX", "name"
DTag 0, "TOP"
Return
End
;------------------------------------------------------------------------------
Procedure PROC006(String STRING031, Integer INTEGER027, Integer INTEGER028)
Boolean BOOLEAN018
Integer INTEGER029
Integer INTEGER030
String TSTRING032(25)
String TSTRING033(25)
String STRING034
Integer TINTEGER031(25)
Integer TINTEGER032(25)
If (Exist(STRING031)) Goto LABEL006
PrintLn "@X08Creating new top data"
FCreate 1, STRING031, 1, 3
STRING034 = U_Name()
FPutLn 1, STRING034
FPutLn 1, String(INTEGER027)
FPutLn 1, String(INTEGER028)
FPutLn 1, U_City
INTEGER010 = 0
For INTEGER017 = 1 To INTEGER004 - 1
FPutLn 1, "NONE"
FPutLn 1, String(INTEGER010)
FPutLn 1, String(INTEGER010)
FPutLn 1, ""
Next
FClose 1
Goto LABEL009
:LABEL006
BOOLEAN018 = 0
INTEGER030 = 0
FOpen 1, STRING031, 0, 0
For INTEGER017 = 1 To INTEGER004
FGet 1, TSTRING032(INTEGER017)
If (TSTRING032(INTEGER017) == Upper(U_Name())) Then
INTEGER030 = INTEGER017
Endif
FGet 1, STRING024
TINTEGER031(INTEGER017) = STRING024
FGet 1, STRING024
TINTEGER032(INTEGER017) = STRING024
If (BOOLEAN018) Goto LABEL007
If (TSTRING032(INTEGER017) == "NONE") Then
INTEGER029 = INTEGER017
BOOLEAN018 = 1
ElseIf (INTEGER027 > TINTEGER031(INTEGER017)) Then
INTEGER029 = INTEGER017
BOOLEAN018 = 1
Endif
:LABEL007
FGet 1, TSTRING033(INTEGER017)
Next
FClose 1
If (BOOLEAN018) If !(INTEGER030 > 0) Goto LABEL008
If (INTEGER030 == INTEGER029) Then
TSTRING032(INTEGER029) = U_Name()
TINTEGER031(INTEGER029) = INTEGER027
TINTEGER032(INTEGER029) = INTEGER028
TSTRING033(INTEGER029) = U_City
Else
For INTEGER018 = INTEGER030 To INTEGER004 - 1
TSTRING032(INTEGER018) = TSTRING032(INTEGER018 + 1)
TINTEGER031(INTEGER018) = TINTEGER031(INTEGER018 + 1)
TINTEGER032(INTEGER018) = TINTEGER032(INTEGER018 + 1)
TSTRING033(INTEGER018) = TSTRING033(INTEGER018 + 1)
Next
If (INTEGER029 > INTEGER030) Dec INTEGER029
For INTEGER018 = INTEGER004 To INTEGER029 + 1 Step -1
TSTRING032(INTEGER018) = TSTRING032(INTEGER018 - 1)
TINTEGER031(INTEGER018) = TINTEGER031(INTEGER018 - 1)
TINTEGER032(INTEGER018) = TINTEGER032(INTEGER018 - 1)
TSTRING033(INTEGER018) = TSTRING033(INTEGER018 - 1)
Next
TSTRING032(INTEGER029) = U_Name()
TINTEGER031(INTEGER029) = INTEGER027
TINTEGER032(INTEGER029) = INTEGER028
TSTRING033(INTEGER029) = U_City
Endif
Goto LABEL009
:LABEL008
For INTEGER018 = INTEGER004 To INTEGER029 + 1 Step -1
TSTRING032(INTEGER018) = TSTRING032(INTEGER018 - 1)
TINTEGER031(INTEGER018) = TINTEGER031(INTEGER018 - 1)
TINTEGER032(INTEGER018) = TINTEGER032(INTEGER018 - 1)
TSTRING033(INTEGER018) = TSTRING033(INTEGER018 - 1)
Next
TSTRING032(INTEGER029) = U_Name()
TINTEGER031(INTEGER029) = INTEGER027
TINTEGER032(INTEGER029) = INTEGER028
TSTRING033(INTEGER029) = U_City
:LABEL009
If (BOOLEAN018) Then
FClose -1
FCreate 1, STRING031, 1, 3
For INTEGER017 = 1 To INTEGER004
FPutLn 1, TSTRING032(INTEGER017)
FPutLn 1, String(TINTEGER031(INTEGER017))
FPutLn 1, String(TINTEGER032(INTEGER017))
FPutLn 1, TSTRING033(INTEGER017)
Next
FClose 1
Endif
EndProc
;------------------------------------------------------------------------------
Function FUNCTION002(String STRING035) String
String STRING037
String STRING038
Int INT003
Int INT004
String STRING039
If (STRING035 == "") Then
FUNCTION002 = ""
Return
Endif
STRING037 = STRING035
If (Len(STRING037) <= 3) Then
FUNCTION002 = STRING037
Else
STRING038 = ""
INT004 = Len(STRING037) % 3
If (INT004) STRING038 = Left(STRING037, INT004) + STRING030
INTEGER007 = Len(STRING037) / 3
For INT003 = 0 To INTEGER007 - 1
If (INT003) Then
STRING038 = STRING038 + STRING030 + Mid(STRING037, INT003 * 3 + INT004 + 1, 3)
Continue
Endif
STRING038 = STRING038 + Mid(STRING037, INT003 * 3 + INT004 + 1, 3)
Next
FUNCTION002 = STRING038
Endif
EndFunc
;------------------------------------------------------------------------------
Procedure PROC007(String STRING039, String STRING040, String STRING041, String STRING042, String STRING043, String STRING044)
String STRING045
String STRING046
Date DATE005
Integer INTEGER033
Integer INTEGER034
Boolean BOOLEAN019
FCreate 1, STRING039, 1, 3
Select Case (STRING044)
Case "weeklyu"
STRING045 = ReadLine(STRING015, 1)
STRING046 = ReadLine(STRING015, 3)
DATE005 = DATE001
INTEGER033 = INTEGER023
BOOLEAN019 = 1
INTEGER034 = INT001
Case "weeklyd"
STRING045 = ReadLine(STRING015, 2)
STRING046 = ReadLine(STRING015, 4)
DATE005 = DATE001
INTEGER033 = INTEGER023
Case "monthlyu"
STRING045 = ReadLine(STRING016, 1)
STRING046 = ReadLine(STRING016, 3)
DATE005 = DATE002
INTEGER033 = INTEGER024
BOOLEAN019 = 1
INTEGER034 = INT002
Case "monthlyd"
STRING045 = ReadLine(STRING016, 2)
STRING046 = ReadLine(STRING016, 4)
DATE005 = DATE002
INTEGER033 = INTEGER024
End Select
FOpen 2, STRING042, 0, 0
FGet 2, STRING018
:LABEL010
If (Ferr(2)) Goto LABEL011
If (BOOLEAN019) Then
STRING018 = ReplaceStr(STRING018, "%PERCENT%", String(INTEGER034))
Endif
FPutLn 1, STRING018
FGet 2, STRING018
Goto LABEL010
:LABEL011
FClose 2
FOpen 2, STRING040, 0, 0
For INTEGER017 = 1 To INTEGER004
FGet 2, STRING019
FGet 2, STRING024
STRING020 = STRING024
FGet 2, STRING024
STRING021 = STRING024
FGet 2, STRING022
If (STRING019 == "NONE") Then
STRING019 = ""
STRING020 = ""
STRING021 = ""
Endif
STRING018 = STRING041
STRING018 = ReplaceStr(STRING018, "%NR%", String(INTEGER017))
STRING018 = ReplaceStr(STRING018, "%NAME%", Mixed(STRING019))
STRING018 = ReplaceStr(STRING018, "%FIRST%", FUNCTION002(STRING020))
STRING018 = ReplaceStr(STRING018, "%SECOND%", FUNCTION002(STRING021))
STRING018 = ReplaceStr(STRING018, "%LOC%", Mixed(STRING022))
FPutLn 1, STRING018
Next
FClose 2
FOpen 2, STRING043, 0, 0
FGet 2, STRING018
STRING045 = FUNCTION002(STRING045)
STRING046 = FUNCTION002(STRING046)
:LABEL012
If (Ferr(2)) Goto LABEL013
STRING018 = ReplaceStr(STRING018, "%SDATE%", String(Replace(DATE005, "-", "/")))
STRING018 = ReplaceStr(STRING018, "%EDATE%", String(Replace(DATE003, "-", "/")))
STRING018 = ReplaceStr(STRING018, "%TFIRST%", STRING045)
STRING018 = ReplaceStr(STRING018, "%TSECOND%", STRING046)
STRING018 = ReplaceStr(STRING018, "%DAY%", String(INTEGER033))
If (BOOLEAN019) Then
STRING018 = ReplaceStr(STRING018, "%PERCENT%", String(INTEGER034))
Endif
FPutLn 1, STRING018
FGet 2, STRING018
Goto LABEL012
:LABEL013
FClose 2
FClose 1
EndProc
;------------------------------------------------------------------------------
Procedure PROC005()
If (BOOLEAN012 && BOOLEAN003) Then
PrintLn "@X07Writing weekly uploaders bulletin (bytes)"
PROC007(PPEPath() + "wbulblt", STRING003, ReadLine(STRING012, 4), PPEPath() + "graph\wbulhdr", PPEPath() + "graph\wbulftr", "weeklyu")
Endif
If (BOOLEAN013 && BOOLEAN005) Then
PrintLn "@X07Writing weekly downloaders bulletin (bytes)"
PROC007(PPEPath() + "wbdlblt", STRING004, ReadLine(STRING012, 6), PPEPath() + "graph\wbdlhdr", PPEPath() + "graph\wbdlftr", "weeklyd")
Endif
If (BOOLEAN014 && BOOLEAN004) Then
PrintLn "@X07Writing weekly uploaders bulletin (files)"
PROC007(PPEPath() + "wfulblt", STRING005, ReadLine(STRING012, 5), PPEPath() + "graph\wfulhdr", PPEPath() + "graph\wfulftr", "weeklyu")
Endif
If (BOOLEAN015 && BOOLEAN006) Then
PrintLn "@X07Writing weekly downloaders bulletin (files)"
PROC007(PPEPath() + "wfdlblt", STRING006, ReadLine(STRING012, 7), PPEPath() + "graph\wfdlhdr", PPEPath() + "graph\wfdlftr", "weeklyd")
Endif
If (BOOLEAN012 && BOOLEAN007) Then
PrintLn "@X07Writing monthly uploaders bulletin (bytes)"
PROC007(PPEPath() + "mbulblt", STRING007, ReadLine(STRING012, 8), PPEPath() + "graph\mbulhdr", PPEPath() + "graph\mbulftr", "monthlyu")
Endif
If (BOOLEAN013 && BOOLEAN009) Then
PrintLn "@X07Writing monthly downloaders bulletin (bytes)"
PROC007(PPEPath() + "mbdlblt", STRING009, ReadLine(STRING012, 10), PPEPath() + "graph\mbdlhdr", PPEPath() + "graph\mbdlftr", "monthlyd")
Endif
If (BOOLEAN014 && BOOLEAN008) Then
PrintLn "@X07Writing monthly uploaders bulletin (files)"
PROC007(PPEPath() + "mfulblt", STRING008, ReadLine(STRING012, 9), PPEPath() + "graph\mfulhdr", PPEPath() + "graph\mfulftr", "monthlyu")
Endif
If (BOOLEAN015 && BOOLEAN010) Then
PrintLn "@X07Writing monthly downloaders bulletin (bytes)"
PROC007(PPEPath() + "mfdlblt", STRING010, ReadLine(STRING012, 11), PPEPath() + "graph\mfdlhdr", PPEPath() + "graph\mfdlftr", "monthlyd")
Endif
EndProc
;------------------------------------------------------------------------------
Procedure PROC004()
If (BOOLEAN012 && BOOLEAN003) PROC006(STRING003, INTEGER013, INTEGER015)
If (BOOLEAN013 && BOOLEAN005) PROC006(STRING004, INTEGER014, INTEGER016)
If (BOOLEAN012 && BOOLEAN007) PROC006(STRING007, INTEGER019, INTEGER021)
If (BOOLEAN013 && BOOLEAN009) PROC006(STRING009, INTEGER020, INTEGER022)
If (BOOLEAN014 && BOOLEAN004) PROC006(STRING005, INTEGER015, INTEGER013)
If (BOOLEAN015 && BOOLEAN006) PROC006(STRING006, INTEGER016, INTEGER014)
If (BOOLEAN014 && BOOLEAN008) PROC006(STRING008, INTEGER021, INTEGER019)
If (BOOLEAN015 && BOOLEAN010) PROC006(STRING010, INTEGER022, INTEGER020)
EndProc
;------------------------------------------------------------------------------
Function FUNCTION001(String STRING047) Boolean
String STRING048
String STRING049
FreshLine
If (BOOLEAN011) FUNCTION001 = 0
If (DSeek(0, STRING047)) Goto LABEL014
FUNCTION001 = 0
Return
:LABEL014
DGet 0, "name", STRING048
If (RTrim(STRING048, " ") == STRING047) Then
PrintLn "@X07User found"
FUNCTION001 = 1
Return
Endif
PrintLn "@X07User NOT found"
FUNCTION001 = 0
Return
EndFunc
;------------------------------------------------------------------------------
Procedure PROC001(String STRING049)
PutUser
GetUser
INTEGER007 = ReadLine(STRING011, 2)
INTEGER005 = U_Bul() - INTEGER007
If (INTEGER005 > 0) BOOLEAN012 = 1
INTEGER007 = ReadLine(STRING011, 3)
INTEGER006 = 0
INTEGER006 = U_Bdl() - INTEGER007
If (INTEGER006 > 0) BOOLEAN013 = 1
INTEGER007 = ReadLine(STRING011, 4)
INTEGER011 = U_Ful() - INTEGER007
If (INTEGER011 > 0) BOOLEAN014 = 1
INTEGER007 = ReadLine(STRING011, 5)
INTEGER012 = U_Fdl() - INTEGER007
If (INTEGER012 > 0) BOOLEAN015 = 1
If (((BOOLEAN012 || BOOLEAN013) || BOOLEAN014) || BOOLEAN015) Then
PrintLn "@X07Adding NEW user to database"
DNew 0
DPut 0, "name", STRING049
DPut 0, "date", DATE003
DPut 0, "bupw", INTEGER005
DPut 0, "bdlw", INTEGER006
DPut 0, "fupw", INTEGER011
DPut 0, "fdlw", INTEGER012
DPut 0, "bupm", INTEGER005
DPut 0, "bdlm", INTEGER006
DPut 0, "fupm", INTEGER011
DPut 0, "fdlm", INTEGER012
DAdd 0
INTEGER013 = INTEGER005
INTEGER014 = INTEGER006
INTEGER015 = INTEGER011
INTEGER016 = INTEGER012
INTEGER019 = INTEGER005
INTEGER020 = INTEGER006
INTEGER021 = INTEGER011
INTEGER022 = INTEGER012
REAL001 = ToReal(INTEGER005) + ReadLine(STRING015, 1)
REAL002 = ToReal(INTEGER006) + ReadLine(STRING015, 2)
REAL003 = ToReal(INTEGER011) + ReadLine(STRING015, 3)
REAL004 = ToReal(INTEGER012) + ReadLine(STRING015, 4)
REAL005 = ToReal(INTEGER005) + ReadLine(STRING016, 1)
REAL006 = ToReal(INTEGER006) + ReadLine(STRING016, 2)
REAL007 = ToReal(INTEGER011) + ReadLine(STRING016, 3)
REAL008 = ToReal(INTEGER012) + ReadLine(STRING016, 4)
FClose -1
FCreate 1, STRING015, 2, 0
FPutLn 1, REAL001
FPutLn 1, REAL002
FPutLn 1, REAL003
FPutLn 1, REAL004
FClose 1
FCreate 1, STRING016, 2, 0
FPutLn 1, REAL005
FPutLn 1, REAL006
FPutLn 1, REAL007
FPutLn 1, REAL008
FClose 1
Endif
EndProc
;------------------------------------------------------------------------------
Procedure PROC003(String STRING050)
Date DATE006
Integer INTEGER035
Integer INTEGER036
Integer INTEGER037
PrintLn "@X07Updating user in database"
PutUser
GetUser
INTEGER007 = ReadLine(STRING011, 2)
INTEGER005 = U_Bul() - INTEGER007
If (INTEGER005 > 0) BOOLEAN012 = 1
INTEGER007 = ReadLine(STRING011, 3)
INTEGER006 = 0
INTEGER006 = U_Bdl() - INTEGER007
If (INTEGER006 > 0) BOOLEAN013 = 1
INTEGER007 = ReadLine(STRING011, 4)
INTEGER011 = U_Ful() - INTEGER007
If (INTEGER011 > 0) BOOLEAN014 = 1
INTEGER007 = ReadLine(STRING011, 5)
INTEGER012 = U_Fdl() - INTEGER007
If (INTEGER012 > 0) BOOLEAN015 = 1
If (((BOOLEAN012 || BOOLEAN013) || BOOLEAN014) || BOOLEAN015) Then
DGet 0, "date", DATE006
DGet 0, "date", STRING018
INTEGER035 = Left(STRING018, 4)
INTEGER036 = Mid(STRING018, 5, 2)
INTEGER037 = Mid(STRING018, 7, 2)
DATE006 = MkDate(INTEGER035, INTEGER036, INTEGER037)
If (DATE006 >= DATE001) Then
DGet 0, "bupw", INTEGER013
INTEGER013 = INTEGER013 + INTEGER005
DGet 0, "bdlw", INTEGER014
INTEGER014 = INTEGER014 + INTEGER006
DGet 0, "fupw", INTEGER015
INTEGER015 = INTEGER015 + INTEGER011
DGet 0, "fdlw", INTEGER016
INTEGER016 = INTEGER016 + INTEGER012
Goto LABEL015
Endif
INTEGER013 = INTEGER005
INTEGER014 = INTEGER006
INTEGER015 = INTEGER011
INTEGER016 = INTEGER012
:LABEL015
If (DATE006 >= DATE002) Then
DGet 0, "bupm", INTEGER019
INTEGER019 = INTEGER019 + INTEGER005
DGet 0, "bdlm", INTEGER020
INTEGER020 = INTEGER020 + INTEGER006
DGet 0, "fupm", INTEGER021
INTEGER021 = INTEGER021 + INTEGER011
DGet 0, "fdlm", INTEGER022
INTEGER022 = INTEGER022 + INTEGER012
Goto LABEL016
Endif
INTEGER019 = INTEGER005
INTEGER020 = INTEGER006
INTEGER021 = INTEGER011
INTEGER022 = INTEGER012
:LABEL016
DPut 0, "name", STRING050
DPut 0, "date", DATE003
DPut 0, "bupw", INTEGER013
DPut 0, "bdlw", INTEGER014
DPut 0, "fupw", INTEGER015
DPut 0, "fdlw", INTEGER016
DPut 0, "bupm", INTEGER019
DPut 0, "bdlm", INTEGER020
DPut 0, "fupm", INTEGER021
DPut 0, "fdlm", INTEGER022
REAL001 = ToReal(INTEGER005) + ReadLine(STRING015, 1)
REAL002 = ToReal(INTEGER006) + ReadLine(STRING015, 2)
REAL003 = ToReal(INTEGER011) + ReadLine(STRING015, 3)
REAL004 = ToReal(INTEGER012) + ReadLine(STRING015, 4)
REAL005 = ToReal(INTEGER005) + ReadLine(STRING016, 1)
REAL006 = ToReal(INTEGER006) + ReadLine(STRING016, 2)
REAL007 = ToReal(INTEGER011) + ReadLine(STRING016, 3)
REAL008 = ToReal(INTEGER012) + ReadLine(STRING016, 4)
FClose -1
FCreate 1, STRING015, 2, 0
FPutLn 1, REAL001
FPutLn 1, REAL002
FPutLn 1, REAL003
FPutLn 1, REAL004
FClose 1
FCreate 1, STRING016, 2, 0
FPutLn 1, REAL005
FPutLn 1, REAL006
FPutLn 1, REAL007
FPutLn 1, REAL008
FClose 1
Endif
EndProc
;------------------------------------------------------------------------------
Procedure PROC002(Var Date DATE007, Var Date DATE008)
Integer INTEGER038
Integer INTEGER039
Integer INTEGER040
INTEGER038 = INTEGER008
INTEGER040 = Dow(DATE003)
If (INTEGER040 >= INTEGER038) INTEGER039 = INTEGER040 - INTEGER038
If (INTEGER040 < INTEGER038) Then
INTEGER039 = 6 - INTEGER038
INTEGER039 = INTEGER039 + INTEGER040
Endif
DATE007 = ToInteger(DATE003) - INTEGER039
INTEGER023 = INTEGER039 + 1
If (DATE004 < DATE007) Then
If (Exist(PPEPath() + "weekbul.dat")) Then
If (BOOLEAN016) Then
Goto LABEL019
Endif
Endif
:LABEL017
If (BOOLEAN001 && Exist(PPEPath() + "wbulblt")) Then
FReAltUser
Message INTEGER002, "ALL", Upper("SYSOP"), "Top Monthly UPLOADER", "N", 0, 0, 0, PPEPath() + "wbulblt"
Endif
PrintLn "@X07Deleting week top data"
FClose -1
Delete PPEPath() + "weekbul.dat"
Delete PPEPath() + "weekbdl.dat"
Delete PPEPath() + "weekful.dat"
Delete PPEPath() + "weekfdl.dat"
Delete STRING015
Endif
INTEGER038 = INTEGER009
INTEGER040 = Day(DATE003)
If (INTEGER040 >= INTEGER038) INTEGER039 = INTEGER040 - INTEGER038
If (INTEGER040 < INTEGER038) Then
INTEGER039 = 31 - INTEGER038
INTEGER039 = INTEGER039 + INTEGER040
Endif
DATE008 = ToInteger(DATE003) - INTEGER039
INTEGER024 = INTEGER039 + 1
If (DATE004 < DATE008) Then
If (Exist(PPEPath() + "monthbul.dat")) Then
If (BOOLEAN017) Then
Goto LABEL023
Endif
Endif
:LABEL018
If (BOOLEAN002 && Exist(PPEPath() + "mbulblt")) Then
FReAltUser
Message INTEGER003, "ALL", Upper("SYSOP"), "Top Monthly UPLOADER", "N", 0, 0, 0, PPEPath() + "mbulblt"
Endif
PrintLn "@X07Deleting month top data"
Delete PPEPath() + "monthbul.dat"
Delete PPEPath() + "monthbdl.dat"
Delete PPEPath() + "monthful.dat"
Delete PPEPath() + "monthfdl.dat"
Delete STRING016
Endif
Return
:LABEL019
FOpen 1, PPEPath() + "weekbul.dat", 0, 0
FGet 1, STRING001
FGet 1, STRING024
INTEGER001 = STRING024
FClose 1
REAL009 = ToInteger((ToReal(INT001) / 100) * ToReal(INTEGER001))
FOpen 1, PPEPath() + "weekmsg", 0, 0
FOpen 2, PPEPath() + "mtmp" + String(PcbNode()), 1, 0
FGet 1, STRING018
:LABEL020
If (Ferr(1)) Goto LABEL021
STRING018 = ReplaceStr(STRING018, "@PERCENT@", String(INT001))
STRING018 = ReplaceStr(STRING018, "@TBYTES@", String(INTEGER001))
STRING018 = ReplaceStr(STRING018, "@ABYTES@", String(REAL009))
FPutLn 2, STRING018
FGet 1, STRING018
Goto LABEL020
:LABEL021
FClose 1
FClose 2
FReAltUser
Message INTEGER002, Upper(STRING001), Upper("SYSOP"), "Top Weekly UPLOADER", "N", 0, 0, 0, PPEPath() + "mtmp" + String(PcbNode())
Delete PPEPath() + "mtmp" + String(PcbNode())
INTEGER007 = U_RecNum(Upper(STRING001))
If (INTEGER007 == -1) Then
PrintLn "ERROR, cannot find user: ", STRING001, " Please inform your sysop!"
Else
GetAltUser INTEGER007
INTEGER010 = U_Bul()
PROC008(REAL009)
GetAltUser INTEGER007
If (U_Bul() == INTEGER010) Then
PrintLn "BYTES NOT CHANGED!!! USER STILL ONLINE??"
Goto LABEL022
Endif
:LABEL022
GetUser
Endif
Goto LABEL017
:LABEL023
FOpen 1, PPEPath() + "monthbul.dat", 0, 0
FGet 1, STRING001
FGet 1, STRING024
INTEGER001 = STRING024
FClose 1
REAL009 = ToInteger((ToReal(INT002) / 100) * ToReal(INTEGER001))
FOpen 1, PPEPath() + "monthmsg", 0, 0
FOpen 2, PPEPath() + "mtmp" + String(PcbNode()), 1, 0
FGet 1, STRING018
:LABEL024
If (Ferr(1)) Goto LABEL025
STRING018 = ReplaceStr(STRING018, "@PERCENT@", String(INT002))
STRING018 = ReplaceStr(STRING018, "@TBYTES@", String(INTEGER001))
STRING018 = ReplaceStr(STRING018, "@ABYTES@", String(REAL009))
FPutLn 2, STRING018
FGet 1, STRING018
Goto LABEL024
:LABEL025
FClose 1
FClose 2
FReAltUser
Message INTEGER003, Upper(STRING001), Upper("SYSOP"), "Top Monthly UPLOADER", "N", 0, 0, 0, PPEPath() + "mtmp" + String(PcbNode())
Delete PPEPath() + "mtmp" + String(PcbNode())
INTEGER007 = U_RecNum(Upper(STRING001))
If (INTEGER007 == -1) Then
PrintLn "ERROR, cannot find user: ", STRING001, " Please inform your sysop!"
Else
GetAltUser INTEGER007
INTEGER010 = U_Bul()
PROC008(REAL009)
GetAltUser INTEGER007
If (U_Bul() == INTEGER010) Then
PrintLn "BYTES NOT CHANGED!!! USER STILL ONLINE??"
Else
PrintLn "@X07Old uploaded bytes : ", String(INTEGER010)
PrintLn "@X07New uploaded bytes : ", String(U_Bul())
Endif
GetUser
Endif
Goto LABEL018
EndProc
;------------------------------------------------------------------------------
Procedure PROC008(Integer INTEGER041)
STRING025 = U_Bul() + INTEGER041
STRING029 = U_Bul() + INTEGER041
If (STRING029 <> "") Goto LABEL026
PrintLn "No input"
End
:LABEL026
DOUBLE001 = STRING029
If (DOUBLE001 < -999999999) DOUBLE001 = -999999999
If (DOUBLE001 > DOUBLE001) DOUBLE001 = DOUBLE001
STRING025 = DOUBLE001
STRING026 = "0"
If (DOUBLE001 < 0) Then
STRING026 = "1"
DOUBLE001 = -DOUBLE001
Endif
STRING027 = I2S(DOUBLE001, 2)
INTEGER025 = Len(STRING027) - 1 + 129
TBIGSTR001(8) = Chr(INTEGER025)
STRING027 = Left(Right(STRING027, Len(STRING027) - 1) + "00000000000000000000000000000000000000000000000000000000000000000", 55)
TSTRING028(7) = STRING026 + Left(STRING027, 7)
STRING027 = Right(STRING027, Len(STRING027) - 7)
For INTEGER026 = -6 To -1
TSTRING028(-INTEGER026) = Left(STRING027, 8)
STRING027 = Right(STRING027, Len(STRING027) - 8)
Next
For INTEGER026 = 1 To 7
TBIGSTR001(INTEGER026) = Chr(S2I(TSTRING028(INTEGER026), 2))
Next
FOpen 4, STRING023, 2, 0
FSeek 4, (U_RecNum(U_Name()) - 1) * 400 + 216, 0
For INTEGER026 = 1 To 8
FWrite 4, TBIGSTR001(INTEGER026), 1
Next
FClose 4
EndProc
;------------------------------------------------------------------------------
;
; Usage report (before postprocessing)
;
; ■ Statements used :
;
; 6 End
; 120 Goto
; 277 Let
; 26 PrintLn
; 108 If
; 9 FCreate
; 12 FOpen
; 30 FClose
; 20 FGet
; 35 FPutLn
; 4 GetUser
; 2 PutUser
; 15 Delete
; 2 Gosub
; 7 Return
; 1 Dec
; 3 Tokenize
; 3 FreshLine
; 4 Message
; 1 FSeek
; 1 FRead
; 1 FWrite
; 4 GetAltUser
; 4 FReAltUser
; 8 EndProc
; 2 EndFunc
; 1 DCreate
; 1 DOpen
; 1 DnCreate
; 1 DnOpen
; 1 DNew
; 1 DAdd
; 2 DTag
; 11 DGet
; 20 DPut
;
;
; ■ Functions used :
;
; 24 -
; 5 *
; 3 /
; 1 %
; 137 +
; 33 -
; 26 ==
; 3 <>
; 17 <
; 12 <=
; 12 >
; 26 >=
; 83 !
; 40 &&
; 17 ||
; 7 Len(
; 11 Upper()
; 4 Mid()
; 5 Left()
; 3 Right()
; 5 Ferr()
; 2 Chr()
; 1 InStr()
; 1 RTrim()
; 1 Date()
; 11 U_Name()
; 2 U_Ful()
; 2 U_Fdl()
; 2 U_Bdl()
; 9 U_Bul()
; 1 Day()
; 1 Dow()
; 2 Replace()
; 27 String()
; 1 PCBDat()
; 67 PPEPath()
; 7 PcbNode()
; 47 ReadLine()
; 19 GetToken()
; 9 Exist()
; 1 I2S()
; 1 S2I()
; 1 MkDate()
; 3 U_RecNum()
; 18 ReplaceStr()
; 4 ToInteger()
; 20 ToReal()
; 2 Mixed()
; 1 DSeek()
;
;------------------------------------------------------------------------------
;
; Analysis flags : WRd
;
; W - Write user ■ 5
; Program writes a user record. Although this may be normal for a
; User Editor, it may also be a way to modify an account level.
; ■ Search for : PUTUSER
;
; R - Read user ■ 5
; User records are read, this may signify that someone wants to get
; various informations about a user (for example his password), but
; this may also be normal for a program accessing user records (for
; example a User Editor)
; ■ Search for : GETALTUSER
;
; d - Access PCBOARD.DAT ■ 2
; Program gets the full pathname to PCBOARD.DAT, this may be usefull
; for many PPE so they can find various informations on the system
; (system paths, max number of lines in messages, ...) but it may also
; be a way to gather vital informations.
; ■ Search for : PCBDAT()
;
;------------------------------------------------------------------------------
;
; Postprocessing report
;
; 11 For/Next
; 0 While/EndWhile
; 56 If/Then or If/Then/Else
; 1 Select Case
;
;------------------------------------------------------------------------------
; AEGiS Corp - Break the routines, code against the machines!
;------------------------------------------------------------------------------