Recently got some old tapes recovered. There I found an old chat program I wrote in QB45 in 1996 (I was 16 years old). I installed Windows XP under Hyper-V to test it out since Windows 8 doesn’t run 16-bit DOS programs. But I wanted to have the executable work on my computer so I searched and found QB64 – compiled just fine under Windows 8.1.
It uses a shared file to store chat. I put it on a shared network drive so we could chat over the network. I was experimenting with IPX at that time, but then Windows and internet came and I went over to VB and TCP/IP. So this was my last app in QB45. Good times. 🙂
Executable and source code here.
The source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 |
DECLARE SUB Help () DECLARE SUB UserUpdIntCh () DECLARE SUB UserSave () DECLARE SUB LogOnFindUser () DECLARE SUB UserNewColor () DECLARE SUB UserMenu () DECLARE SUB LogOn () DECLARE SUB ChatViewLine () DECLARE SUB ChatOff () DECLARE SUB ChatOn () DECLARE SUB ChatFileNumber () DECLARE SUB ChatNewName () DECLARE SUB ChatUpdate () DECLARE SUB ChatSend () DECLARE SUB Chat () DECLARE SUB About () DECLARE SUB RedrawBack () DECLARE SUB GetChoice () DECLARE SUB DialogBox () DECLARE SUB HeadLine () DECLARE SUB DrawMainMenu () DECLARE SUB InitStartUp () COMMON SHARED Name$, Alias$, PWD$, CLR$, UpdInterval, LineNr, UserID, SysOp, Users, Mes, NamAli COMMON SHARED Topic$, Path$, BName$, LineNr$ COMMON SHARED True, False COMMON SHARED MenuItem%, Key$, ReDraw, SendText$, TimeOfReturn, UpdNow, MesSent, ClockShow, Exist, Changed, OldSend$, ErLevel, Att COMMON SHARED DiagX, DiagY, DiagFC, DiagBC, DiagText$ TYPE PI LogDT AS STRING * 21 UNumber AS STRING * 4 UName AS STRING * 20 UAlias AS STRING * 20 UPWD AS STRING * 6 UColor AS STRING * 2 UAlNa AS STRING * 1 UpdInt AS STRING * 1 SysOp AS STRING * 1 END TYPE ' 50 Bytes!!! TYPE FR PCLR AS STRING * 2 PName AS STRING * 20 PLine AS STRING * 60 END TYPE ' 82 Bytes!!! RANDOMIZE TIMER ON ERROR GOTO Er True = 0 False = -1 'UserUpdIntCh '******************************************* IF COMMAND$ = "" THEN Path$ = ".\" ELSE Path$ = COMMAND$ ' Network Path BName$ = "Net-Chat." ' First Name On File Name$ = "" ' User Name Alias$ = "" ' User Alias PWD$ = "" ' User Password SysOp = 0 ' SysOp Level CLR = INT(RND * 14) + 1 ' User Color CLR$ = STRING$(2 - LEN(MID$(STR$(CLR), 2, 2)), "0") + MID$(STR$(CLR), 2, 2) ' In String NamAli = 0 ' Name/Alias, 0=Name, 1=Alias UpdInterval = 3 ' Update Intervall While Chatting LineNr = 0 ' Current Chatting Line UserID = INT(RND * 8765) + 1234 ' Random User Number Always 4 Digit LogOnDate$ = DATE$ + " - " + TIME$ ' Time For FIRST LogOn InitStartUp LogOn ExitAll = False WHILE ExitAll DrawMainMenu IF Key$ = CHR$(27) THEN ExitAll = True COLOR 7, 0 WEND IF NamAli = 1 THEN SWAP Alias$, Name$ SND$ = "99" + Name$ + " Left Net-Chat." SND$ = SND$ + SPACE$(82 - LEN(SND$)) OPEN Path$ + BName$ + "L" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, SND$ CLOSE #1 IF NamAli = 1 THEN SWAP Alias$, Name$ VIEW PRINT 1 TO 25 COLOR 7, 0: CLS COLOR 14, 1: PRINT " Net-Chat v2.0a [Beta] (c) Copyright 1996 By Tedd Hansen " COLOR 7, 0: PRINT PRINT "Program Was Ended Succesfully On User Request." PRINT END Er: ErLevel = 1 RESUME NEXT SUB About HeadLine COLOR 15, 1 LOCATE 6, 1: PRINT STRING$(80, "Í") LOCATE 24, 1: PRINT STRING$(80, "Í") LOCATE 6, 1: PRINT "É" LOCATE 6, 80: PRINT "»" LOCATE 24, 1: PRINT "È" LOCATE 24, 80: PRINT "¼" FOR A = 7 TO 23 LOCATE A, 1: PRINT "º" + STRING$(78, " ") + "º" NEXT A LOCATE 7, 4: PRINT "ABOUT NET-CHAT v2.0a" COLOR 10, 1 LOCATE 10, 4: PRINT "Net-Chat version 2.0 is protected by international copyright laws. " LOCATE 11, 4: PRINT "Please don't copy, modify or distribue this program without permition " LOCATE 12, 4: PRINT "from the author Tedd Hansen! " LOCATE 13, 4: PRINT " " LOCATE 14, 4: PRINT "Net-Chat v2.0 Was designed to work in DOS, Windows 3.x And Windows 95 " LOCATE 15, 4: PRINT "Enviroments. It works in DOS Version 2.10 > 7.00! The author will not " LOCATE 16, 4: PRINT "take any responsibility for any damages caused by this program, or the " LOCATE 17, 4: PRINT "user using it!!! (With Proper Use Nothing Should Go Wrong!) " LOCATE 18, 4: PRINT " " LOCATE 19, 4: PRINT "If you have any suggestions, comments or something like that, " LOCATE 20, 4: PRINT "Feel Free To E-Mail Me: " LOCATE 22, 4: PRINT " " LOCATE 23, 4: PRINT "GOOD LUCK! " GetChoice ReDraw = 1 KeyAccept = True Key$ = "" IF Key$ = CHR$(27) THEN EXIT SUB HeadLine COLOR 15, 1 LOCATE 6, 1: PRINT STRING$(80, "Í") LOCATE 24, 1: PRINT STRING$(80, "Í") LOCATE 6, 1: PRINT "É" LOCATE 6, 80: PRINT "»" LOCATE 24, 1: PRINT "È" LOCATE 24, 80: PRINT "¼" FOR A = 7 TO 23 LOCATE A, 1: PRINT "º" + STRING$(78, " ") + "º" NEXT A LOCATE 7, 4: PRINT "Thanks to:" COLOR 10, 1 LOCATE 10, 4: PRINT " " LOCATE 11, 4: PRINT "All the BETA testers on Skarnes Videreg†ende Skole " LOCATE 12, 4: PRINT "Tedd Hansen" LOCATE 13, 4: PRINT "" LOCATE 14, 4: PRINT "" LOCATE 15, 4: PRINT "" LOCATE 16, 4: PRINT "" LOCATE 17, 4: PRINT "" LOCATE 18, 4: PRINT "" LOCATE 19, 4: PRINT "" LOCATE 20, 4: PRINT "" LOCATE 21, 4: PRINT "" LOCATE 22, 4: PRINT "" COLOR 12, 1 GetChoice ReDraw = 1 KeyAccept = True Key$ = "" END SUB SUB Chat ChatOn OldSend$ = "" WIDTH 80, 25 VIEW PRINT 1 TO 5 COLOR 7, 0: CLS VIEW PRINT 1 TO 25 COLOR 14, 1: PRINT SPACE$(80 * 2) LOCATE 1, 2: PRINT "You Are Currently Attached To Line: ";: COLOR 0, 3: PRINT STRING$(3 - LEN(STR$(LineNr)), "0") + MID$(STR$(LineNr), 2, 2); COLOR 14, 1: PRINT " And The Topic Is: ";: COLOR 0, 3: PRINT Topic$ + STRING$(20 - LEN(Topic$), "°") COLOR 14, 1: LOCATE 2, 2: PRINT "There Are ";: COLOR 0, 3: PRINT STRING$(3 - LEN(MID$(STR$(Users), 2, 3)), "°") + MID$(STR$(Users), 2, 3);: COLOR 14, 1: PRINT " Other Users On This Line Including You." VIEW PRINT 5 TO 25 COLOR 7, 0: CLS ChatUpdate VIEW PRINT 5 TO 25 COLOR 7, 0 TxtPos = 1 UpdNow = INT(TIMER + UpdInterval) DO IF VAL(CLR$) <= 0 OR VAL(CLR$) >= 16 THEN CLR$ = "07" VIEW PRINT 1 TO 25 COLOR 14, 1 LOCATE 1, 2: PRINT "You Are Currently Attached To Line: ";: COLOR 0, 3: PRINT STRING$(3 - LEN(STR$(LineNr)), "0") + MID$(STR$(LineNr), 2, 2); COLOR 14, 1: PRINT " And The Topic Is: ";: COLOR 0, 3: PRINT Topic$ + STRING$(20 - LEN(Topic$), "°") COLOR 14, 1: LOCATE 2, 2: PRINT "There Are "; : COLOR 0, 3: PRINT STRING$(3 - LEN(MID$(STR$(Users), 2, 3)), "°") + MID$(STR$(Users), 2, 3); : COLOR 14, 1: PRINT " Other Users On This Line Including You. Messages Sendt: "; : COLOR 0, 3: PRINT _ STRING$(3 - LEN(MID$(STR$(Mes), 2, 3)), "0") + MID$(STR$(Mes), 2, 3) VIEW PRINT 5 TO 25 LOCATE 25, 1, 0 COLOR VAL(CLR$), 0 PRINT RIGHT$(Name$ + SPACE$(20 - LEN(Name$)) + ": " + SendText$, 79); IF NOT LEN(SendText$) >= 79 THEN PRINT " "; LOCATE 24, 1: COLOR 15, 1: PRINT " Enter Text To Send To Others: <Ù Send ALT+M MENU ESC Exit " COLOR 7, 0 IF LEN(SendText$) = 0 THEN CurPosi = 23 ELSEIF LEN(SendText$) >= 58 THEN CurPosi = 80 ELSE CurPosi = LEN(SendText$) + 23 END IF COLOR 7, 0: LOCATE 25, CurPosi, 1 DO Key$ = INKEY$ 'VIEW PRINT 2 TO 25 'COLOR 14, 1: LOCATE 2, 60, 0: PRINT DATE$ + " - " + TIME$; IF TIMER - 100 > UpdNow THEN ChatUpdate: UpdNow = INT(TIMER + UpdInterval) IF TIMER > UpdNow THEN ChatUpdate: UpdNow = INT(TIMER + UpdInterval) COLOR 7, 0: LOCATE 25, CurPosi, 1 LOOP WHILE Key$ = "" IF LEN(SendText$) >= 1 AND Key$ = CHR$(8) THEN Key$ = "": SendText$ = LEFT$(SendText$, LEN(SendText$) - 1) IF Key$ = CHR$(0) + CHR$(19) THEN SendText$ = OldSend$: Key$ = "": ChatUpdate IF Key$ = CHR$(0) + "." THEN ClockShow = 1: ChatNewName: Key$ = "": ChatUpdate IF Key$ = CHR$(8) THEN Key$ = "" IF Key$ = CHR$(13) AND LEN(SendText$) = 0 THEN Key$ = "": UpdNow = 0: ChatUpdate IF Key$ = CHR$(13) THEN OldSend$ = SendText$: Key$ = "": ChatSend: LOCATE 25, 1, 0: PRINT SPACE$(80);: SendText$ = "": ChatUpdate IF Key$ = CHR$(27) AND LEN(SendText$) = 0 THEN EXIT DO ELSE IF Key$ = CHR$(27) THEN SendText$ = "": Key$ = "": LOCATE 25, 1: PRINT SPACE$(80); IF LEFT$(Key$, 1) = CHR$(0) THEN Key$ = "" IF Key$ = "" THEN Key$ = CHR$(13) X = ASC(Key$) IF NOT Key$ = CHR$(27) THEN IF X <= 31 AND X >= 6 THEN Key$ = "" SendText$ = SendText$ + Key$ SendText$ = LEFT$(SendText$, 138) IF LEN(SendText$) = 58 THEN BEEP LOOP UNTIL EA = 1 ChatOff END SUB SUB ChatFileNumber DiagX = 0 DiagY = 6 DiagFC = 14 DiagBC = 3 DiagText$ = "Change Line To Chat On (Current Line" + STR$(LineNr) + ") [Push ALT+L To View Lines]" DialogBox DiagFC = 15 DiagBC = 3 DiagX = 0 DiagY = 11 DiagText$ = "New Line: " + SPACE$(2) DialogBox DO COLOR 3, 0 LOCATE 12, 46: PRINT NL$ + STRING$(2 - LEN(NL$), "°") DO Key$ = INKEY$ COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ LOOP WHILE Key$ = "" IF Key$ = CHR$(0) + "&" THEN ChatViewLine: EXIT SUB IF Key$ = CHR$(8) AND LEN(NL$) >= 1 THEN NL$ = LEFT$(NL$, LEN(NL$) - 1) IF ASC(Key$) >= 48 AND ASC(Key$) <= 57 THEN NL$ = NL$ + Key$ NL$ = LEFT$(NL$, 2) LOOP UNTIL Key$ = CHR$(27) OR Key$ = CHR$(13) IF Key$ = CHR$(27) THEN EXIT SUB LineNr = VAL(NL$) DiagX = 0 DiagY = 0 DiagFC = 0 DiagBC = 0 DiagText$ = "You Are Now Connected To Line" + STR$(LineNr) DialogBox T = TIMER + 5 DO Key$ = INKEY$ COLOR 15, 1: LOCATE 10, 61, 0: PRINT RIGHT$(DATE$, 1) + " - " + TIME$ IF TIMER > T THEN EXIT DO LOOP WHILE Key$ = "" Key$ = "" END SUB SUB ChatNewName DiagX = 0: DiagY = 6: DiagFC = 14: DiagBC = 3 DiagText$ = "Change The Topic Of The Current Conversation Line (Line" + STR$(LineNr) + ")" DialogBox DiagX = 0: DiagY = 11: DiagFC = 14: DiagBC = 3 DiagText$ = "New Topic: " + SPACE$(20) DialogBox DO COLOR 3, 0 LOCATE 12, 38: PRINT NT$ + STRING$(20 - LEN(NT$), "°") DO Key$ = INKEY$ IF ClockShow = 0 THEN COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ LOOP WHILE Key$ = "" IF Key$ = CHR$(8) AND LEN(NT$) >= 1 THEN NT$ = LEFT$(NT$, LEN(NT$) - 1) OKASCII = 0 IF ASC(Key$) = 134 THEN OKASCII = 1 IF ASC(Key$) = 143 THEN OKASCII = 1 IF ASC(Key$) = 145 THEN OKASCII = 1 IF ASC(Key$) = 146 THEN OKASCII = 1 IF ASC(Key$) = 155 THEN OKASCII = 1 IF ASC(Key$) = 157 THEN OKASCII = 1 IF ASC(Key$) >= 32 AND ASC(Key$) <= 122 OR OKASCII = 1 THEN NT$ = NT$ + Key$ NT$ = LEFT$(NT$, 20) LOOP UNTIL Key$ = CHR$(27) OR Key$ = CHR$(13) IF Key$ = CHR$(27) THEN EXIT SUB OPEN Path$ + BName$ + "LNS" FOR APPEND SHARED AS #1 P = (LineNr * 22) + 22 'NT$ = MID$(STR$(LineNr), 2, 2) + NT$ + SPACE$(22 - LEN(LineNr$ + NT$)) 'PRINT P ' PUT #1, 1, NT$ PRINT #1, STRING$(2 - LEN(MID$(STR$(LineNr), 2, 2)), "0") + MID$(STR$(LineNr), 2, 2) + NT$ + SPACE$(22 - LEN(LineNr$ + NT$)) CLOSE #1 OPEN Path$ + BName$ + "T" + LineNr$ FOR OUTPUT SHARED AS #1 PRINT #1, NT$ CLOSE #1 DiagX = 0 DiagY = 0 DiagFC = 0 DiagBC = 0 DiagText$ = "The Topic Has Been Changed" DialogBox T = TIMER + 5 DO Key$ = INKEY$ IF ClockShow = 0 THEN COLOR 15, 1: LOCATE 10, 58, 0: PRINT RIGHT$(DATE$, 4) + " - " + TIME$ IF TIMER > T THEN EXIT DO LOOP WHILE Key$ = "" Key$ = "" ClockShow = 0 END SUB SUB ChatOff SND$ = "99" + Name$ + " Left This Line." SND$ = SND$ + SPACE$(82 - LEN(SND$)) ' Minus One User On This Line... IF NOT SysOp >= 4 THEN OPEN Path$ + BName$ + "N" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, "000": CLOSE #1 OPEN Path$ + BName$ + "N" + LineNr$ FOR INPUT SHARED AS #1 INPUT #1, Users$: CLOSE #1 Users = VAL(Users$) - 1 IF Users < 0 THEN Users = 0 OPEN Path$ + BName$ + "N" + LineNr$ FOR OUTPUT SHARED AS #1 PRINT #1, STR$(Users): CLOSE #1 OPEN Path$ + BName$ + "L" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, SND$ CLOSE #1 END IF END SUB SUB ChatOn SND$ = "99" + Name$ + " Entered This Line." SND$ = SND$ + SPACE$(82 - LEN(SND$)) ' Plus One User On This Line... IF NOT SysOp >= 4 THEN OPEN Path$ + BName$ + "N" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, "000": CLOSE #1 OPEN Path$ + BName$ + "N" + LineNr$ FOR INPUT SHARED AS #1 INPUT #1, Users$: CLOSE #1 Users = VAL(Users$) + 1 OPEN Path$ + BName$ + "N" + LineNr$ FOR OUTPUT SHARED AS #1 PRINT #1, MID$(STR$(Users), 2, 3): CLOSE #1 OPEN Path$ + BName$ + "L" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, SND$ CLOSE #1 OPEN Path$ + BName$ + "U" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, SND$ CLOSE #1 END IF END SUB SUB ChatSend IF TIMER < MesSent AND NOT SysOp >= 4 THEN DO DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Sorry, You Must Wait Atleast" + STR$(INT(MesSent - TIMER) + 1) + " Seconds Before Sending A New Message!" DialogBox IF TIMER > MesSent THEN Key$ = CHR$(3) LOOP WHILE Key$ = "" Key$ = "" END IF MesSent = TIMER + 2 IF NameAli = 1 THEN SWAP Name$, Alias$ CLR$ = LEFT$(CLR$, 2) 'Snd$ = Clr$ + Name$ + SPACE$(20 - LEN(Name$)) + ": " + SendText$ + SPACE$(138 - LEN(SendText$)) IF LEN(SendText$) <= 58 THEN SND$ = CLR$ + Name$ + SPACE$(20 - LEN(Name$)) + ": " + LEFT$(SendText$, 60) + SPACE$(58 - LEN(LEFT$(SendText$, 58))) IF LEN(SendText$) >= 59 THEN SND$ = CLR$ + Name$ + SPACE$(20 - LEN(Name$)) + ": " + LEFT$(SendText$, 58) + SPACE$(58 - LEN(LEFT$(SendText$, 58))) IF LEN(SendText$) >= 59 THEN sndt$ = CLR$ + MID$(SendText$, 59, 80) + SPACE$(80 - LEN(MID$(SendText$, 59, 80))) 'PRINT LEN(snd$); : SLEEP 'IF LEN(SendText$) >= 60 THEN Snd$ = Clr$ + Name$ + SPACE$(20 - LEN(Name$)) + ": " + LEFT$(SendText$, 58) + SPACE$(62 - LEN(LEFT$(SendText$, 60))) 'IF LEN(SendText$) >= 60 THEN Sndt$ = MID$(SendText$, 78) + SPACE$(82 - LEN(MID$(SendText$, 78))) IF SND$ = "" THEN EXIT SUB Att = 0 ReTryIt: ErLevel = 0 OPEN Path$ + BName$ + "L" + LineNr$ FOR APPEND SHARED AS #1 IF NOT ErLevel = 0 THEN Att = Att + 1 DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Error sending! Re-Trying, Attempt:" + STR$(Att) + "/20" IF Att = 21 THEN DiagText$ = "ERROR! Could NOT Send Message To Network!!!" DialogBox IF Att = 21 THEN DO: Key$ = INKEY$: LOOP WHILE Key$ = "": CLOSE #1: EXIT SUB T = TIMER + .5 DO: LOOP UNTIL TIMER > T GOTO ReTryIt END IF PRINT #1, SND$ IF NOT sndt$ = "" THEN PRINT #1, sndt$ CLOSE #1 Mes = Mes + 1 IF NameAli = 1 THEN SWAP Name$, Alias$ END SUB SUB ChatUpdate DIM FileRead AS FR 'SHELL "If Exist " + Path$ + MID$(STR$(UserID), 2, 4) + ".BAT " + MID$(STR$(UserID), 2, 4) + ".BAT>NUL" ErLevel = 0 OPEN Path$ + BName$ + "N" + LineNr$ FOR APPEND SHARED AS #1 IF NOT ErLevel = 0 THEN DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Network NOT Operative!" DialogBox CLOSE #1 EXIT SUB END IF PRINT #1, "000": CLOSE #1 OPEN Path$ + BName$ + "N" + LineNr$ FOR INPUT SHARED AS #1 IF NOT ErLevel = 0 THEN CLOSE #1: EXIT SUB INPUT #1, Users$: CLOSE #1 Users = VAL(Users$) '********************************* OPEN Path$ + BName$ + "T" + LineNr$ FOR APPEND SHARED AS #1 IF NOT ErLevel = 0 THEN CLOSE #1: EXIT SUB PRINT #1, "" CLOSE #1 OPEN Path$ + BName$ + "T" + LineNr$ FOR INPUT SHARED AS #1 IF NOT ErLevel = 0 THEN CLOSE #1: EXIT SUB INPUT #1, Topic$ CLOSE #1 Topic$ = LEFT$(Topic$, 20) VIEW PRINT 3 TO 24 LOCATE 3, 1, 0 ErLevel = 0 OPEN Path$ + BName$ + "L" + LineNr$ FOR RANDOM SHARED AS #1 LEN = 84 IF NOT ErLevel = 0 THEN CLOSE #1: EXIT SUB IF LOF(1) = UpdNow THEN CLOSE #1: EXIT SUB ELSE UpdNow = LOF(1) L = (LOF(1) - 164 * 10) / 84 IF L <= 19 THEN L = LOF(1) / 84 ELSE L = L + 20 P = L IF P >= 21 THEN P = 21 FOR A = 1 TO P GET #1, L - (P - A), FileRead C = VAL(FileRead.PCLR) BC = 0 IF C = 99 THEN C = 3: BC = 4 IF C <= 0 THEN CLOSE #1: KILL Path$ + BName$ + "L" + LineNr$: EXIT SUB IF C >= 32 THEN C = 30 COLOR C, BC P$ = FileRead.PName + FileRead.PLine PRINT P$ NEXT A IF P <= 20 THEN FOR A = P + 1 TO 21 LOCATE A + 2, 1: COLOR 7, 0: PRINT SPACE$(80); NEXT A END IF CLOSE #1 VIEW PRINT 5 TO 25 END SUB SUB ChatViewLine DIM LineInfo$(100) COLOR 7, 0: CLS ' : ReDrawBack ErLevel = 0 OPEN Path$ + BName$ + "LNS" FOR APPEND SHARED AS #1 IF NOT ErLevel = 0 THEN CLOSE #1: EXIT SUB PRINT #1, ""; CLOSE #1 OPEN Path$ + BName$ + "LNS" FOR INPUT SHARED AS #1 DO UNTIL EOF(1) INPUT #1, A$ LineInfo$(VAL(LEFT$(A$, 2))) = MID$(A$, 3, 20) LOOP CLOSE #1 VIEW PRINT 1 TO 25 LOCATE 1, 1: COLOR 14, 1: PRINT SPACE$(80) LOCATE 1, 1 LOCATE 1, 1: PRINT "This list contains all the available lines and their topics!" VIEW PRINT 4 TO 23 FOR A = 0 TO 99 IF LineInfo$(A) = "" THEN LineInfo$(A) = "Chatting(NOT OPEN)" IF NOT LineInfo$(A) = "" THEN COLOR 15, 0: PRINT "³ ";: COLOR 14, 0 PRINT A, LineInfo$(A) + SPACE$(25 - LEN(LineInfo$(A))); COLOR 15, 0: PRINT " ³": SP = SP + 1 END IF IF SP = 18 THEN COLOR 15, 0: PRINT "Press Any Key To Continue...": GetChoice: SP = 0: CLS NEXT A COLOR 7, 0 COLOR 15, 0: LOCATE 23, 1: PRINT "Press Any Key To Return To Main Menu..."; GetChoice VIEW PRINT 1 TO 25 END SUB SUB DialogBox ' *HOW_TO_USE* ' 'DiagX = 0 ' Horizontal Possition 'DiagY = 0 ' Vertical Possition 'DiagFC = 0 ' Foreground Color 'DiagBC = 0 ' Background Color 'DiagText$ = "" ' Dialog Text ' 'DialogBox ' Call Sub ' DiagText$ = LEFT$(DiagText$, 71) IF DiagBC = 0 THEN DiagBC = 4 IF DiagFC = 0 THEN DiagFC = 15 IF DiagText$ = "" THEN EXIT SUB IF DiagY = 0 THEN DiagY = 10 IF DiagY > 20 THEN DiagY = 19 IF DiagX = 0 THEN DiagX = 40 - INT(LEN(DiagText$) / 2) IF DiagX + 6 + LEN(DiagText$) > 80 THEN DiagX = 72 - LEN(DiagText$) COLOR DiagFC, DiagBC FOR A = 2 TO LEN(DiagText$) + 5 T = SCREEN(DiagY + 3, DiagX + A) IF T = 219 THEN T = 32 UT$ = UT$ + CHR$(T) NEXT A BFT = SCREEN(DiagY + 1, DiagX + LEN(DiagText$) + 4) BFST = SCREEN(DiagY + 1, DiagX + LEN(DiagText$) + 5) IF BFT = 219 THEN BFT = 32 IF BFST = 219 THEN BFST = 32 BUTF$ = CHR$(BFT) + CHR$(BFST) FT = SCREEN(DiagY + 2, DiagX + LEN(DiagText$) + 4) FST = SCREEN(DiagY + 2, DiagX + LEN(DiagText$) + 5) IF FT = 219 THEN FT = 32 IF FST = 219 THEN FST = 32 UTF$ = CHR$(FT) + CHR$(FST) LOCATE DiagY, DiagX, 0: PRINT "ÉÍ"; FOR A = 1 TO LEN(DiagText$) PRINT "Í"; NEXT A PRINT "Í»"; LOCATE DiagY + 1, DiagX: PRINT "º " + DiagText$ + " º" LOCATE DiagY + 2, DiagX: PRINT "ÈÍ"; FOR A = 1 TO LEN(DiagText$) PRINT "Í"; NEXT A PRINT "ͼ"; LOCATE DiagY + 1, DiagX + LEN(DiagText$) + 4: COLOR 8, 0: PRINT BUTF$ LOCATE DiagY + 2, DiagX + LEN(DiagText$) + 4: COLOR 8, 0: PRINT UTF$ LOCATE DiagY + 3, DiagX + 2: COLOR 8, 0: PRINT UT$ '****************************************************************************' ' DiagX = 0 ' ' DiagY = 0 ' ' DiagFC = 0 ' ' DiagBC = 0 ' ' DiagText$ = "" ' '****************************************************************************' END SUB SUB DrawMainMenu DIM MNU$(20) WIDTH 80, 25 UpdNow = 0 MesSent = 0 LineNr$ = STRING$(2 - LEN(MID$(STR$(LineNr), 2, 2)), "0") + MID$(STR$(LineNr), 2, 2) IF ReDraw = 1 THEN VIEW PRINT 1 TO 25 ReDraw = 0 RedrawBack DiagX = 50 DiagY = 9 DiagFC = 15 DiagBC = 1 DiagText$ = SPACE$(21) DialogBox END IF IF NOT ReDraw = 0 THEN DiagX = 50 DiagY = 9 DiagFC = 15 DiagBC = 1 DiagText$ = SPACE$(21) ReDraw = 0 DialogBox END IF MMx = 6 MMY = 17 mc = 1 MNU$(mc) = "1. Enter Conversation ": mc = mc + 1 MNU$(mc) = "2. Change Chat Line ": mc = mc + 1 MNU$(mc) = "3. Change Topic In Chat ": mc = mc + 1 MNU$(mc) = "4. User Options ": mc = mc + 1 MNU$(mc) = "5. View Lines ": mc = mc + 1 MNU$(mc) = "6. Send Message To User ": mc = mc + 1 MNU$(mc) = "7. DOS Shell ": mc = mc + 1 MNU$(mc) = "8. Help ": mc = mc + 1 MNU$(mc) = "9. About This Program ": mc = mc + 1 MNU$(mc) = "0. Exit Program (LogOff)": mc = mc + 1 mc = 1 COLOR 15, 1 LOCATE MMx + 0, MMY: PRINT "É" + STRING$(26, "Í") + "»" LOCATE MMx + 1, MMY: PRINT "º M a i n M e n u º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 2, MMY: PRINT "º" + STRING$(26, "Ä") + "º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 FOR A = 1 TO 9 LOCATE MMx + 2 + mc, MMY: PRINT "º ";: COLOR 7, 1: PRINT MNU$(mc);: COLOR 15, 1: PRINT " º";: COLOR 0, 0: PRINT " ": mc = mc + 1: COLOR 15, 1 NEXT A LOCATE MMx + 12, MMY: PRINT "º" + STRING$(26, "Ä") + "º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 13, MMY: PRINT "º ";: COLOR 7, 1: PRINT MNU$(mc);: COLOR 15, 1: PRINT " º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 14, MMY: PRINT "È" + STRING$(26, "Í") + "¼";: COLOR 0, 0: PRINT " ": COLOR 15, 1 COLOR 0, 0 LOCATE MMx + 15, MMY + 2: PRINT SPACE$(28) FOR A = 1 TO 10 mc = A IF MenuItem% = mc THEN COLOR 1, 7 ELSE COLOR 7, 1 IF NOT mc = 10 THEN LOCATE MMx + 2 + mc, MMY + 2 ELSE LOCATE MMx + 3 + mc, MMY + 2 PRINT MNU$(mc) NEXT A KeyAccept = False WHILE KeyAccept DO COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ Key$ = INKEY$ LOOP WHILE Key$ = "" IF Key$ = "+" THEN MenuItem% = MenuItem% + 1: KeyAccept = True IF Key$ = "-" THEN MenuItem% = MenuItem% - 1: KeyAccept = True IF Key$ = CHR$(0) + "P" THEN MenuItem% = MenuItem% + 1: KeyAccept = True IF Key$ = CHR$(0) + "H" THEN MenuItem% = MenuItem% - 1: KeyAccept = True FOR A = 1 TO 10 IF VAL(Key$) = A AND NOT MenuItem% = VAL(Key$) THEN MenuItem% = VAL(Key$): KeyAccept = True NEXT A IF Key$ = "0" AND NOT MenuItem% = VAL(Key$) THEN MenuItem% = VAL(Key$): KeyAccept = True IF Key$ = CHR$(27) THEN KeyAccept = True IF Key$ = CHR$(13) AND MenuItem% = 1 AND TIMER < TimeOfReturn AND NOT SysOp >= 4 THEN DO DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Sorry, You Can't Return Within 3 Seconds, Time Remaining:" + STR$(INT(TimeOfReturn - TIMER) + 1) + " Seconds" DialogBox Key$ = INKEY$ COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ IF TIMER > TimeOfReturn THEN Key$ = CHR$(3) LOOP WHILE Key$ = "" IF Key$ = CHR$(3) THEN Key$ = CHR$(13) ELSE Key$ = "": RedrawBack: ReDraw = 2: KeyAccept = True END IF IF Key$ = CHR$(13) AND MenuItem% = 1 THEN IF NamAli = 1 THEN SWAP Alias$, Name$ Chat Key$ = "": KeyAccept = True: ReDraw = 1: TimeOfReturn = INT(TIMER + 3) IF NamAli = 1 THEN SWAP Alias$, Name$ END IF IF Key$ = CHR$(13) AND MenuItem% = 2 THEN ChatFileNumber: Key$ = "": KeyAccept = True: RedrawBack: ReDraw = 2 IF Key$ = CHR$(13) AND MenuItem% = 3 THEN ChatNewName: Key$ = "": KeyAccept = True: RedrawBack: ReDraw = 2 IF Key$ = CHR$(13) AND MenuItem% = 4 THEN UserMenu: Key$ = "": KeyAccept = True: ReDraw = 2: MenuItem% = 4 IF Key$ = CHR$(13) AND MenuItem% = 5 THEN ChatViewLine: Key$ = "": KeyAccept = True: ReDraw = 1 IF Key$ = CHR$(13) AND MenuItem% = 7 THEN COLOR 7, 0: CLS HeadLine COLOR 12, 0: PRINT: PRINT "Type 'EXIT' To Return To Net-Chat v2.0.": PRINT COLOR 7, 0: SHELL ReDraw = 1: KeyAccept = True END IF IF Key$ = CHR$(13) AND MenuItem% = 8 THEN Help: KeyAccept = True IF Key$ = CHR$(13) AND MenuItem% = 9 THEN About: KeyAccept = True IF MenuItem% >= 11 THEN MenuItem% = 1 IF MenuItem% <= 0 THEN MenuItem% = 10 IF Key$ = CHR$(13) AND MenuItem% = 10 THEN Key$ = CHR$(27) IF Key$ = CHR$(27) THEN DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Do YOU Really Want to Exit [Y/N] ?" DialogBox DO COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ Key$ = INKEY$ LOOP WHILE Key$ = "" IF UCASE$(Key$) = "Y" THEN Key$ = CHR$(27): KeyAccept = True ELSE Key$ = "": KeyAccept = True: RedrawBack: ReDraw = 2 END IF WEND LOCATE 5, 1, 0 END SUB SUB GetChoice DO Key$ = INKEY$ LOOP WHILE Key$ = "" END SUB SUB HeadLine COLOR 14, 1: LOCATE 1, 1 LOCATE 1, 1: PRINT STRING$(80, "Í") LOCATE 4, 1: PRINT STRING$(80, "Í") LOCATE 1, 1: PRINT "É": LOCATE 1, 80: PRINT "»" LOCATE 4, 1: PRINT "È": LOCATE 4, 80: PRINT "¼" LOCATE 2, 1: PRINT "º": LOCATE 2, 80: PRINT "º" LOCATE 3, 1: PRINT "º": LOCATE 3, 80: PRINT "º" LOCATE 2, 2: PRINT SPACE$(34) + "Net-Chat v2.0a" + SPACE$(30) LOCATE 3, 2: PRINT SPACE$(25) + "(c) Copyright 1996 By Tedd Hansen" + SPACE$(20) END SUB SUB Help HeadLine COLOR 15, 1 LOCATE 6, 1: PRINT STRING$(80, "Í") LOCATE 24, 1: PRINT STRING$(80, "Í") LOCATE 6, 1: PRINT "É" LOCATE 6, 80: PRINT "»" LOCATE 24, 1: PRINT "È" LOCATE 24, 80: PRINT "¼" FOR A = 7 TO 23 LOCATE A, 1: PRINT "º" + STRING$(78, " ") + "º" NEXT A LOCATE 7, 4: PRINT "HELP ON NET-CHAT v2.0a" COLOR 10, 1 LOCATE 9, 4: PRINT "Net-Chat 2.0 is the result of hours of intense programming, " LOCATE 10, 4: PRINT "you didn't really think that I would care about programming something " LOCATE 11, 4: PRINT "like HELP??? If you need help, ask the author... This program shouldn't " LOCATE 12, 4: PRINT "be to hard to use if you have the basic knowledge! " LOCATE 13, 4: PRINT " " LOCATE 14, 4: PRINT "Help will be avaivable in the final release, maybe even in one of the BETA " LOCATE 15, 4: PRINT "releases, but not at this time!" LOCATE 16, 4: PRINT "" LOCATE 17, 4: PRINT "All you need to know is that the button marked 'ESC' on your keyboard" LOCATE 18, 4: PRINT "means ESCAPE, it will help you find the way out!" LOCATE 19, 4: PRINT "" LOCATE 20, 4: PRINT "To save you the trouble looking for an EASTEREGG, I can confirm that" LOCATE 21, 4: PRINT "this program contains one! No hints avaivable!" LOCATE 22, 4: PRINT "" LOCATE 23, 4: PRINT "Have a nice chat!" GetChoice ReDraw = 1 KeyAccept = True Key$ = "" END SUB SUB InitStartUp VIEW PRINT 1 TO 25 COLOR 7, 0: CLS HeadLine COLOR 31, 0 LOCATE 6, 1, 1: PRINT "NOTE!!!" COLOR 7, 0 PRINT PRINT "This is a BETA release, not all of the functions are finished." PRINT "Error checking is not finished, so if anything goes wrong, like" PRINT " sharing violation, path don't exist, network don't exist etc." PRINT " the program will just exit, showing you an error message." PRINT "This is just so that the author can see what MAY go wrong," PRINT " unlike the other BETA releases where all error where ignored" PRINT " and only A FEW where fixed." PRINT PRINT "The program also contains BUGS wich the author knows about, and" PRINT " will be fixed in later releases. This is the FIRST release of" PRINT "NET-CHAT 2.0, release a." PRINT PRINT "Please notify thee author when anything goes wrong!" PRINT "This will be fixed in the final release!!!" PRINT "Have A Nice Beta Testing!!" PRINT PRINT "Tedd Hansen" GetChoice Key$ = "" MenuItem% = 1 ReDraw = 1 END SUB SUB LogOn LogOnAgain: Alias$ = "" PWD$ = "" VPWD$ = "" Exist = 0 LogOnItem = 0 COLOR 7, 0: CLS HeadLine LOCATE 13, 1, 0: COLOR 3, 0: PRINT STRING$(20, "±"): LOCATE 13, 1, 1: PRINT Name$; LOCATE 16, 1, 0: COLOR 3, 0: PRINT STRING$(20, "±"): LOCATE 16, 1, 1: PRINT Alias$; LOCATE 19, 1, 0: COLOR 3, 0: PRINT STRING$(6, "±"): LOCATE 19, 1, 1: PRINT STRING$(LEN(PWD$), "*"); LOCATE 22, 1, 0: COLOR 3, 0: PRINT STRING$(6, "±"): LOCATE 22, 1, 1: PRINT STRING$(LEN(VPWD$), "*"); ' COLOR 8, 0: LOCATE 22, 1, 0: PRINT STRING$(6, "±"): LOCATE 22, 1, 1: PRINT STRING$(LEN(VPWD$), "*"); COLOR 12, 0 LOCATE 6, 1: PRINT "Welcome To Net-Chat v2.0a." COLOR 10, 0 PRINT "You are about to log on to Net-Chat. Please enter your REAL name," PRINT "This name is used with your password next time you log on, so that" PRINT "NoOne else can use it. You may choose to use ALIAS during chat." PRINT "ALIAS may be changed later, during chat." PRINT COLOR 3, 0 LOCATE 12, 1, 0: COLOR 15, 0: PRINT "Name:" LOCATE 15, 1, 0: COLOR 15, 0: PRINT "Alias:" LOCATE 18, 1, 0: COLOR 15, 0: PRINT "Password:" LOCATE 21, 1, 0: COLOR 15, 0: PRINT "Password Verification:" ExitLogOn = False WHILE ExitLogOn COLOR 0, 3 Name$ = LEFT$(Name$, 20) Alias$ = LEFT$(Alias$, 20) PWD$ = UCASE$(LEFT$(PWD$, 6)) VPWD$ = UCASE$(LEFT$(VPWD$, 6)) ' Exist = 1 IF LogOnItem = 0 THEN LOCATE 13, 1, 0: COLOR 3, 0: PRINT STRING$(20, "±"): LOCATE 13, 1, 1: PRINT Name$; IF LogOnItem = 1 AND Exist = 0 THEN LOCATE 16, 1, 0: COLOR 3, 0: PRINT STRING$(20, "±"): LOCATE 16, 1, 1: PRINT Alias$; IF LogOnItem = 1 AND Exist = 1 THEN COLOR 8, 0: LOCATE 17, 1: PRINT "You Have Logged On Before, You Can't Change Alias Now.": LOCATE 16, 1, 0: PRINT STRING$(20, "±"): LOCATE 16, 1, 1: PRINT STRING$(LEN(Alias$), "*"); IF LogOnItem = 2 AND Exist = 1 THEN COLOR 8, 0: LOCATE 17, 1: PRINT "You Have Logged On Before, You Can't Change Alias Now.": LOCATE 16, 1, 0: PRINT STRING$(20, "±"): LOCATE 16, 1, 1: PRINT STRING$(LEN(Alias$), "*"); IF LogOnItem = 2 AND Exist = 1 THEN COLOR 8, 0: LOCATE 22, 1, 0: PRINT STRING$(6, "±"): LOCATE 22, 1, 1: PRINT STRING$(LEN(VPWD$), "*"); IF LogOnItem = 2 THEN LOCATE 19, 1, 0: COLOR 3, 0: PRINT STRING$(6, "±"): LOCATE 19, 1, 1: PRINT STRING$(LEN(PWD$), "*"); IF LogOnItem = 3 AND Exist = 0 THEN LOCATE 22, 1, 0: COLOR 3, 0: PRINT STRING$(6, "±"): LOCATE 22, 1, 1: PRINT STRING$(LEN(VPWD$), "*"); 'IF LogOnItem = 3 AND Exist = 1 THEN COLOR 8, 0: LOCATE 23, 1: PRINT "You have logged on before, I Don't need any verification.": LOCATE 22, 1, 0: PRINT STRING$(6, "±"): LOCATE 22, 1, 1: PRINT STRING$(LEN(VPWD$), "*"); DO Key$ = INKEY$ LOOP WHILE Key$ = "" IF Key$ = CHR$(13) AND LogOnItem = 0 AND LEN(Name$) = 0 THEN Key$ = "*" IF Key$ = CHR$(13) AND LogOnItem = 1 AND Exist = 0 AND LEN(Alias$) = 0 THEN Key$ = "*" IF Key$ = CHR$(13) AND LogOnItem = 2 AND Exist = 0 AND LEN(PWD$) = 0 THEN Key$ = "*" IF Key$ = CHR$(13) AND LogOnItem = 0 THEN COLOR 15, 0 LOCATE 13, 30: PRINT "Searching: " LogOnFindUser IF Exist = 1 THEN LogOnItem = LogOnItem + 1: PRINT SPACE$(29) + "Name Found!" ELSE PRINT SPACE$(29) + "Name NOT Found, You Haven't Logged On Before!" VPWD$ = "": SWAP PWD$, VPWD$ END IF IF Key$ = CHR$(13) AND LogOnItem = 3 AND Exist = 0 THEN COLOR 15, 0 LOCATE 22, 30: PRINT "Searching: " LogOnFindUser IF Exist = 1 THEN PRINT SPACE$(29) + "Name Found!" ELSE PRINT SPACE$(29) + "Name NOT Found, You Haven't Logged On Before!" ' VPWD$ = "": SWAP PWD$, VPWD$ END IF IF Key$ = CHR$(27) THEN GOTO EndLogOn IF Key$ = CHR$(9) THEN LogOnItem = LogOnItem + 1 IF Key$ = CHR$(0) + "P" THEN LogOnItem = LogOnItem + 1 IF Key$ = CHR$(0) + "H" THEN LogOnItem = LogOnItem - 1 IF LogOnItem > 3 THEN LogOnItem = 0 IF LogOnItem < 0 THEN LogOnItem = 3 IF Key$ = CHR$(13) THEN LogOnItem = LogOnItem + 1 IF Key$ = CHR$(13) AND Exist = 1 AND LogOnItem = 3 THEN LogOnItem = LogOnItem + 1 IF LogOnItem > 3 THEN ExitLogOn = True GOSUB SW OKASCII = 0 IF ASC(Key$) = 134 THEN OKASCII = 1 IF ASC(Key$) = 143 THEN OKASCII = 1 IF ASC(Key$) = 145 THEN OKASCII = 1 IF ASC(Key$) = 146 THEN OKASCII = 1 IF ASC(Key$) = 155 THEN OKASCII = 1 IF ASC(Key$) = 157 THEN OKASCII = 1 IF ASC(Key$) >= 32 AND ASC(Key$) <= 122 OR OKASCII = 1 THEN IF LogOnItem = 1 AND Exist = 1 THEN BEEP ELSEIF LogOnItem = 3 AND Exist = 1 THEN BEEP ELSE Temp$ = Temp$ + Key$ END IF END IF IF Key$ = CHR$(8) AND LEN(Temp$) >= 1 THEN Temp$ = LEFT$(Temp$, LEN(Temp$) - 1) GOSUB SW IF UCASE$(LEFT$(Name$, 3)) = "TED" THEN Name$ = "" IF UCASE$(LEFT$(Name$, 3)) = "GUD" THEN Name$ = "" IF UCASE$(LEFT$(Name$, 3)) = "GOD" THEN Name$ = "" IF UCASE$(LEFT$(Alias$, 3)) = "TED" THEN Alias$ = "" IF UCASE$(LEFT$(Alias$, 3)) = "GUD" THEN Alias$ = "" IF UCASE$(LEFT$(Alias$, 3)) = "GOD" THEN Alias$ = "" 'IF Exist = 1 THEN VPWD$ = PWD$ WEND DiagX = 0 DiagY = 0 DiagFC = 0 DiagBC = 0 IF NOT PWD$ = VPWD$ THEN DiagText$ = "The two passwords you have specified don't mach, try again." DialogBox LOCATE 1, 1, 0 GetChoice GOTO LogOnAgain END IF IF LEN(Name$) = 0 THEN DiagText$ = "You MUST Specify A NAME!!!" DialogBox LOCATE 1, 1, 0 GetChoice GOTO LogOnAgain END IF IF LEN(Alias$) = 0 THEN DiagText$ = "You MUST Specify A ALIAS!!!" DialogBox LOCATE 1, 1, 0 GetChoice GOTO LogOnAgain END IF IF LEN(PWD$) = 0 THEN DiagText$ = "You MUST Specify A PASSWORD!!!" DialogBox LOCATE 1, 1, 0 GetChoice GOTO LogOnAgain END IF LineNr$ = STRING$(2 - LEN(MID$(STR$(LineNr), 2, 2)), "0") + MID$(STR$(LineNr), 2, 2) IF NamAli = 1 THEN SWAP Alias$, Name$ IF Exist = 0 THEN UserSave SND$ = "99" + Name$ + " Entered Net-Chat" IF Exist = 0 THEN SND$ = SND$ + " For The First Time." ELSE SND$ = SND$ + "." SND$ = SND$ + SPACE$(82 - LEN(SND$)) OPEN Path$ + BName$ + "L" + LineNr$ FOR APPEND SHARED AS #1 PRINT #1, SND$ CLOSE #1 IF NamAli = 1 THEN SWAP Alias$, Name$ EXIT SUB SW: IF LogOnItem = 0 THEN SWAP Temp$, Name$ IF LogOnItem = 1 THEN SWAP Temp$, Alias$ IF LogOnItem = 2 THEN SWAP Temp$, PWD$ IF LogOnItem = 3 THEN SWAP Temp$, VPWD$ RETURN EndLogOn: COLOR 7, 0: CLS HeadLine LOCATE 5, 1: COLOR 12, 0: PRINT "Thank you for using Net-Chat, Welcome Again!" LOCATE 6, 1: COLOR 7, 0: PRINT "Program ended successfully!" LOCATE 9, 1: COLOR 7, 0 END END SUB SUB LogOnFindUser DIM PersonalInfo AS PI OPEN Path$ + BName$ + "DAT" FOR RANDOM SHARED AS #1 LEN = 78 L = LOF(1) / 78 FOR G = 1 TO L GET #1, G, PersonalInfo IF UCASE$(Name$) = UCASE$(LEFT$(PersonalInfo.UName, LEN(Name$))) THEN Exist = 1 Alias$ = PersonalInfo.UAlias PWD$ = PersonalInfo.UPWD SysOp = VAL(PersonalInfo.SysOp) CLR$ = PersonalInfo.UColor NamAli = VAL(PersonalInfo.UAlNa) UpdInterval = VAL(PersonalInfo.UpdInt) UserID = VAL(PersonalInfo.UNumber) LogOnDate$ = PersonalInfo.LogDT LP = 0 FOR A = 1 TO LEN(Alias$) IF LP = 0 AND MID$(Alias$, A, 1) = "|" THEN LP = A NEXT A IF LP = 0 THEN LP = 1 Alias$ = LEFT$(Alias$, LP - 1): LP = 0 FOR A = 1 TO LEN(PWD$) IF LP = 0 AND MID$(PWD$, A, 1) = "|" THEN LP = A NEXT A IF LP = 0 THEN LP = 1 PWD$ = LEFT$(PWD$, LP - 1) END IF NEXT G CLOSE #1 END SUB SUB RedrawBack 'COLOR 7, 0: CLS VIEW PRINT 25 TO 25 COLOR 7, 0: CLS VIEW PRINT 5 TO 25 COLOR 8, 0 LOCATE 5, 1 PRINT STRING$(80 * 20, "Û") VIEW PRINT 1 TO 25 HeadLine END SUB SUB UserMenu DIM MNU$(20) WIDTH 80, 25 MenuItem% = 1 Changed = 0 DrawAgain: IF ReDraw = 1 THEN VIEW PRINT 1 TO 25 ReDraw = 0 RedrawBack DiagX = 50 DiagY = 9 DiagFC = 15 DiagBC = 1 DiagText$ = SPACE$(21) DialogBox END IF IF NOT ReDraw = 0 THEN DiagX = 50 DiagY = 9 DiagFC = 15 DiagBC = 1 DiagText$ = SPACE$(21) ReDraw = 0 DialogBox END IF MMx = 6 MMY = 17 mc = 1 MNU$(mc) = "1. Change Personal Color": mc = mc + 1 MNU$(mc) = "2. Change Alias ": mc = mc + 1 MNU$(mc) = "3. Change Password ": mc = mc + 1 MNU$(mc) = "4. Change Upd. Intervall": mc = mc + 1 MNU$(mc) = "5. View Other Users ": mc = mc + 1 MNU$(mc) = "6. View All Lines ": mc = mc + 1 IF NamAli = 1 THEN MNU$(mc) = "7. Use ALIAS/name ": mc = mc + 1 IF NamAli = 0 THEN MNU$(mc) = "7. Use alias/NAME ": mc = mc + 1 MNU$(mc) = "8. Save Changes ": mc = mc + 1 MNU$(mc) = "9. SysOp Menu ": mc = mc + 1 MNU$(mc) = "0. Exit To Main Menu ": mc = mc + 1 mc = 1 COLOR 15, 1 LOCATE MMx + 0, MMY: PRINT "É" + STRING$(26, "Í") + "»" LOCATE MMx + 1, MMY: PRINT "º U s e r O p t i o n s º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 2, MMY: PRINT "º" + STRING$(26, "Ä") + "º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 FOR A = 1 TO 9 LOCATE MMx + 2 + mc, MMY: PRINT "º ";: COLOR 7, 1: PRINT MNU$(mc);: COLOR 15, 1: PRINT " º";: COLOR 0, 0: PRINT " ": mc = mc + 1: COLOR 15, 1 NEXT A LOCATE MMx + 12, MMY: PRINT "º" + STRING$(26, "Ä") + "º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 13, MMY: PRINT "º ";: COLOR 7, 1: PRINT MNU$(mc);: COLOR 15, 1: PRINT " º";: COLOR 0, 0: PRINT " ": COLOR 15, 1 LOCATE MMx + 14, MMY: PRINT "È" + STRING$(26, "Í") + "¼";: COLOR 0, 0: PRINT " ": COLOR 15, 1 COLOR 0, 0 LOCATE MMx + 15, MMY + 2: PRINT SPACE$(28) FOR A = 1 TO 10 mc = A IF MenuItem% = mc THEN COLOR 1, 7 ELSE COLOR 7, 1 IF NOT mc = 10 THEN LOCATE MMx + 2 + mc, MMY + 2 ELSE LOCATE MMx + 3 + mc, MMY + 2 PRINT MNU$(mc) NEXT A DO KeyAccept = False WHILE KeyAccept DO COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ Key$ = INKEY$ LOOP WHILE Key$ = "" IF Key$ = "+" THEN MenuItem% = MenuItem% + 1: KeyAccept = True IF Key$ = "-" THEN MenuItem% = MenuItem% - 1: KeyAccept = True IF Key$ = CHR$(0) + "P" THEN MenuItem% = MenuItem% + 1: KeyAccept = True IF Key$ = CHR$(0) + "H" THEN MenuItem% = MenuItem% - 1: KeyAccept = True FOR A = 1 TO 10 IF VAL(Key$) = A AND NOT MenuItem% = VAL(Key$) THEN MenuItem% = VAL(Key$): KeyAccept = True NEXT A IF Key$ = "0" AND NOT MenuItem% = VAL(Key$) THEN MenuItem% = VAL(Key$): KeyAccept = True IF Key$ = CHR$(13) AND MenuItem% = 10 THEN Key$ = CHR$(27): KeyAccept = True IF Key$ = CHR$(27) THEN KeyAccept = True IF MenuItem% >= 11 THEN MenuItem% = 1 IF MenuItem% <= 0 THEN MenuItem% = 10 IF Key$ = CHR$(13) AND MenuItem% = 7 THEN NamAli = NamAli + 1: KeyAccept = True: Key$ = "": Changed = 1 IF NamAli > 1 THEN NamAli = 0 mc = 7 IF NamAli = 1 THEN MNU$(mc) = "7. Use ALIAS/name " IF NamAli = 0 THEN MNU$(mc) = "7. Use alias/NAME " FOR A = 1 TO 10 mc = A IF MenuItem% = mc THEN COLOR 1, 7 ELSE COLOR 7, 1 IF NOT mc = 10 THEN LOCATE MMx + 2 + mc, MMY + 2 ELSE LOCATE MMx + 3 + mc, MMY + 2 PRINT MNU$(mc) NEXT A IF Key$ = CHR$(13) AND MenuItem% = 1 THEN UserNewColor: Key$ = "": RedrawBack: ReDraw = 2: KeyAccept = True: Changed = 1 IF Key$ = CHR$(13) AND MenuItem% = 4 THEN UserUpdIntCh: Key$ = "": RedrawBack: ReDraw = 2: KeyAccept = True: Changed = 1 IF Key$ = CHR$(13) AND MenuItem% = 8 AND Changed = 1 THEN UserSave: KeyAccept = True: Key$ = "": Changed = 0 IF Key$ = CHR$(13) AND MenuItem% = 9 THEN DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "I'm really sorry, but you are not authorised to use this option!" DialogBox DO Key$ = INKEY$ COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ LOOP WHILE Key$ = "" Key$ = "": RedrawBack: ReDraw = 2: KeyAccept = True END IF WEND ExitOK = 0 IF Key$ = CHR$(27) THEN ExitOK = 1 IF Key$ = CHR$(13) AND MenuItem% = 10 THEN ExitOK = 1 'IF Key$ = CHR$(13) AND MenuItem% = 9 THEN About: KeyAccept = True IF NOT ReDraw = 0 THEN GOTO DrawAgain LOOP UNTIL ExitOK = 1 IF Changed = 1 THEN DiagX = 0: DiagY = 11: DiagFC = 0: DiagBC = 0 DiagText$ = "Do you wish to keep current changes next time you log on [Y/N] ?" DialogBox DO COLOR 15, 1: LOCATE 10, 52, 0: PRINT DATE$ + " - " + TIME$ Key$ = INKEY$ LOOP WHILE Key$ = "" IF UCASE$(Key$) = "Y" THEN UserSave RedrawBack END IF Changed = 0 END SUB SUB UserNewColor CLR = VAL(CLR$) IF CLR <= 0 OR CLR >= 16 THEN CLR = 7 CLRItem = CLR DiagX = 59 DiagFC = 8 DiagBC = 8 DiagText$ = " " DiagY = 10 DialogBox DiagText$ = SPACE$(46) DiagX = 14 DiagY = 12 DialogBox X = 10 Y = 14 COLOR 15, 0 LOCATE X, Y: PRINT "É" + STRING$(48, "Í") + "»" LOCATE X + 1, Y: PRINT "º" + STRING$(48, " ") + "º" LOCATE X + 2, Y: PRINT "º" + STRING$(48, " ") + "º" LOCATE X + 3, Y: PRINT "º" + STRING$(48, " ") + "º" LOCATE X + 4, Y: PRINT "È" + STRING$(48, "Í") + "¼" COLOR 14, 0: LOCATE X + 1, Y + 2: PRINT "Please Choose Your Color:" DO FOR A = 1 TO 15 LOCATE X + 3, Y + (A * 3) COLOR A, 0 IF A = CLRItem THEN COLOR A, 15 IF A = CLRItem AND A = 7 THEN COLOR 0, 7 PRINT STRING$(2 - LEN(MID$(STR$(A), 2, 2)), "0") + MID$(STR$(A), 2, 2) NEXT A DO Key$ = INKEY$ COLOR 15, 1: LOCATE 10, 65, 0: PRINT TIME$ LOOP WHILE Key$ = "" IF Key$ = "+" THEN CLRItem = CLRItem + 1 IF Key$ = "-" THEN CLRItem = CLRItem - 1 IF Key$ = CHR$(0) + "P" THEN CLRItem = CLRItem - 1 IF Key$ = CHR$(0) + "H" THEN CLRItem = CLRItem + 1 IF Key$ = CHR$(0) + "K" THEN CLRItem = CLRItem - 1 IF Key$ = CHR$(0) + "M" THEN CLRItem = CLRItem + 1 IF CLRItem > 15 THEN CLRItem = 1 IF CLRItem < 1 THEN CLRItem = 15 LOOP UNTIL Key$ = CHR$(13) OR Key$ = CHR$(27) IF Key$ = CHR$(27) THEN EXIT SUB CLR$ = STRING$(2 - LEN(MID$(STR$(CLRItem), 2, 2)), "0") + MID$(STR$(CLRItem), 2, 2) END SUB SUB UserSave OPEN Path$ + BName$ + "DAT" FOR APPEND SHARED AS #1 Temp$ = DATE$ + " - " + TIME$ Temp$ = Temp$ + MID$(STR$(UserID), 2, 4) Temp$ = Temp$ + Name$ + STRING$(20 - LEN(Name$), "|") Temp$ = Temp$ + Alias$ + STRING$(20 - LEN(Alias$), "|") Temp$ = Temp$ + PWD$ + STRING$(6 - LEN(PWD$), "|") Temp$ = Temp$ + CLR$ Temp$ = Temp$ + MID$(STR$(NamAli), 2, 1) Temp$ = Temp$ + MID$(STR$(UpdInterval), 2, 1) Temp$ = Temp$ + MID$(STR$(SysOp), 2, 1) PRINT #1, Temp$ CLOSE #1 |