home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PWAACH30.ZIP / AMI-CHAT.PPS < prev    next >
Text File  |  1995-04-09  |  7KB  |  248 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; Description : AMi-X Chat v3.00                                            ;;
  3. ;; Revision    : 4                                                           ;;
  4. ;; Compile     : PPLC v2.00+                                                 ;;
  5. ;; Author      : Timecop [PWA]                                               ;;
  6. ;; Creation    : 12-27-94                                                    ;;
  7. ;; Last update : 04-08-95                                                    ;;
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10. ;.-----------------.
  11. ;| Initializations |
  12. ;`-----------------'
  13.  
  14. boolean  PressedCRSysop
  15. boolean  PressedCRUser
  16. boolean  SysopTyping
  17. boolean  UserTyping
  18. boolean  FoundSpace
  19. boolean  Capture
  20. string   TotText
  21. string   SysText
  22. string   UsrText
  23. string   StMovDn
  24. string   StMovNt
  25. string   RefundYN
  26. string   CaptureYN
  27. string   WhoSTyping
  28. string   Color_Of_Sysops_Text
  29. string   Color_Of_Users_Text
  30. integer  InMovDn(77)
  31. integer  Time_Chat_Activated
  32. integer  Time_Chat_Ended
  33. integer  Refunded_Time
  34. integer  QuantityTokens
  35. integer  QuantityPictures
  36. integer  FinalCount
  37. integer  Length
  38. integer  i
  39.  
  40. ;.-----------.
  41. ;| Procedure |
  42. ;`-----------'
  43.  
  44. savescrn
  45. pageoff
  46. sound 0
  47. startdisp fns
  48. freshline
  49.  
  50. if (!exist(ppepath()+ppename()+".CNF")) then
  51.     Color_Of_SysOps_Text = "@"+"X"+"0"+"2"
  52.     Color_Of_Users_Text  = "@"+"X"+"0"+"5"
  53.     QuantityPictures     = 1
  54.     RefundYN             = "Y"+"E"+"S"
  55.     CaptureYN            = "Y"+"E"+"S"
  56. else
  57.     fopen 1,ppepath()+ppename()+".CNF",o_rd,s_dn
  58.     fget 1,Color_Of_SysOps_Text
  59.     fget 1,Color_Of_Users_Text
  60.     fget 1,QuantityPictures
  61.     fget 1,RefundYN
  62.     fget 1,CaptureYN
  63.     fclose 1
  64. endif
  65.  
  66. dispfile ppepath()+ppename()+"."+string(random(QuantityPictures-1)+1),defs
  67.  
  68. Time_Chat_Activated=time()
  69.  
  70. if (lower(left(CaptureYN,1))="y") then
  71.     fappend 2,ppepath()+"CHATLOG."+string(pcbnode()),o_wr,s_dn
  72.     fputln 2,"Chat initiated with "+upper(u_name())+" on "+string(date())+" at "+string(time())
  73.     fputln 2,""
  74.     Length=77
  75.     Capture=true
  76. else
  77.     Length=79
  78.     redim InMovDn,Length
  79. endif
  80.  
  81. :START
  82. SysText=kinkey()
  83. UsrText=minkey()
  84. if (SysText<>"" & !UserTyping) then
  85.     SysopTyping=true
  86.     WhoSTyping="S>"
  87.     gosub CHECKUP_SYSOP
  88. else
  89.     SysText=""
  90. endif
  91. if (UsrText<>"" & !SysopTyping) then
  92.     UserTyping=true
  93.     WhoSTyping="U>"
  94.     gosub CHECKUP_USER
  95. else
  96.     UsrText=""
  97. endif
  98. goto START
  99.  
  100. :CHECKUP_SYSOP
  101. if (SysText <> chr(27)) then
  102.    if (instr(mask_ascii(),SysText) <> 0) then
  103.        print Color_Of_SysOps_Text,SysText
  104.        TotText = TotText+SysText
  105.    endif
  106.    if (SysText = chr(8) & len(TotText) > 0) then
  107.        backup 1
  108.        print " "
  109.        backup 1
  110.        TotText = left(TotText,len(TotText)-1)
  111.    endif
  112.    if (SysText = chr(13)) then
  113.    if (Capture & !TotText="") then
  114.        fputln 2,WhoSTyping+replacestr(TotText,"@","%")
  115.        PressedCRSysop=false
  116.    endif
  117.    if ((Capture &  TotText="") & !PressedCRSysop) then
  118.        fputln 2,""
  119.        PressedCRSysop=true
  120.    endif
  121.        newline
  122.        FinalCount=0
  123.        FoundSpace=false
  124.        TotText=""
  125.        SysopTyping=false
  126.    endif
  127.    if (len(TotText)=Length) then
  128.    for i=Length to 1 step -1
  129.        InMovDn(i)=asc(mid(TotText,i,1))
  130.    if (InMovDn(i)=32) then
  131.        FinalCount=i
  132.        if (!FoundSpace) FoundSpace=true
  133.        quit
  134.    endif
  135.    next i
  136.        if (FoundSpace) then
  137.        StMovDn=mid(TotText,FinalCount+1,Length-FinalCount)
  138.        StMovNt=mid(TotText,1,FinalCount-1)
  139.        if (Capture) fputln 2,WhoSTyping+replacestr(StMovNt,"@","%")
  140.        backup Length-FinalCount
  141.        clreol
  142.        newline
  143.        TotText=StMovDn
  144.    for i=1 to len(TotText) step 3
  145.        print trim(mid(TotText,i,3)," ")
  146.    next i
  147.        FinalCount=0
  148.        FoundSpace=false
  149.    else
  150.    if (Capture) fputln 2,WhoSTyping+replacestr(TotText,"@","%")
  151.        newline
  152.        FinalCount=0
  153.        FoundSpace=false
  154.        TotText=""
  155.    endif
  156.    endif
  157. else
  158.    goto END
  159. endif
  160. return
  161.  
  162. :CHECKUP_USER
  163. if (instr(mask_ascii(),UsrText) <> 0) then
  164.        print Color_Of_Users_Text,UsrText
  165.        TotText = TotText+UsrText
  166.    endif
  167.    if (UsrText = chr(8) & len(TotText) > 0) then
  168.        backup 1
  169.        print " "
  170.        backup 1
  171.        TotText = left(TotText,len(TotText)-1)
  172.    endif
  173.    if (UsrText = chr(13)) then
  174.    if (Capture & !TotText="") then
  175.        fputln 2,WhoSTyping+replacestr(TotText,"@","%")
  176.        PressedCRUser=false
  177.    endif
  178.    if ((Capture & TotText="") & !PressedCRUser) then
  179.        fputln 2,""
  180.        PressedCRUser=true
  181.    endif
  182.        newline
  183.        FinalCount=0
  184.        FoundSpace=false
  185.        TotText=""
  186.        UserTyping=false
  187.    endif
  188.    if (len(TotText)=Length) then
  189.    for i=Length to 1 step -1
  190.        InMovDn(i)=asc(mid(TotText,i,1))
  191.    if (InMovDn(i)=32) then
  192.        FinalCount=i
  193.        if (!FoundSpace) FoundSpace=true
  194.        quit
  195.    endif
  196.    next i
  197.        if (FoundSpace) then
  198.        StMovDn=mid(TotText,FinalCount+1,Length-FinalCount)
  199.        StMovNt=mid(TotText,1,FinalCount-1)
  200.        if (Capture) fputln 2,WhoSTyping+replacestr(StMovNt,"@","%")
  201.        backup Length-FinalCount
  202.        clreol
  203.        newline
  204.        TotText=StMovDn
  205.    for i=1 to len(TotText) step 3
  206.        print trim(mid(TotText,i,3)," ")
  207.    next i
  208.        FinalCount=0
  209.        FoundSpace=false
  210.    else
  211.    if (Capture) fputln 2,WhoSTyping+replacestr(TotText,"@","%")
  212.        newline
  213.        FinalCount=0
  214.        FoundSpace=false
  215.        TotText=""
  216.    endif
  217.    endif
  218. return
  219.  
  220. :END
  221. if (!TotText="" & Capture) then
  222.     fputln 2,WhoSTyping+replacestr(TotText,"@","%")
  223. else
  224. endif
  225. if (Capture) then
  226.     fputln 2,""
  227.     fputln 2,"Chat ended with "+upper(u_name())+" on "+string(date())+" at "+string(time())
  228.     fputln 2,"──────────────────────────────────────────────────────────────────────────────"
  229.     fclose 2
  230. endif
  231.  
  232. restscrn
  233.  
  234. Time_Chat_Ended=time()
  235.  
  236. if (lower(left(RefundYN,1))="y") then
  237.     Refunded_Time=(Time_Chat_Ended-Time_Chat_Activated)/60
  238. if (Refunded_Time<0) Refunded_Time=Refunded_Time+86400
  239.     adjtime Refunded_Time
  240. endif
  241.  
  242. kbdstuff chr(27)
  243. end
  244.  
  245. ;.----------------------------------------------------------------------------.
  246. ;|                             End Of File.                                   |
  247. ;`----------------------------------------------------------------------------'
  248.