home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
PWAACH30.ZIP
/
AMI-CHAT.PPS
< prev
next >
Wrap
Text File
|
1995-04-09
|
7KB
|
248 lines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Description : AMi-X Chat v3.00 ;;
;; Revision : 4 ;;
;; Compile : PPLC v2.00+ ;;
;; Author : Timecop [PWA] ;;
;; Creation : 12-27-94 ;;
;; Last update : 04-08-95 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;.-----------------.
;| Initializations |
;`-----------------'
boolean PressedCRSysop
boolean PressedCRUser
boolean SysopTyping
boolean UserTyping
boolean FoundSpace
boolean Capture
string TotText
string SysText
string UsrText
string StMovDn
string StMovNt
string RefundYN
string CaptureYN
string WhoSTyping
string Color_Of_Sysops_Text
string Color_Of_Users_Text
integer InMovDn(77)
integer Time_Chat_Activated
integer Time_Chat_Ended
integer Refunded_Time
integer QuantityTokens
integer QuantityPictures
integer FinalCount
integer Length
integer i
;.-----------.
;| Procedure |
;`-----------'
savescrn
pageoff
sound 0
startdisp fns
freshline
if (!exist(ppepath()+ppename()+".CNF")) then
Color_Of_SysOps_Text = "@"+"X"+"0"+"2"
Color_Of_Users_Text = "@"+"X"+"0"+"5"
QuantityPictures = 1
RefundYN = "Y"+"E"+"S"
CaptureYN = "Y"+"E"+"S"
else
fopen 1,ppepath()+ppename()+".CNF",o_rd,s_dn
fget 1,Color_Of_SysOps_Text
fget 1,Color_Of_Users_Text
fget 1,QuantityPictures
fget 1,RefundYN
fget 1,CaptureYN
fclose 1
endif
dispfile ppepath()+ppename()+"."+string(random(QuantityPictures-1)+1),defs
Time_Chat_Activated=time()
if (lower(left(CaptureYN,1))="y") then
fappend 2,ppepath()+"CHATLOG."+string(pcbnode()),o_wr,s_dn
fputln 2,"Chat initiated with "+upper(u_name())+" on "+string(date())+" at "+string(time())
fputln 2,""
Length=77
Capture=true
else
Length=79
redim InMovDn,Length
endif
:START
SysText=kinkey()
UsrText=minkey()
if (SysText<>"" & !UserTyping) then
SysopTyping=true
WhoSTyping="S>"
gosub CHECKUP_SYSOP
else
SysText=""
endif
if (UsrText<>"" & !SysopTyping) then
UserTyping=true
WhoSTyping="U>"
gosub CHECKUP_USER
else
UsrText=""
endif
goto START
:CHECKUP_SYSOP
if (SysText <> chr(27)) then
if (instr(mask_ascii(),SysText) <> 0) then
print Color_Of_SysOps_Text,SysText
TotText = TotText+SysText
endif
if (SysText = chr(8) & len(TotText) > 0) then
backup 1
print " "
backup 1
TotText = left(TotText,len(TotText)-1)
endif
if (SysText = chr(13)) then
if (Capture & !TotText="") then
fputln 2,WhoSTyping+replacestr(TotText,"@","%")
PressedCRSysop=false
endif
if ((Capture & TotText="") & !PressedCRSysop) then
fputln 2,""
PressedCRSysop=true
endif
newline
FinalCount=0
FoundSpace=false
TotText=""
SysopTyping=false
endif
if (len(TotText)=Length) then
for i=Length to 1 step -1
InMovDn(i)=asc(mid(TotText,i,1))
if (InMovDn(i)=32) then
FinalCount=i
if (!FoundSpace) FoundSpace=true
quit
endif
next i
if (FoundSpace) then
StMovDn=mid(TotText,FinalCount+1,Length-FinalCount)
StMovNt=mid(TotText,1,FinalCount-1)
if (Capture) fputln 2,WhoSTyping+replacestr(StMovNt,"@","%")
backup Length-FinalCount
clreol
newline
TotText=StMovDn
for i=1 to len(TotText) step 3
print trim(mid(TotText,i,3)," ")
next i
FinalCount=0
FoundSpace=false
else
if (Capture) fputln 2,WhoSTyping+replacestr(TotText,"@","%")
newline
FinalCount=0
FoundSpace=false
TotText=""
endif
endif
else
goto END
endif
return
:CHECKUP_USER
if (instr(mask_ascii(),UsrText) <> 0) then
print Color_Of_Users_Text,UsrText
TotText = TotText+UsrText
endif
if (UsrText = chr(8) & len(TotText) > 0) then
backup 1
print " "
backup 1
TotText = left(TotText,len(TotText)-1)
endif
if (UsrText = chr(13)) then
if (Capture & !TotText="") then
fputln 2,WhoSTyping+replacestr(TotText,"@","%")
PressedCRUser=false
endif
if ((Capture & TotText="") & !PressedCRUser) then
fputln 2,""
PressedCRUser=true
endif
newline
FinalCount=0
FoundSpace=false
TotText=""
UserTyping=false
endif
if (len(TotText)=Length) then
for i=Length to 1 step -1
InMovDn(i)=asc(mid(TotText,i,1))
if (InMovDn(i)=32) then
FinalCount=i
if (!FoundSpace) FoundSpace=true
quit
endif
next i
if (FoundSpace) then
StMovDn=mid(TotText,FinalCount+1,Length-FinalCount)
StMovNt=mid(TotText,1,FinalCount-1)
if (Capture) fputln 2,WhoSTyping+replacestr(StMovNt,"@","%")
backup Length-FinalCount
clreol
newline
TotText=StMovDn
for i=1 to len(TotText) step 3
print trim(mid(TotText,i,3)," ")
next i
FinalCount=0
FoundSpace=false
else
if (Capture) fputln 2,WhoSTyping+replacestr(TotText,"@","%")
newline
FinalCount=0
FoundSpace=false
TotText=""
endif
endif
return
:END
if (!TotText="" & Capture) then
fputln 2,WhoSTyping+replacestr(TotText,"@","%")
else
endif
if (Capture) then
fputln 2,""
fputln 2,"Chat ended with "+upper(u_name())+" on "+string(date())+" at "+string(time())
fputln 2,"──────────────────────────────────────────────────────────────────────────────"
fclose 2
endif
restscrn
Time_Chat_Ended=time()
if (lower(left(RefundYN,1))="y") then
Refunded_Time=(Time_Chat_Ended-Time_Chat_Activated)/60
if (Refunded_Time<0) Refunded_Time=Refunded_Time+86400
adjtime Refunded_Time
endif
kbdstuff chr(27)
end
;.----------------------------------------------------------------------------.
;| End Of File. |
;`----------------------------------------------------------------------------'