home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / PPE / PAIN / CNC_CHAT.ZIP / CNCCHAT!.PPS < prev    next >
Encoding:
Text File  |  1995-06-11  |  4.3 KB  |  245 lines

  1. ;                           -------------------------
  2. ;                            TYGER's CNC-CHAT! V1.0ß
  3. ;                           -------------------------
  4. ;
  5. ;                            (C)1995 TYGER/PAiN!-CNC
  6. ;
  7. ;
  8. ; Do not modify and re-distribute!
  9. ;
  10.  
  11. string u,ss,s,rr,is(25),iu(25),qs(25),dl,scl,ucl,ti,da
  12. integer r,mx,i,o,sx,sy,sxl,syl,ux,uy,uxl,uyl,csx,csy,cux,cuy,cu,cs
  13. boolean sys,ex
  14.  
  15. ansipos 1,23
  16. savescrn
  17. if (exist(ppepath()+"cncchat."+i2s(pcbnode(),10))) then
  18. fappend 2,ppepath()+"cncchat."+i2s(pcbnode(),10),o_wr,s_dn
  19. else
  20. fopen 2,ppepath()+"cncchat."+i2s(pcbnode(),10),o_wr,s_dn
  21. endif
  22. ti=time()
  23. getuser
  24. fputln 2
  25. fputln 2,"USER       : "+u_name()
  26. fputln 2,"L0CATi0N   : "+u_city()
  27. fputln 2
  28. let da=date()
  29. fputln 2,"DATE       : "+da
  30. fputln 2,"STARTED AT : "+ti
  31. fputln 2,"──────────────────────────────────────────────────────────────────────────────"
  32.  
  33. let mx=s2i(left(readline(ppepath()+"cncchat!.cfg",1),1),10)
  34. let ss=upper(left(readline(ppepath()+"cncchat!.cfg",2),1))
  35. let ex=(upper(left(readline(ppepath()+"cncchat!.cfg",3),1))="Y")
  36. let dl="                                                                                "
  37. if (ss="Y") then
  38. let rr=i2s(random(mx-1)+1,10)
  39. endif
  40. if (ss<>"Y") let rr=ss
  41. :res
  42. print "@CLS@@POFF@"
  43. dispfile ppepath()+"cncchat"+rr+".pcb",graph
  44. ansipos 1,1
  45. fopen 1,ppepath()+"cncchat"+rr+".cfg",o_rd,s_dn
  46. fget 1,sx
  47. fget 1,sy
  48. fget 1,sxl
  49. fget 1,syl
  50. fget 1,ux
  51. fget 1,uy
  52. fget 1,uxl
  53. fget 1,uyl
  54. fget 1,scl
  55. fget 1,ucl
  56. fclose 1
  57. for i=1 to 23
  58. let iu(i)=""
  59. let is(i)=""
  60. next
  61. let csx=sx
  62. let csy=sy
  63. let cux=ux
  64. let cuy=uy
  65. let cs=1
  66. let cu=1
  67.  
  68. goto lo1
  69.  
  70. :lo3
  71. sys=true
  72. if (len(is(cs))<sxl-sx) then
  73. let is(cs)=is(cs)+s
  74. ansipos csx,csy
  75. print scl+s
  76. inc csx
  77. else
  78. fputln 2,"S : "+is(cs)
  79. inc cs
  80. inc csy
  81. if (csy>syl) then
  82. for i=1 to cs-1
  83. let is(i)=is(i+1)
  84. ansipos sx,sy+i-1
  85. print is(i+1)+left(dl,sxl-sx-len(is(i)))
  86. next
  87. csy=syl
  88. dec cs
  89. endif
  90. let csx=sx
  91. endif
  92. goto lo1
  93.  
  94. :lo4
  95. sys=false
  96. if (len(iu(cu))<uxl-ux) then
  97. let iu(cu)=iu(cu)+u
  98. ansipos cux,cuy
  99. print ucl+u
  100. inc cux
  101. else
  102. fputln 2,"U : "+iu(cu)
  103. inc cu
  104. inc cuy
  105. if (cuy>uyl) then
  106. for i=1 to cu-1
  107. let iu(i)=iu(i+1)
  108. ansipos ux,uy+i-1
  109. print iu(i+1)+left(dl,uxl-ux-len(iu(i)))
  110. next
  111. cuy=uyl
  112. dec cu
  113. endif
  114. let cux=ux
  115. endif
  116. goto lo1
  117.  
  118.  
  119. :lo1
  120. if (sys) ansipos csx,csy
  121. if (!sys) ansipos cux,cuy
  122. :lo2
  123. let s=kinkey()
  124. let u=minkey()
  125. if ((s="")&(u="")) goto lo2
  126. if ((s=chr(27))|((u=chr(27))&(ex))) goto en
  127.  
  128. if (s=chr(9)) then
  129. fputln 2,"** SYS0P CHANGED PiCTURE"
  130. color @X20
  131. ansipos 10,5
  132. sprint "                     "
  133. ansipos 10,6
  134. sprint " USE WHiCH PiCTURE ? "
  135. ansipos 10,7
  136. sprint "                     "
  137. ansipos 10,8
  138. sprint "                     "
  139. ansipos 10,9
  140. sprint "                     "
  141. color @X01
  142. for i=6 to 9
  143. ansipos 9,i
  144. sprint "▐"
  145. next
  146. ansipos 10,10
  147. sprint "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
  148. let r=s2i(rr,10)
  149. :li4
  150. ansipos 16,8
  151. color @X2F
  152. sprint "[ "+i2s(r,10)+" / "+i2s(mx,10)+" ]"
  153. ansipos cux,cuy
  154. :li3
  155. let s=kinkey()
  156. if (s="") goto li3
  157. if (s="UP") then
  158. inc r
  159. if (r>mx) let r=1
  160. goto li4
  161. endif
  162. if (s="DOWN") then
  163. dec r
  164. if (r<1) let r=mx
  165. goto li4
  166. endif
  167. if (s<>chr(13)) goto li3
  168. let rr=i2s(r,10)
  169. color @X01
  170. goto res
  171. endif
  172.  
  173. if (s=chr(8)) then
  174. if (len(is(cs))>0) then
  175. let is(cs)=left(is(cs),len(is(cs))-1)
  176. dec csx
  177. ansipos csx,csy
  178. print "  "
  179. goto lo1
  180. else goto lo1
  181. endif
  182. endif
  183.  
  184. if (u=chr(8)) then
  185. if (len(iu(cu))>0) then
  186. let iu(cu)=left(iu(cu),len(iu(cu))-1)
  187. dec cux
  188. ansipos cux,cuy
  189. print "  "
  190. goto lo1
  191. else goto lo1
  192. endif
  193. endif
  194.  
  195. if (s=chr(13)) then
  196. fputln 2,"S : "+is(cs)
  197. inc cs
  198. inc csy
  199. if (csy>syl) then
  200. for i=1 to cs-1
  201. let is(i)=is(i+1)
  202. ansipos sx,sy+i-1
  203. print is(i+1)+left(dl,sxl-sx-len(is(i)))
  204. next
  205. csy=syl
  206. dec cs
  207. endif
  208. let csx=sx
  209. goto lo1
  210. endif
  211.  
  212. if (u=chr(13)) then
  213. fputln 2,"U :"+iu(cu)
  214. inc cu
  215. inc cuy
  216. if (cuy>uyl) then
  217. for i=1 to cu-1
  218. let iu(i)=iu(i+1)
  219. ansipos ux,uy+i-1
  220. print iu(i+1)+left(dl,uxl-ux-len(iu(i)))
  221. next
  222. cuy=uyl
  223. dec cu
  224. endif
  225. let cux=ux
  226. goto lo1
  227. endif
  228.  
  229. if ((s>=" ")&(len(s)=1)) goto lo3
  230. if ((u>=" ")&(len(u)=1)) goto lo4
  231. goto lo2
  232.  
  233. :en
  234. ti=time()
  235. fputln 2,"──────────────────────────────────────────────────────────────────────────────"
  236. fputln 2,"** CHAT ENDED AT "+ti
  237. fputln 2,"══════════════════════════════════════════════════════════════════════════════"
  238. fclose 2
  239. color @X01
  240. cls
  241. print "@X01 [ V1.0ß (C)TYGER/PAiN!-CNC ]"
  242. delay 20
  243. restscrn
  244. end
  245.