home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR10 / IRC142.ZIP / IRC142.BAS (.txt) < prev    next >
QuickBASIC Tokenized Source  |  1991-06-17  |  39KB  |  632 lines

  1. ChngString
  2. String
  3. String.To.Change
  4. ParseString
  5. String.To.Parse
  6. ModemInc
  7.     ClearLineE
  8. String.To.Clear
  9. Inpt0
  10. DrawCursor
  11. StatusLine
  12. @    ModString
  13. SetFlags    
  14. HelpSystem
  15. Help/
  16. Help.Topic
  17. LoadConfig
  18. Config{
  19. Config.Fileo
  20. ReadFile
  21. Filenameg
  22. ReadMode
  23. JoinChannel$
  24. Channel
  25. LeaveChannel
  26. ChannelNumberT
  27. Channels
  28. Server
  29. Color?
  30. Colors
  31. debug
  32. version
  33. NoDial
  34. servers-
  35. variant
  36. Author
  37. Author.Nick
  38. True.Com.Port`
  39. ComPorto
  40. BaudRate
  41. PrefixF
  42. Merit
  43.     Merit.Num*
  44. ConnectToServer
  45. ConnectToServer2
  46. RealNameP
  47. Read.StartZ
  48. Query~
  49. scroll
  50. Record
  51. topic
  52.     BackSpace0
  53. Help.File.Path
  54. Lines
  55. TypeModeH
  56. Dimmed
  57. history?
  58. START
  59. Prefillo
  60. StartPos
  61.     CursorPos
  62. PARSE'
  63. UpDate
  64. PrintMeY
  65. GetKey-
  66. KeyInputEnd
  67. VALIDa
  68. ScrollHistoryZ
  69. ConfigFile
  70. CnfgVersionT
  71. fullwho
  72. Flags
  73. ignore
  74. OldNick
  75. Operand
  76. miscgarb
  77. EnterCh
  78. serve3
  79. status9
  80. Stat]
  81. users
  82. space
  83. MsgTo
  84. Variable
  85. @    PrintTextS
  86. Suffixc
  87. Foreground
  88. Background#
  89. LPre>
  90. NewLine
  91. Bottom
  92.     THENPRINT
  93. PrintTextxz
  94. expandH
  95. NoEcho
  96. NextArg
  97. Toggle
  98. FNToggle
  99. keynum
  100. miscgarbSTATIC
  101. funky
  102. BeepMode
  103. BeepModespace
  104. $TITLE: 'IRC.EXE Version 1.42 (C) 1991 Eric Blade'
  105.  Makes a copy of the command line that we can parse things out of.
  106. 06-17-1991
  107. MSDOS"
  108. EricBlade"
  109.  IRC /C calls CONFIGUR.EXE
  110. Configuring for IRC.EXE Version 
  111. configur
  112.  IRC /M sets Mono variable to one, for use with Monochrome monitors
  113. IRC.EXE Version 
  114.  Engaged in Monochrome Mode...
  115.  IRC /D skips the dialing/MichNet communications things so anyone with a
  116.  regular ASCII connection can use it.m
  117. IRC.EXE Version 
  118.  engaged in No-Dial Mode..."
  119.  Set the nickname. The Command line now overrides the environment variable
  120.  vice previous versions, when the env. variable overrode the command line.
  121.  NOTE: THIS WILL NOT WORK IF YOU ARE USING 4DOS Version 3.03
  122. NICKNAME
  123. NICKNAME
  124. Opening COM"
  125. : port..."
  126.  Here we need to do some Port renaming for QuickBASIC. We need to tell DOS
  127.  that Port 3 is accessed by using Port 1, and Port 4 is accessed by usingS
  128.  Port 2. This gets us around the COM1 and 2 only limitations of QuickBASIC.
  129.  Here we actually open the COM port.  The HUGE Receive Buffer (RB) isB
  130.  required because some computers have fits at the original 6K buffer I used
  131.  (PS/2's especially. :> )m
  132. ,E,7,1,RB32767,RS,DS0"
  133.  Here, if NoDial is false, we send the Dialing prefix + Merit Number as read
  134.  out of the configuration file.e
  135. Dialing Merit...
  136.  If MichNet doesn't answer, die.
  137. Merit/MichNet did not answer."
  138.  Wait for CONNECT string
  139. CONNECT"$
  140.  Read the string from CONNECT until the end of the linen
  141. CONNECT"$
  142. Connected to Merit/MichNet (
  143. BUSY$
  144. Merit/MichNet is busy.
  145.  If we get the traditional garbage at connection, then we send three returns
  146.  to get Merit to acknowledge our presence.
  147. Which Host?"$
  148.  Send the Server + the port (6667)
  149.  6667"
  150. *** No connection: Try again."
  151. connect"$
  152. cleared"$
  153.  If by the other ways mentioned above, the NickName still hasn't beenr
  154.  determined, ASK THE USER.
  155. Enter Your Nickname (9 chars/NO spaces):
  156.  Here we are connected to the server, and send the text required to let
  157.  the server know who we are. After that, the MOTD starts, and things go.
  158. :IRC:v
  159. user ircexe 1 1 
  160. nick "
  161.  Here we have the entire big IRC Loop 
  162.  Check for keypressg
  163.  If found, call Key Input routineo
  164.  IF NOT mono THEN COLOR Colors(1, 1), Colors(1, 2)
  165.  Parse Input'd string, if it really1
  166.  is a command beginning with "/"
  167.  Uh-oh, an Invalid "/" command!"
  168. Invalid Command: "
  169.  Change Status Line
  170.  Cant send text to a channel if you aren't on any channels.n
  171. *** You aren't on a channel, yet."d
  172. privmsg 
  173. privmsg 
  174. IF y > 0 AND x > 0 AND scroll = 0 THEN
  175.   VIEW PRINT 1 TO 23
  176.   IF y < 23 THEN
  177.  LOCATE y, x
  178.   END IF
  179.   x = 1: y = 1
  180. END IF
  181. IF scroll THEN VIEW PRINT 1 TO 23: LOCATE y, 1
  182.  Process Modem Input
  183. More Memory Needed: Terminating.d
  184. Press any key to return to DOS..."
  185. Device Timeout: Terminating.d
  186. Press any key to return to DOS..."
  187. Hardware Error: Termianting.d
  188. Press any key to return to DOS..."
  189. Warning: Printer is out of paper."d
  190. File Not Foundd
  191. Out of disk space. Shutting down RECORD file."d
  192. Buffer Overflow, You are going to lose some text."d
  193. privmsg msgserv tell "
  194.  has found an ERROR #"
  195.  in IRC.EXE version 
  196. Help file for '"
  197. ' not found.
  198. Configuration file not found. Type IRC /C to configure."
  199. ParseString
  200.  SHARED Flags$ ' Test off
  201. /admin;
  202. admin 
  203. /away";
  204. away "
  205. /beeps;
  206. No Beeps (Mode 0).
  207. Beeps Heard (Mode 1)."
  208. Beeps Filtered (^G) (Mode 2)."
  209. Beeps Filtered (^G) and Heard (Mode 3)."
  210. *** Current Beep Mode: "
  211. *** Beep Setting may only be a number, 0 through 3d
  212. *** Beep Setting Out of Range (0-3).d
  213. No Beeps (Mode 0).
  214. Beeps Heard (Mode 1)."
  215. Beeps Filtered (^G) (Mode 2)."
  216. Beeps Filtered (^G) and Heard (Mode 3)."
  217. *** New Beep Mode: "
  218. /clear;
  219. /cls;
  220. /date";
  221. /time";
  222. time "
  223. /echo";
  224. *** Format: 
  225.  <text..text...>
  226. /fullwho;
  227. /help";
  228. /invite";
  229. /inv;
  230. *** Format: 
  231.  <nickname> [channel]"
  232. invite "
  233. /info";
  234. /ignore";
  235. /join";
  236. /channel;
  237. *** Format: 
  238.  <channel>
  239. JOIN "
  240. /key;
  241. *** Format: /KEY <fkeynumber> <text>d
  242. *** To denote a CR in a Macro, enter a carat (^)d
  243. *** Invalid Key. (May only be a number, 1 through 10.)d
  244. /kick";
  245. *** Format: 
  246.  <user> <channel>"
  247. kick "
  248. /kill";
  249. *** Format: 
  250.  <user>"
  251. kill "
  252. /links;
  253. links 
  254. /list";
  255. list "
  256. /lusers";
  257. lusers
  258. /msg;
  259. *** Format: 
  260.  <user> <text..text...>"
  261. privmsg 
  262. /motd";
  263. motd "
  264. /miscgarb";
  265. /mode";
  266. *** Format: 
  267.  <channel> <mode change> [operands]"
  268. mode "
  269. /mailread";
  270. voice msgserv read "
  271. /maildelete";
  272. /maildel;
  273. voice msgserv delete "
  274. /mail";
  275. *** Format: 
  276.  <user> <text..text...>"
  277. voice msgserv tell "
  278. /names;
  279. names 
  280. /nick";
  281. /ni";
  282. *** Format: 
  283.  <nickname>"
  284. nick "
  285. /nickpass";
  286. voice nickserv@service.de passwd "
  287. /noecho";
  288. /part";
  289. PART "
  290. /query;
  291. /quote;
  292. /quo;
  293. /quit";
  294. /bye;
  295. /exit";
  296. /signoff;
  297. /qu";
  298. /record";
  299. /rec;
  300. You are already recording output!"d
  301. Recording ended at "U
  302. Recording started at "U
  303. /read";
  304. *** Format: 
  305.  <file>"
  306. /regnick;
  307. voice nickserv@service.de del 
  308. voice nickserv@service.de add 
  309. /shell;
  310. /exec";
  311. COMSPEC"
  312. PONG IRCEXE@MSDOS"
  313. /scroll";
  314. /summon";
  315. *** Format: /summon <userid>[@system]"d
  316. summon "
  317. /stats;
  318. stats"
  319. /topic;
  320. /top;
  321. *** Format: 
  322.  <topic>
  323. topic 
  324. /type";
  325. *** Format: 
  326.  <file>"
  327. /users;
  328. users 
  329. /version;
  330. *** You are using IRC.EXE Version 
  331. *** Written by "
  332. version 
  333. /who;
  334. -OPER"$
  335. /whois;
  336. /wi";
  337. *** Format: 
  338.  <user>"
  339. whois 
  340. /whowas";
  341. /ww";
  342. *** Format: 
  343.  <user>"
  344. whowas "
  345. /wallops;
  346. wallops 
  347. /waitfor;
  348. /wf";
  349. *** Format: 
  350.  [-]<user>
  351. voice waitserv giveup 
  352. voice waitserv waitfor "
  353. ModemIn
  354.  We may have just solved the majority of Line Garbage problems that 
  355.  reformat your screen and 
  356. * everything up.
  357.  Remove LineFeeds, they act funny.
  358. %Call";
  359. cleared"$
  360. Disconnected from Server: Terminating.d
  361. Press any key to return to DOS..."
  362. CARRIER"$
  363. Carrier Lost: Terminating.d
  364. Press any key to return to DOS..."
  365. PING;
  366.  To make sure the server knows we are still there.
  367. PONG IRC.EXE@MSDOS
  368. NAMREPLY;
  369.  Reply to /NAMES command
  370. Unknown"
  371. Channel: "
  372.  Users: 
  373. NOTICE;
  374.  A notice from the current server
  375. END OF$
  376. /read ircstart.sys8
  377. wallops";
  378.  Message to all Network Operators
  379. msg";
  380.  Normal message to a channel
  381. privmsg";
  382.  Private message to someone
  383. waitserv
  384. who";
  385. names";
  386. quit;
  387. lusers;
  388. names";
  389. summon;
  390. quote";
  391. time;
  392. away;
  393. invite;
  394. links";
  395. topic";
  396. whois";
  397. help;
  398. list;
  399. motd;
  400. users";
  401. whowas;
  402. channel";
  403. admin";
  404. PONG;
  405. user;
  406. nick;
  407. kick;
  408. mode;
  409. version";
  410. kill;
  411. info;
  412. stats";
  413. %Parity";
  414. PART;
  415. JOIN;
  416. voice";
  417.  Reply to /WHO - Don't ask what all this does.
  418. Status
  419.           
  420. -OPER"
  421. Host$
  422.  Messages beginning with a :
  423. PART;
  424.  has left Channel 
  425. JOIN;
  426.  Channel change messages
  427.  Update status bar if the user running
  428.  IRC.EXE was the one changing.
  429.  has joined channel 
  430. NICK;
  431.  Nickname changes.
  432. is now known as 
  433.  If you are using /IGNORE on a person, and they are in
  434.  the current channel, and they change nicks, change the
  435.  IGNORE variable approp.
  436. QUIT;
  437.  Sign off messages.
  438.  has signed off.
  439. TOPIC";
  440.  Topic change messages
  441. *** Topic Changed by "
  442.  to: "
  443. INVITE;
  444.  Messages inviting user to a channel
  445.  has invited you to channel 
  446. NOTICE;
  447.  Notices from a certain person/serverc
  448. serv$
  449. PRIVMSG";
  450.  Private Messages
  451. PRIVMSG"$
  452. VERSION"
  453. privmsg 
  454.  is running Merit IRC Version 
  455. privmsg 
  456.  is IGNORING you."
  457. MSG";
  458.  Channel Messages
  459. MODE;
  460.  MODE Change notices
  461. *** Mode Change by "
  462. 481";
  463. You are not the channel operator."
  464. 473";
  465. You must be invited to that channel.
  466. 461";
  467. No User Specified for /kill!
  468. 441";
  469. You have not joined a channel!
  470. 433";
  471.  Change nick back to old nick if new nick is in usen
  472. That nickname is already in use!
  473. 421";
  474. 412";
  475. No Text to send!
  476. 411";
  477. No Recipient given!"
  478. 404";
  479. That channel does not allow private messages to it."
  480. 403";
  481. Invalid Channel.
  482. 401";
  483. The user is not logged on.
  484. 391";
  485. 366";
  486. *** End of /NAMES List
  487. 365";
  488. *** End of /LINKS list
  489. 341";
  490.  User inviting someone else to a channel.g
  491. *** You have invited "
  492. to Channel
  493. 332";
  494.  Channel Topic given when entering a channel
  495.  Variable used for 2.6 onlye
  496. *** Channel ("
  497. ) Topic: "
  498. 324";
  499.  Show the current channel's mode
  500. Channel ("
  501. )'s mode:"
  502. 323";
  503. *** End of /LIST
  504. 322";
  505.  Reply from a /LIST.
  506. -*Private*-"
  507. 321";
  508.  /LIST header
  509. CHANNEL #    # of Users    Topic Of Channel"
  510. 317";
  511. *** Last command received at "
  512. 316";
  513. is a channel operator.
  514. 315";
  515. *** End of /WHO"
  516. 314";
  517.  Whowas reply.
  518.  was "
  519. 313";
  520. is a network operator.
  521. 312";
  522. 312"$
  523. *** Using Server "
  524. 311";
  525.  /WHOIS reply
  526. 311"$
  527. ) on channel "
  528. 301";
  529.  Away reply
  530.  Filter out Join,ModeChange,Leave,Quit, Etc garbagea
  531.  I want to put in a thing to allow multiple Query's.
  532.  Also, I would like to fix the Change-Channel while inputing problemss
  533.  but that may require re-working several routines.
  534.  Put to last line on screenk
  535.  ** Execute only ON INITIAL CALL **X
  536.    ** Dimension our Chat History buffer TO 50 lines **
  537.      ** Set TypeMode to Insert(1), not Overstrike(0) **5
  538. 'RETURN
  539.  This funny looking character was
  540.  selected by Tom on the Amiga version.
  541.  I have NO idea how to type it in MSDOS.
  542.   -- EB 
  543. 'BACKSPACE
  544. 'PAGE UP
  545. 'PG DN
  546. 'ALT-C
  547. Channel Listing:d
  548. 'DELETE
  549. 'LEFT
  550. 'RIGHT
  551. 'DOWN
  552. 'HOME
  553. 'CLEAR
  554. 'MODE TOGGLE
  555. 'VALID CHARACTER
  556.  ** INSERT **
  557.  ** OVERSTRIKE **
  558.  ** APPEND **
  559. DrawCursor
  560. StatusLine
  561.  MS-DOS IRC Version \    \ Compiled on \         \                        \   \ 
  562.    N:\       \ C:\            \ Q:\       \ I:\       \ _*_* NO ECHO_! _*_* \    \   "
  563.    N:\       \ C:\            \ Q:\       \ I:\       \ R:\          \ \    \   
  564. ModString
  565.  Insert Server
  566.  Insert Queried user
  567.  Insert Channel name/#
  568.  Insert your nickname
  569.  "Target" of input. See docs.    
  570. SetFlags
  571.  Sets Flags$ variable
  572. HelpSystem
  573.  This routine needs to be re-written very badly. I think it will be next
  574.  right after I make sure that the new stuff works properly. 
  575.  Set Error routine to check for filesf
  576.  Marc Unangst requested that it doesn't clear screen anymore.
  577.  ParseString "/clear"
  578.  ' Clear screen
  579.  If no topic is specified, grab the list of topics.h
  580. topics
  581.  Check for screen paging.,
  582. [Q]uit, or any other key to continue."d
  583.  Set error routine back to normal. This MUST
  584.  be done at the end of this subroutine, or
  585.  any error except file not found WILL crash IRC.EXE!
  586. LoadConfig
  587. irccnfg.sys"d    
  588. Your configuration is for version 
  589. . Please configure."
  590. ReadFile
  591. /TYPE 
  592. /READ 
  593. ERROR: Cannot nest /READ or /TYPE. File aborted.d
  594. privmsg 
  595. privmsg 
  596. JoinChannel
  597.  Find a blank channel to stuff the entry intoo
  598.  if no blank entries, say we're on the max channel, and remove ourselves from
  599.  the newly joined channel.
  600. You are on the maximum number of channels allowed.d
  601. PART "
  602. LeaveChannel
  603.  Find our entry in the Channels$() array
  604. NextArg
  605. Toggle
  606.  Set up view window, locate to the right line.
  607.  Figure out the length of the prefix (# of chars until first space - 1) 
  608.  Do the formatting tricks
  609.  Handle recording to a file"
  610.  If we aren't echoing to screen, exit the routine, set y to the current line
  611.  Set the correct color
  612.  If we're scrolling, ignore the wrap stuff, just print it, and get out
  613.  We need to figure out how many lines this will take, and to get the current
  614.  cursor position
  615.  Now we figure out what line the text will end up at. 
  616.  And now we start the text work.
  617.  We need to clean all the lines between here and 22.
  618.  Here we print the text, being careful not to scroll
  619.  Locate back to the top of the screen to put the cursor up.o
  620.  set the "cursor" color, print the cursor, clear the rest of the linec
  621.  Set the current cursor line, get out.
  622.  Now when the New Cursor Line is a bit out of range, we pop down to this one
  623.  LTP = Lines To Print before moving to Top of screen.w
  624.  Again, clear all the lines to 22.
  625.  Print the first part of the text, making sure not to scroll
  626.  Pop back up to the top to finish printing the textt
  627.  Set the New NewLine (ie, 24 - 22 = line 2)t
  628.  Clear the lines between 1 and the NewLine
  629.  Print the rest of the text
  630.  Set the new Cursor Line
  631.  Print the "cursor" 
  632.