home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / irclient / !IRClient / Scripts / Magrathea (.txt)
Encoding:
RISC OS BBC BASIC V Source  |  1997-03-21  |  36.5 KB  |  1,513 lines

  1.  >Magrathea
  2.  IRClient script 
  3.  Gerph + Zarni 1996
  4.  Please refer to documentation for details
  5.  0,"This is an IRClient script and cannot be run."
  6.  At the very start we do this lot - called by Internal.Boot
  7. MagratheaAwakes
  8.  The version of magrathea this is
  9. magver$="1.19"
  10.  Make some sensible version string to return to user
  11. Version$=
  12. Version,2,4)
  13. "Version$="IRClient v"+Version$
  14. Version,"nregistered")<>0 
  15.  Version$+=" (Unregistered)"
  16. 7Version$+=", Magrathea v"+magver$+" (Gerph+Zarni)."
  17.  Initialise various path variables
  18. Claim(256)
  19.  "OS_ReadVarVal","IRClient$Dir",mem,256,0,3 
  20.  ,,read
  21. ?(mem+read)=0
  22.  magrathea$=($mem)+".Scripts"
  23. Release(mem)
  24. )magrathea_mods$=magrathea$+".Modules"
  25. &magrathea_user$=magrathea$+".User"
  26. debug=
  27. "SendingToDisplay$="##server##"
  28. OurNick$=
  29. GetNickname
  30.  "Hourglass_Start",1
  31. StartupStatus("Initialising Magrathea...")
  32.  We desperately need the utils to handle simple things
  33.  magrathea$+".Default.Utils.!Module"
  34. Utils_Initialise
  35.  Delay so that Hourglass comes on - the doggysoft one has probs
  36.  "Hourglass_LEDs",1,
  37.  We need GDBM to handle the database functions
  38.  magrathea$+".Default.GDBM.!Module"
  39. DB_Initialise
  40.  We need to load the standard configuration module
  41.  magrathea$+".Default.Config"
  42.  We'll need the Dependency handler to load our extensions
  43.  in the correct order.
  44. StartupStatus("Loading modules...")
  45.  magrathea$+".Default.Dependency"
  46.  You should use Initialised to spot when the module has been
  47.  initialised if you are likely to overload very basic routines
  48. Initialised=
  49. Dependency_LoadModules
  50.  Now we initialise all the libraries
  51.  "Hourglass_LEDs",2,
  52. StartupStatus("Initialising modules...")
  53. InitialiseModule
  54. Initialised=
  55.  If the hourglass remains on then one module is not passing
  56.  the call on - I'll switch it off anyhow...
  57.  "Hourglass_Off"
  58.  If I ever need to handle them, this is where it'll be !
  59. WimpMessage_Received(message,block)
  60.  PRINT"Message "+STR$message
  61. @(message,block)
  62.  Any menu entries we feel like adding
  63. Overload_AddMenuEntries(name$)
  64.  name$ 
  65.  "_User_Action"
  66.  user$,chan$
  67.   user$=
  68. GetMenuParameter
  69.   chan$=
  70. GetMenuChannel
  71. AddMenuEntry("Slap","Action("""+chan$+""",""slaps "+user$+" around the face with a twelve storey building"")",0,0,"")
  72.  "_CTCPList"
  73.  user$,chan$
  74.   user$=
  75. GetMenuParameter
  76. AddMenuEntry("Scripts","CTCP_DoScripts("""+user$+""")",0,0,"")
  77. AddMenuEntry("Source","CTCP_DoSource("""+user$+""")",0,0,"")
  78. @(name$)
  79. Session_Initialise(server$,port,ircflag)
  80.  Remember them for later
  81. IRC_Server$=server$
  82. IRC_Port=port
  83.  Cache our nick name
  84. OurNick$=
  85. GetNickname
  86. registered=
  87.  Initialise the MOTD and main IRC sockets
  88. MasterBuffer = 
  89. NewBuffer
  90. b\MasterSocket = 
  91. Connect(server$,port,"MasterConnected","MasterError","MasterIncoming",0)
  92.  MasterSocket = 0 
  93. Offline
  94. Notify("Unable to resolve that hostname")
  95. SelectNoFocus
  96. SendToIRC("NICK "+OurNick$)
  97. SendToIRC("USER "+
  98. GetUsername+" * * :"+
  99. GetIRLname)
  100. Connecting(server$,port)
  101.  Called when all the modules have initialised
  102.  (ie others overload this routine)
  103. InitialiseModule
  104.  Called to find out what scripts are available
  105. Overload_ScriptInfo(num)
  106.  Called when all the modules have shutdown
  107. ShutdownModule(mask)
  108. y    =mask
  109.  Called just before we exit - modules should overload if
  110.  they use persistent files or caching (I think)
  111. Finalise
  112. AbortConnection
  113. CloseInputBox
  114. Disconnect
  115.  Called as we begin to connect
  116. Connecting(server$,port)
  117. List_Reset
  118. MasterError(i1,i2,reason$)
  119. Notify("Error: "+reason$)
  120. CloseInputBox
  121. Disconnect
  122. MasterIncoming(i1,i2)
  123.  numbytes,str$
  124. .numbytes=
  125. ReadToStaticBuffer(MasterSocket)
  126. BufferAdd(MasterBuffer,
  127. StaticBufferAddr,numbytes)
  128. )str$=
  129. GetLineFromBuffer(MasterBuffer)
  130. (str$)
  131. IRCLine(str$)
  132. * str$=
  133. GetLineFromBuffer(MasterBuffer)
  134. MasterConnected(i1,i2)
  135. Online
  136. OpenInputBox(0)
  137. OpenServerWindow
  138.  This routine is called when the disconnect menu is clicked
  139. Disconnect
  140. Offline
  141. Close(MasterSocket)
  142. FreeBuffer(MasterBuffer)
  143. Disconnected
  144.  Called when we disconnect - by any means
  145. Disconnected
  146.  mask,LeaveInputBox,ConnectionsOpen
  147.  Shuts down /all/ modules
  148. LeaveInputBox=1
  149.  Connections open is not currently used although it is shown
  150. ConnectionsOpen=8
  151. mask=
  152. ShutdownModule(0)
  153.  (mask 
  154.  1)=0 
  155. CloseInputBox
  156.  (mask 
  157.  (255*ConnectionsOpen))>0 
  158. Notify(
  159. (mask/256))
  160. DisplaySelected(display$)
  161. display$,2)<>"##" 
  162. display$,1)="#" 
  163.  display$="" 
  164. SelectChannel(display$)
  165. SelectUser(display$)
  166. Overload_DisplaySelected(display$)
  167. SelectUser(user$)
  168. SetPreInput("*"+OurNick$+"* ")
  169. SetInputTitle(OurNick$+", talking to "+user$)
  170. SetFocus(user$)
  171. SetDisplayForRecall(user$)
  172. SendingToDisplay$=user$
  173. SelectChannel(channel$)
  174. SetPreInput("<"+OurNick$+"> ")
  175.  channel$<>"" 
  176. SetInputTitle(OurNick$+", Talking to channel "+channel$)
  177. SetDisplayForRecall(channel$)
  178. SetInputTitle(OurNick$+", Talking to IRC server")
  179. SetDisplayForRecall("##server##")
  180. SendingToDisplay$=channel$
  181. SetFocus(channel$)
  182. @(channel$)
  183.  Call this when you drop the current focus
  184. SelectNoFocus
  185. SelectChannel("")
  186. JoinChannel(channel$)
  187. NewChannel(channel$,32,"Channel "+channel$,0,0)
  188. UpdateUser(OurNick$,channel$,0)
  189. SelectChannel(channel$)
  190. SendToIRC("MODE "+channel$)
  191. LeftChannel(channel$)
  192. DeleteChannel(channel$)
  193. KillDisplay(channel$)
  194.  SendingToDisplay$=channel$ 
  195. SelectNoFocus
  196. IRCLine(line$)
  197. line$,1)=":" 
  198. 2    
  199.  debug 
  200. Display(line$, "", "##Debug##")
  201.     line$=
  202. line$,2)
  203.     from$=
  204. oneparam(line$)
  205.     line$=
  206. moveon(line$)
  207. !    command$=
  208. oneparam(line$)
  209.     line$=
  210. moveon(line$)
  211.     to$=
  212. oneparam(line$)
  213.     line$=
  214. moveon(line$)
  215. (command$)<>0 
  216. 5      
  217. Overload_ServerResponse(
  218. (command$),line$)
  219.         
  220.       nick$=
  221. getnick(from$)
  222. #      userid$=
  223. getuserid(from$)
  224. E      
  225. Overload_ServerMessage(from$,nick$,userid$,command$,line$)
  226.         
  227. line$,4)="PING" 
  228. 7      
  229.  Send directly, avoiding any caching present
  230. 5      
  231. SendString(MasterSocket,"PONG "+
  232. line$,6))
  233.         
  234. 2      
  235. Display("*-> "+line$, "", "##server##")
  236.         
  237.  Overloads for hooking onto...
  238. Overload_On_Kick(victim$,chan$,by$,uid$,reason$)
  239. DisplayInfo("*** "+victim$+" has been kicked off channel "+chan$+" by "+by$+" ("+reason$+")",chan$)
  240. Overload_On_Part(nick$,chan$,uid$)
  241. DisplayInfo("*** "+nick$+" ("+uid$+") has left channel "+chan$,chan$)
  242. DeleteUser(nick$,chan$)
  243. Overload_On_Nick(nick$,chan$,uid$,new$)
  244. DisplayInfo("*** "+nick$+" ("+uid$+") has changed his nickname to "+new$,chan$)
  245. Overload_On_Quit(nick$,chan$,uid$,message$)
  246. DisplayInfo("*** "+nick$+" ("+uid$+") has left IRC ("+message$+")",chan$)
  247. Overload_On_Join(nick$,chan$,uid$)
  248. DisplayInfo("*** "+nick$+" ("+uid$+") has joined channel "+chan$,chan$)
  249. Overload_On_Say(nick$,chan$,uid$,message$)
  250. MessageToDisplay(message$,nick$,chan$)
  251. Overload_On_Notice(nick$,chan$,uid$,message$)
  252. MessageToDisplay(message$,nick$,"-"+chan$)
  253. Overload_ServerMessage(from$,nick$,userid$,command$,line$)
  254.  command$ 
  255.  "JOIN":
  256.  nick$=OurNick$ 
  257. JoinChannel(to$)
  258. ,+   
  259. Overload_On_Join(nick$,to$,userid$)
  260. UpdateUser(nick$,to$,0)
  261.  "TOPIC":
  262.  topic$
  263.   topic$=
  264. oneparam(line$)
  265.  nick$=OurNick$ 
  266. 3=   
  267. DisplayInfo("*** You have changed the topic to:",to$)
  268. 5P   
  269. DisplayInfo("*** "+nick$+" ("+userid$+") has changed the topic to:",to$)
  270. CentredDisplay("*** "+topic$+" ***",from$,to$)
  271. ChangeChannelTopic(to$,topic$)
  272.  "NICK":
  273.  newnick$,display$
  274.   newnick$=to$
  275.  nick$=OurNick$ 
  276. SetNickname(newnick$)
  277.    OurNick$=newnick$
  278. @*   
  279. DisplaySelected(SendingToDisplay$)
  280. A    display$=
  281. FindUser(nick$)
  282.  display$="" 
  283. CG    
  284. DisplayInfo("*** You are now known as "+newnick$,"##server##")
  285.  display$<>""
  286. FD     
  287. DisplayInfo("*** You are now known as "+newnick$,display$)
  288. G$     
  289. DeleteUser(nick$,display$)
  290. H'     
  291. SendToIRC("NAMES :"+display$)
  292. I"     display$=
  293. FindUser(nick$)
  294. J        
  295. M    display$=
  296. FindUser(nick$)
  297.  display$<>""
  298. O:    
  299. Overload_On_Nick(nick$,display$,userid$,newnick$)
  300. P#    
  301. DeleteUser(nick$,display$)
  302. Q&    
  303. SendToIRC("NAMES :"+display$)
  304. R!    display$=
  305. FindUser(nick$)
  306.  "PART":
  307.  nick$=OurNick$ 
  308. LeftChannel(to$)
  309. Z+   
  310. Overload_On_Part(nick$,to$,userid$)
  311.  "KICK":
  312.  victim$,reason$
  313.   victim$=
  314. oneparam(line$)
  315. `'  reason$=
  316. oneparam(
  317. moveon(line$))
  318.  reason$="" 
  319.  reason$="No reason given"
  320.  victim$=OurNick$ 
  321. cn   
  322. DisplayWarning("*** You have been kicked off channel "+to$+" by "+nick$+" ("+reason$+")","##server##")
  323. LeftChannel(to$)
  324. f;   
  325. Overload_On_Kick(victim$,to$,nick$,userid$,reason$)
  326. DeleteUser(victim$,to$)
  327.  "KILL"
  328.  reason$
  329.   reason$=
  330. oneparam(line$)
  331.  reason$="" 
  332.  reason$="No reason given"
  333.  to$=OurNick$ 
  334. oN   
  335. DisplayError("*** You have been killed by "+nick$+" ("+reason$+")","")
  336. q    display$=
  337. FindUser(nick$)
  338.  display$<>""
  339. sW    
  340. DisplayInfo("*** "+to$+" has been killed by "+nick$+" ("+reason$+")",display$)
  341. t!    
  342. DeleteUser(to$,display$)
  343.     display$=
  344. FindUser(to$)
  345.  "QUIT":
  346.  message$
  347.   message$=to$
  348.  message$="" 
  349.  message$="No reason"
  350.   display$=
  351. FindUser(nick$)
  352.  display$<>""
  353. Overload_On_Quit(nick$,display$,userid$,message$)
  354. DeleteUser(nick$,display$)
  355.     display$=
  356. FindUser(nick$)
  357.  "MODE":
  358. ModeChange(to$,nick$,line$)
  359.  "PRIVMSG":
  360.  message$
  361.   message$=
  362. oneparam(line$)
  363. message$,1)=
  364. CTCP_request(to$,nick$,message$)
  365. to$,1)<>"#" 
  366.  to$=nick$
  367. Overload_On_Say(nick$,to$,userid$,message$)
  368.  "NOTICE":
  369.  message$
  370.   message$=
  371. oneparam(line$)
  372. message$,1)=
  373. CTCP_reply(nick$,message$)
  374. to$,1)<>"#" 
  375.  to$=nick$
  376. Overload_On_Notice(nick$,to$,userid$,message$)
  377. Overload_ServerResponse(code,line$)
  378.  code 
  379.  002:
  380.   line$=
  381. oneparam(line$)
  382. line$,13)="Your host is " 
  383.  IRChost$=
  384. oneparam(
  385. line$,14))
  386. DisplayInfo(line$, "##server##")
  387. RunInitialScript
  388.  221:
  389.   opts$=
  390. oneparam(line$)
  391. DisplayInfo("You are in mode "+opts$,"")
  392.  302:
  393.  RPL_USERHOST
  394.  303:
  395.   users$=
  396. pasteargs(line$)
  397.  users$=" " 
  398. users$="" 
  399. DisplayInfo("There is nobody in the list on IRC", "")
  400. DisplayInfo("The following users are on IRC :","")
  401. CentredDisplay(users$,OurNick$,SendingToDisplay$)
  402.  305:
  403. DisplayInfo("You are no longer marked as being away","")
  404.  306:
  405. DisplayInfo("You are now marked as being away. /AWAY will unmark","")
  406.  321:
  407. KillDisplay("##list##")
  408. NewDisplay("##list##",256,"Results of /LIST",0)
  409.   List_num=0
  410. Notify("Please wait - collecting list")
  411.  322:
  412.   chan$=
  413. oneparam(line$)
  414.   line$=
  415. moveon(line$)
  416.   num$=
  417. oneparam(line$)
  418.   num=
  419.  num$
  420. &  topic$=
  421. oneparam(
  422. moveon(line$))
  423. 0  ok = 
  424. WildcardMatch(List_match$,
  425. chan$,2))
  426.  (ok 
  427.  (num >= List_min) 
  428.  (num <= List_max)) 
  429.  List_num=0 
  430. I    
  431. Display("Channel name            No.Users  Topic","","##list##")
  432.    List_num = List_num+1
  433.    chan$=
  434. chan$,22)
  435.    topic$=
  436. topic$,55)
  437. Display(chan$+
  438.  chan$)," ")+num$+
  439.  num$)," ")+topic$,"","##list##")
  440.  List_num=0 
  441. DisplayInfo("No matching results","##list##")
  442. DisplayInfo(" = "+
  443. (List_num)+" matching channels","##list##")
  444.  301:
  445.   nick$=
  446. oneparam(line$)
  447. '  reason$=
  448. oneparam(
  449. moveon(line$))
  450. DisplayInfo(
  451. Colour(
  452. GetMeColour)+"* "+nick$+" is away: "+reason$,nick$)
  453.  311,312,313,317,318,319:
  454.   nick$=
  455. oneparam(line$)
  456.   line$=
  457. moveon(line$)
  458. DisplayCTCP("WhoIs> "+
  459. pasteargs(line$),
  460. GuessDisplay(nick$))
  461.  369,314:
  462.   nick$=
  463. oneparam(line$)
  464.   line$=
  465. moveon(line$)
  466. DisplayCTCP("WhoWas> "+
  467. pasteargs(line$),
  468. GuessDisplay(nick$))
  469.  353:
  470.   line$=
  471. line$,3)
  472.   channel$=
  473. oneparam(line$)
  474.   line$=
  475. moveon(line$)
  476.   line$=
  477. oneparam(line$)
  478.  line$<>""
  479.    a_nick$=
  480. oneparam(line$)
  481.    line$=
  482. moveon(line$)
  483.    hasops=0
  484. a_nick$,1)="@" 
  485.     hasops=U_HasOps
  486.     a_nick$=
  487. a_nick$,2)
  488. a_nick$,1)="+" 
  489.      hasops=U_HasVoice
  490. B     
  491.  Can we show 'voiced' people with orange, say hasops=2 ?
  492.      a_nick$=
  493. a_nick$,2)
  494.         
  495. UpdateUser(a_nick$,channel$,hasops)
  496.  331:
  497.   channel$=
  498. oneparam(line$)
  499. DisplayInfo("* Channel "+channel$+" has no topic", channel$)
  500. ChangeChannelTopic(channel$,"")
  501.  332:
  502.   channel$=
  503. oneparam(line$)
  504. &  topic$=
  505. oneparam(
  506. moveon(line$))
  507. CentredDisplay("The topic for channel "+channel$+" is "+topic$, from$, channel$)
  508. ChangeChannelTopic(channel$,topic$)
  509.  324:
  510.   channel$=
  511. oneparam(line$)
  512. !  channelmode$=
  513. moveon(line$)
  514. DisplayInfo("* Channel mode for "+channel$+" is "+channelmode$,channel$)
  515. Channel_ModeIs(channel$,channelmode$)
  516.  341:
  517.   channel$=
  518. oneparam(line$)
  519. %  nick$=
  520. oneparam(
  521. moveon(line$))
  522. DisplayInfo("* Inviting "+nick$+" to channel "+channel$,channel$)
  523.   nick$=
  524. oneparam(line$)
  525. DisplayInfo("Summoning "+nick$+" to IRC","")
  526.  367:
  527.   channel$=
  528. oneparam(line$)
  529. &  banid$=
  530. oneparam(
  531. moveon(line$))
  532. DisplayInfo("BanID> "+banid$,channel$)
  533.  366,368:
  534.  Ignore messages
  535.  401:
  536.   nick$=
  537. oneparam(line$)
  538. DisplayWarning("*** "+nick$+" is not on IRC at present", 
  539. GuessDisplay(nick$))
  540.  404:
  541.   chan$=
  542. oneparam(line$)
  543. DisplayWarning("*** You cannot talk to channel "+chan$+" as you do not have enough priveledges to do so","")
  544.  422,375
  545.   registered=
  546. DisplayInfo("*** "+
  547. pasteargs(line$), "##server##")
  548.  432:
  549. DisplayWarning("You have specified an illegal nickname.  Use /NICK <nickname> to choose another one","##server##")
  550.  registered 
  551.  OurNick$="!"
  552.  433:
  553. DisplayWarning("The nickname you have chosen is already in use.  Use /NICK <nickname> to choose another one","")
  554.  registered 
  555.  OurNick$="!"
  556.  443:
  557.   nick$=
  558. oneparam(line$)
  559. 4%  chan$=
  560. moveon(
  561. oneparam(line$))
  562. DisplayWarning(nick$+" is already on "+chan$, chan$)
  563.  451:
  564. SendToIRC("USER "+OurNick$+" * * :"+
  565. GetIRLname)
  566.  461:
  567.   line$=
  568. oneparam(line$)
  569. DisplayWarning("Bad parameters used for "+line$,"")
  570.  482:
  571.   chan$=
  572. oneparam(line$)
  573. DisplayWarning("*** You are not an operator on channel "+chan$,chan$)
  574. DisplayInfo(
  575. pasteargs(line$), "##server##")
  576. ModeChange(chan$,nick$,change$)
  577.  who$,rest$,dir,c$,person$
  578. rest$=
  579. oneparam(change$)
  580. who$=
  581. moveon(change$)
  582. rest$,1)="+") 
  583.  dir = 1
  584.  dir = -1
  585. rest$=
  586. rest$,2)
  587. who$,1)="" 
  588. DisplayInfo("* Channel mode change by "+nick$+" ("+
  589. Strip(change$)+")",chan$)
  590. SendToIRC("MODE :"+chan$)
  591. change$,"+l")=0 
  592. DisplayInfo("* Mode change by "+nick$+" ("+
  593. Strip(change$)+")",chan$)
  594.   c$=
  595. rest$,1)
  596.   rest$=
  597. rest$,2)
  598.  "o","O"
  599.     person$=
  600. oneparam(who$)
  601.     who$=
  602. moveon(who$)
  603.  IF dir=1 THEN
  604. `1     
  605.  PROCUpdateUser(person$,chan$,U_HasOps)
  606.  ELSE
  607. b*     
  608.  PROCUpdateUser(person$,chan$,0)
  609.  ENDIF
  610. d#    
  611. SendToIRC("NAMES :"+chan$)
  612.  "v","V"
  613. f#    
  614. SendToIRC("NAMES :"+chan$)
  615.     num=
  616. oneparam(who$))
  617.     who$=
  618. moveon(who$)
  619. kH    
  620. DisplayInfo("* Mode change by "+nick$+" (+l "+
  621. (num)+")",chan$)
  622.  c$=""
  623. CTCP_reply(from$,message$)
  624.  command$,tim
  625. s)  message$=
  626. message$,2,
  627. (message$)-2)
  628. t"  command$=
  629. oneparam(message$)
  630. u   message$=
  631. moveon(message$)
  632.  command$ 
  633.  "PING":
  634.       tim=(
  635. (message$)))
  636. yC      
  637. TellUserCTCPReply(command$,from$,
  638.  tim+" centi-seconds")
  639.  "ERRMSG":
  640. {&      command$=
  641. oneparam(message$)
  642. |$      message$=
  643. moveon(message$)
  644. }2      
  645.  message$<>"" 
  646.  message$=" : "+message$
  647. ~>      
  648. DisplayCTCP("CTCP Error for "+command$+message$,"")
  649. =      
  650. Overload_UnknownCTCPReply(from$,command$,message$)
  651. CTCP_request(to$,from$,message$)
  652.  command$,prefix$,notify
  653.   notify=
  654. )  message$=
  655. message$,2,
  656. (message$)-2)
  657. /  command$=
  658. Capitalise(
  659. oneparam(message$))
  660.    message$=
  661. moveon(message$)
  662.  command$ 
  663.  "ECHO","PING":
  664. 1      
  665. SendCTCPReply(from$,command$,message$)
  666.  "VERSION":
  667. 1      
  668. SendCTCPReply(from$,command$,Version$)
  669.  "ACTION":
  670. +      prefix$=
  671. ReturnPadded("* "+from$)
  672.       
  673. to$,1)="#" 
  674. Y        
  675. Display(
  676. Colour(
  677. GetMeColour)+prefix$+" "+
  678. BoldYourNick(message$),from$,to$)
  679.       
  680. !        
  681. CreateUserWin(from$)
  682. ^        
  683. Display(
  684. Colour(
  685. GetMeColour)+prefix$+" "+
  686. BoldYourNick(message$),OurNick$,from$)
  687.         
  688.  msgbeep 
  689.       
  690.       notify=
  691.  "FINGER","USERINFO":
  692. I      
  693. SendCTCPReply(from$,command$,
  694. GetUsername+"("+
  695. GetIRLname+")")
  696.  "CLIENTINFO":
  697. !      
  698. CTCP_ClientInfo(from$)
  699.  "TIME":
  700. 2      
  701. SendCTCPReply(from$,command$,
  702. ReadTime)
  703.  "MACHINEINFO":
  704. ,      
  705.  "Wimp_ReadSysInfo",0 
  706.  NumTasks
  707. /      
  708.  "Wimp_ReadSysInfo",7 
  709.  WimpVersion
  710. 3      
  711.  "OS_ReadMemMapInfo" 
  712.  Memsize,Mempages
  713. B      WimpVersion$=
  714. (WimpVersion/100)+"."+
  715. (WimpVersion 
  716.  100)
  717.       
  718. SendCTCPReply(from$,command$,
  719. ((Memsize*Mempages)/(1024*1024))+"Mb, "+
  720.  NumTasks+" tasks running under Risc OS "+WimpVersion$)
  721.  "SOURCE":
  722.       
  723. SendCTCPReply(from$,command$,"This script is not currently available for distribution - mail gerph@essex.ac.uk for details")
  724.  "ERRMSG":
  725. ?      
  726. SendCTCPReply(from$,command$,message$+" :Worked ok")
  727.       notify=
  728. C      
  729. Overload_UnknownCTCPRequest(from$,to$,command$,message$)
  730.  notify 
  731. TellUserCTCP(command$,from$)
  732. CTCP_ClientInfo(from$)
  733.  a$,num,b$
  734. ca$="ECHO PING ACTION VERSION ERRMSG FINGER USERINFO MACHINEINFO CLIENTINFO TIME SOURCE SCRIPTS"
  735.     num=0
  736.    b$=
  737. Overload_ListCTCP(num)
  738.  b$<>"" 
  739.  a$+=" "+b$
  740.   num+=1
  741.  b$=""
  742. SendCTCPReply(from$,"CLIENTINFO",a$)
  743.  Overload_UnknownCTCPRequest : /CTCP <command> done
  744.  You should overload this routine and pass it on if you
  745.  don't respond
  746. Overload_UnknownCTCPRequest(from$,to$,com$,message$)
  747.  num,a$
  748.  com$ 
  749.  "SCRIPTS"
  750.   num=0
  751. #   b$=
  752. Overload_ScriptInfo(num)
  753.  b$<>"" 
  754. SendCTCPReply(from$,"SCRIPTS",
  755. (num+1)+": "+b$)
  756.    num+=1
  757.  b$=""
  758. to$,1)="#" 
  759. DisplayCTCP("Unknown CTCP '"+com$+"' received from "+from$,to$)
  760. DisplayCTCP("Unknown CTCP '"+com$+"' received from "+from$,
  761. GuessDisplay(from$))
  762.   notify=
  763.  Overload_UnknownCTCPReply : Reply from other end
  764. Overload_UnknownCTCPReply(from$,command$,str$)
  765. TellUserCTCPReply(command$,from$,str$)
  766.  Overload_ListCTCP : List all CTCP requests available
  767.  Overload with :
  768.  DEFFNOverload_ListCTCP(count)
  769.  LOCAL ret$
  770.  IF count=0 THEN
  771.   ret$="<command>"
  772.  ELSE
  773.   ret$=FN@(count-1)
  774.  ENDIF
  775.  =ret$
  776.  Multiple commands should be space seperated
  777. Overload_ListCTCP(count)
  778.  ret$
  779.  count=0 
  780.  ret$=""
  781. DisplayError("Someone hasn't done ListCTCP properly...","")
  782.  ret$=""
  783.     =ret$
  784.  Will give the name of the channel if you are on a channel
  785. GuessDisplay(from$)
  786.  ret$
  787. SendingToDisplay$,1)="#" 
  788.  ret$=SendingToDisplay$
  789. Capitalise(from$)=
  790. Capitalise(SendingToDisplay$) 
  791. FindDisplay(from$) 
  792.    ret$=from$
  793.    ret$=SendingToDisplay$
  794. =SendingToDisplay$
  795.  LOCAL ret$
  796.  IF FNFindUserChan(from$,SendingToDisplay$) OR FNCapitalise(SendingToDisplay$)=FNCapitalise(from$) THEN
  797.      
  798.  ret$=SendingToDisplay$
  799.  ELSE
  800. &    
  801.  IF FNFindDisplay(from$) THEN
  802.       
  803.  ret$=from$
  804.  ELSE
  805. "      
  806.  ret$=FNFindUser(from$)
  807.       
  808.  IF ret$="" THEN
  809.         
  810.  ret$="##server##"
  811.       
  812.  ENDIF
  813.  ENDIF
  814.  ENDIF
  815.  =ret$
  816. TellUserCTCP(command$,from$)
  817. DisplayCTCP("CTCP "+command$+" received from "+from$,
  818. GuessDisplay(from$))
  819. TellUserCTCPReply(command$,from$,message$)
  820. DisplayCTCP("CTCP "+command$+" reply received from "+from$+" ("+message$+")",
  821. GuessDisplay(from$))
  822. Channel_ModeIs(channel$,mode$)
  823. UpdateChannel(channel$,
  824. ChannelFlags(mode$))
  825. ChannelFlags(mode$)
  826.  flags
  827. flags = 0
  828.  mode$<>""
  829. mode$,1) 
  830.  "t" :
  831.    flags = flags 
  832.  CF_Topic
  833.  "n" :
  834.    flags = flags 
  835.  CF_Msgs
  836.  "i" :
  837. !    flags = flags 
  838.  CF_Invite
  839.  "m" :
  840. ##   flags = flags 
  841.  CF_Moderated
  842.  "s" :
  843. %    flags = flags 
  844.  CF_Secret
  845.  "p" :
  846. '!   flags = flags 
  847.  CF_Private
  848.  "l" :
  849. )!   flags = flags 
  850.  CF_Limited
  851.  mode$=
  852. mode$,2)
  853. =flags
  854. Join(channel$)
  855. SendToIRC("JOIN :"+channel$)
  856. Leave(channel$)
  857. SendToIRC("PART :"+channel$)
  858. UserLine(str$)
  859.  command$,prefix$,found
  860. SendingToDisplay$,2)="##" 
  861. Overload_UserLine(str$)
  862.  str$<>"" 
  863. str$,1)<>"/" 
  864. >#      
  865.  SendingToDisplay$<>"" 
  866. ?-        str$=
  867. Overload_AboutToSay(str$,0)
  868. @(        
  869. Say(SendingToDisplay$,str$)
  870.       
  871. B        
  872. C3      command$=
  873. Capitalise(
  874. oneparam(
  875. str$,2)))
  876. D       str$=
  877. moveon(
  878. str$,2))
  879.       
  880.  command$ 
  881.         
  882.  "ME":
  883. G/          str$=
  884. Overload_AboutToSay(str$,1)
  885. H-          
  886. Action(SendingToDisplay$,str$)
  887.         
  888.  "DESCRIBE":
  889. J!          to$=
  890. oneparam(str$)
  891. K8          str$=
  892. Overload_AboutToSay(
  893. moveon(str$),1)
  894. L!          
  895. CreateUserWin(to$)
  896.           
  897. Say(to$,str$)
  898.         
  899.  "QUIT"
  900. O(          
  901.  str$="" 
  902.  str$="Leaving"
  903. P,          
  904. SendToIRC(command$+" :"+str$)
  905.         
  906.  "JOIN","PART":
  907. R,          
  908. SendToIRC(command$+" :"+str$)
  909.         
  910.  "LEAVE":
  911. T'          
  912. SendToIRC("PART :"+str$)
  913.         
  914.  "QUERY":
  915.           
  916.  str$="" 
  917. W3            
  918. DisplayWarning("* Query whom?","")
  919.           
  920. Y             
  921. str$,2)="#" 
  922. ZC              
  923. DisplayWarning("* Query whom? (must be a user)")
  924.             
  925. \*              
  926. UserDoubleClicked(str$)
  927.             
  928.           
  929.         
  930.  "MSG":
  931. `!          to$=
  932. oneparam(str$)
  933. a2          
  934. to$,1)<>"#" 
  935. CreateUserWin(to$)
  936. b8          str$=
  937. Overload_AboutToSay(
  938. moveon(str$),0)
  939. cP          
  940.  PROCDisplay("->*"+to$+"* "+FNmoveon(str$),OurNick$,"##Server##")
  941.           
  942. Say(to$,str$)
  943.         
  944.  "SAY"
  945. gJ          
  946. SendingToDisplay$,2)<>"##" 
  947. Say(SendingToDisplay$,str$)
  948.         
  949.  "NOTICE":
  950. j!          to$=
  951. oneparam(str$)
  952. k2          
  953. to$,1)<>"#" 
  954. CreateUserWin(to$)
  955. l:          
  956. SendToIRC("NOTICE "+to$+" :"+
  957. moveon(str$))
  958. mP          
  959.  PROCDisplay("->*"+to$+"* "+FNmoveon(str$),OurNick$,"##Server##")
  960. n?          
  961. MessageToDisplay(
  962. moveon(str$),OurNick$,"-"+to$)
  963.         
  964.  "CTCP":
  965. q$          whoto$=
  966. oneparam(str$)
  967. r           str$=
  968. moveon(str$)
  969. sN          
  970. CTCP_Command(whoto$,
  971. Capitalise(
  972. oneparam(str$)),
  973. moveon(str$))
  974.         
  975.  "SCRIPTS"
  976.           
  977. DoScripts
  978.         
  979.  "PING":
  980. w8          
  981. CTCP_Command(
  982. oneparam(str$),"PING",
  983. x;          
  984.  PROCSendCTCPRequest(str$,"PING",STR$(TIME))
  985.         
  986.  "UMODE":
  987. z3          
  988. SendToIRC("MODE "+OurNick$+" "+str$)
  989.         
  990.  "QUOTE","RAW":
  991.           
  992. SendToIRC(str$)
  993.         
  994.  "TEST":
  995.          
  996. IRCLine(str$)
  997.         
  998.  "KICK"
  999.           
  1000. DoKick(str$)
  1001.         
  1002.  "NICK"
  1003. &          
  1004. SendToIRC("NICK "+str$)
  1005.           
  1006.  OurNick$="!" 
  1007.             OurNick$=str$
  1008. "            
  1009. SetNickname(str$)
  1010.           
  1011.         
  1012.  "INVITE"
  1013.           
  1014. DoInvite(str$)
  1015.         
  1016.  "LIST"
  1017.           
  1018. DoList(str$)
  1019.         
  1020.  "TOPIC"
  1021.           
  1022. DoTopic(str$)
  1023.         
  1024.  "AWAY"
  1025.           
  1026. DoAway(str$)
  1027.         
  1028.  "MODE"
  1029.           
  1030. DoMode(str$)
  1031.         
  1032.  "SVERSION"
  1033.           
  1034. DoServerVersion
  1035.         
  1036.  "PASS","OPER","WHOIS","WHOWAS","LUSERS","LINKS","TIME","TRACE","ADMIN","INFO","WHO","USERHOST","STATS","ISON","MOTD","SQUIT","SUMMON":
  1037. +          
  1038. SendToIRC(command$+" "+str$)
  1039.         
  1040. 5          
  1041. Overload_UnknownCommand(command$,str$)
  1042.       
  1043.         
  1044. DoServerVersion
  1045. SendToIRC("VERSION")
  1046. DoScripts
  1047.     num=0
  1048. DisplayInfo("You are currently running :","")
  1049. ! b$=
  1050. Overload_ScriptInfo(num)
  1051.  b$<>"" 
  1052. DisplayInfo("  "+
  1053. (num+1)+": "+b$,"")
  1054.  num+=1
  1055.  b$=""
  1056. DoKick(str$)
  1057.  chan$,nick$,reason$
  1058. str$,1)="#" 
  1059.     chan$=
  1060. oneparam(str$)
  1061.     str$=
  1062. moveon(str$)
  1063.     chan$=SendingToDisplay$
  1064.   nick$=
  1065. oneparam(str$)
  1066.   reason$=
  1067. moveon(str$)
  1068. chan$,1)<>"#" 
  1069. A    
  1070. DisplayWarning("* Kick "+nick$+" off which channel?","")
  1071.  reason$="" 
  1072.       reason$="No reason"
  1073.         
  1074. 8    
  1075. SendToIRC("KICK "+chan$+" "+nick$+" :"+reason$)
  1076. DoInvite(str$)
  1077.  chan$,invite$
  1078. str$,1)="#" 
  1079.     chan$=
  1080. oneparam(str$)
  1081.     str$=
  1082. moveon(str$)
  1083.     chan$=SendingToDisplay$
  1084.   invite$=str$
  1085. chan$,1)<>"#" 
  1086. D    
  1087. DisplayWarning("* Invite "+invite$+" to which channel?","")
  1088. /    
  1089. SendToIRC("INVITE "+invite$+" "+chan$)
  1090. DoTopic(str$)
  1091.  chan$,topic$
  1092. str$,1)="#" 
  1093.     chan$=
  1094. oneparam(str$)
  1095.     str$=
  1096. moveon(str$)
  1097.     chan$=SendingToDisplay$
  1098.   topic$=str$
  1099. chan$,1)<>"#" 
  1100. B    
  1101. DisplayWarning("* Change the topic of which channel?","")
  1102. "    
  1103. ChangeTopic(chan$,topic$)
  1104. DoAway(str$)
  1105.  str$<>"" 
  1106.  str$=":"+str$
  1107. SendToIRC("AWAY "+str$)
  1108. DoMode(str$)
  1109.  chan$,mode$
  1110. str$,1)="#" 
  1111.     chan$=
  1112. oneparam(str$)
  1113.     str$=
  1114. moveon(str$)
  1115.     chan$=SendingToDisplay$
  1116.   mode$=str$
  1117. chan$,1)<>"#" 
  1118. >    
  1119. DisplayInfo("* Change the mode of which channel?","")
  1120. +    
  1121. SendToIRC("MODE "+chan$+" "+mode$)
  1122. List_Reset
  1123.   List_min=0
  1124.   List_max=65536
  1125.   List_match$="*"
  1126. DoList(str$)
  1127.  chan$,com$,val
  1128. List_Reset
  1129. !  List_match$=
  1130. oneparam(str$)
  1131.    str$=
  1132. Strip(
  1133. moveon(str$))
  1134.  str$<>""
  1135. str$,1)="-" 
  1136. /      com$=
  1137. Capitalise(
  1138. oneparam(
  1139. str$,2)))
  1140.        str$=
  1141. moveon(
  1142. str$,2))
  1143.        val=
  1144. oneparam(str$))
  1145.       str$=
  1146. moveon(str$)
  1147.       
  1148.  com$ 
  1149.         
  1150.  "MIN","MINIMUM"
  1151.           List_min=val
  1152.         
  1153.  "MAX","MAXIMUM"
  1154.           List_max=val
  1155.         
  1156. P          
  1157. DisplayWarning("* Unknown list modifier '-"+str$+"' ignored.","")
  1158.       
  1159.         
  1160. K      
  1161. DisplayWarning("* Unknown list modifier '"+str$+"' ignored.","")
  1162.       str$=
  1163. moveon(str$)
  1164.         
  1165.  (List_min > List_max) 
  1166. R    
  1167. DisplayWarning("* Silly.  List minimum > list maximum.  List ignored","")
  1168. 9    
  1169. List_match$,"*")) 
  1170. List_match$,"?")) ) 
  1171.       
  1172. SendToIRC("LIST")
  1173.         
  1174. )      
  1175. SendToIRC("LIST "+List_match$)
  1176.       List_match$="*"
  1177.         
  1178. UserDoubleClicked(user$)
  1179. CreateUserWin(user$)
  1180. SelectUser(user$)
  1181. CreateUserWin(user$)
  1182. NewDisplay(user$,32,OurNick$+"->"+user$,0)
  1183. CentredDisplay(message$,from$,display$)
  1184.  message$ < 80 
  1185. )A    
  1186. Display(
  1187.  message$)/2," ")+message$,from$,display$)
  1188. +)    
  1189. Display(message$,from$,display$)
  1190. Say(chan$,str$)
  1191. SendToIRC("PRIVMSG "+chan$+" :"+str$)
  1192. MessageToDisplay(str$,OurNick$,chan$)
  1193. Action(chan$,str$)
  1194.  prefix$
  1195. SendCTCPRequest(chan$,"ACTION",str$)
  1196. 7(prefix$=
  1197. ReturnPadded("* "+OurNick$)
  1198. Display(
  1199. Colour(
  1200. GetMeColour)+prefix$+" "+str$,OurNick$,chan$)
  1201. MessageToDisplay(message$,from$,display$)
  1202.  prefix$
  1203. display$,1)="-" 
  1204. >) prefix$=
  1205. ReturnPadded("-"+from$+"-")
  1206.  display$=
  1207. display$,2)
  1208. display$,1)="#" 
  1209. B*  prefix$=
  1210. ReturnPadded("<"+from$+">")
  1211. D*  prefix$=
  1212. ReturnPadded("*"+from$+"*")
  1213.  Open a nice window for this user
  1214. CreateUserWin(display$)
  1215. Capitalise(from$)<>
  1216. Capitalise(OurNick$) 
  1217. display$,1)<>"#" 
  1218.  msgbeep=
  1219. Display(prefix$+" "+
  1220. BoldYourNick(message$),OurNick$,display$)
  1221. SendToIRC(m$)
  1222. SendString(MasterSocket,m$)
  1223. SendCTCPReply(to$,command$,message$)
  1224. SendToIRC("NOTICE "+to$+" :"+
  1225. 1+command$+" "+message$+
  1226. SendCTCPError(to$,command$,message$)
  1227. SendToIRC("NOTICE "+to$+" :"+
  1228. 1+"ERRMSG "+command$+" :"+message$+
  1229. SendCTCPRequest(to$,command$,message$)
  1230.  message$<>"" 
  1231.  message$=" "+message$
  1232. ]"command$=
  1233. Capitalise(command$)
  1234. SendToIRC("PRIVMSG "+to$+" :"+
  1235. 1+command$+message$+
  1236. IconbarClick
  1237.  Online 
  1238. OpenInputBox(0)
  1239. OpenServerWindow
  1240. OpenConnect
  1241. ChangeTopic(channel$,topic$)
  1242.  topic$<>"" 
  1243.  topic$=":"+topic$
  1244. SendToIRC("TOPIC "+channel$+" "+topic$)
  1245. ChannelStateChange(chan$,flag,char)
  1246.  gonk$
  1247.  flag 
  1248.  gonk$="+"
  1249.  gonk$="-"
  1250. SendToIRC("MODE "+chan$+" "+gonk$+
  1251.  char)
  1252. ChangeChannelTopic(channel$,topic$)
  1253. (topic$) < 40 
  1254. @(channel$,topic$)
  1255. @(channel$,
  1256. topic$,38)+"...")
  1257.  'special' overload for the menu
  1258. CTCPrequest(CTCP$,whoto$)
  1259. CTCP_Command(whoto$,CTCP$,"")
  1260. CTCP_Command(whoto$,CTCP$,message$)
  1261.  CTCP$="PING" 
  1262. SendCTCPRequest(whoto$,"PING",
  1263. SendCTCPRequest(whoto$,CTCP$,message$)
  1264. Display(what$,from$,to$)
  1265.  to$="" 
  1266.  to$="##server##"
  1267. @(what$,from$,to$)
  1268.  When you want an error displayed (in red)
  1269. DisplayError(mess$,win$)
  1270.  win$="" 
  1271. mess$,1)<>"*" 
  1272.  mess$="*** "+mess$
  1273.  win$="" 
  1274.  win$=SendingToDisplay$
  1275. Display(
  1276. Colour(11)+mess$+
  1277. Colour(0),OurNick$,win$)
  1278.  When you want a warning displayed (in orange)
  1279. DisplayWarning(mess$,win$)
  1280.  win$="" 
  1281. mess$,1)<>"*" 
  1282.  mess$="*** "+mess$
  1283.  win$="" 
  1284.  win$=SendingToDisplay$
  1285. Display(
  1286. Colour(14)+mess$+
  1287. Colour(0),OurNick$,win$)
  1288.  When you want an informational displaying (usually lblue)
  1289. DisplayInfo(mess$,win$)
  1290.  win$="" 
  1291. mess$,1)<>"*" 
  1292.  mess$="*** "+mess$
  1293.  win$="" 
  1294.  win$=SendingToDisplay$
  1295. Display(
  1296. Colour(15)+mess$,OurNick$,win$)
  1297. DisplayCTCP(mess$,win$)
  1298.  win$="" 
  1299.  win$=SendingToDisplay$
  1300. mess$="*** "+mess$
  1301. Display(
  1302. Colour(
  1303. GetCTCPColour)+mess$,OurNick$,win$)
  1304. Display(mess$,from$,to$)
  1305.  (from$="" 
  1306.  from$=OurNick$) 
  1307.  to$="" 
  1308.  to$="##server##"
  1309. @(mess$,from$,to$)
  1310.  ************************ Used by menus **********************
  1311.  Op a user
  1312. Op(channel$,nick$,flag)
  1313.  flag 
  1314. SendToIRC("MODE "+channel$+" +o "+nick$)
  1315. SendToIRC("MODE "+channel$+" -o "+nick$)
  1316. SendToIRC("NAMES :"+channel$)
  1317.  Give a user a voice
  1318. Voice(channel$,nick$,flag)
  1319.  flag 
  1320. SendToIRC("MODE "+channel$+" +v "+nick$)
  1321. SendToIRC("MODE "+channel$+" -v "+nick$)
  1322. SendToIRC("NAMES :"+channel$)
  1323.  Leave channel
  1324. LeaveChannel(channel$)
  1325. SendToIRC("PART "+channel$)
  1326.  Boot some one...
  1327. Kick(channel$,nick$)
  1328. SendToIRC("KICK "+channel$+" "+nick$+" :No reason")
  1329. DCCChat(nick$)
  1330. Notify("DCC Chat is not available")
  1331.  CTCP Extras for menus
  1332. CTCP_DoPing(nick$)
  1333. CTCP_Command(nick$,"PING","")
  1334. CTCP_DoClientInfo(nick$)
  1335. CTCP_Command(nick$,"CLIENTINFO","")
  1336. CTCP_DoFinger(nick$)
  1337. CTCP_Command(nick$,"FINGER","")
  1338. CTCP_DoVersion(nick$)
  1339. CTCP_Command(nick$,"VERSION","")
  1340. CTCP_DoUserInfo(nick$)
  1341. CTCP_Command(nick$,"USERINFO","")
  1342. CTCP_DoScripts(nick$)
  1343. CTCP_Command(nick$,"SCRIPTS","")
  1344. CTCP_DoSource(nick$)
  1345. CTCP_Command(nick$,"SOURCE","")
  1346. CTCP_DoTime(nick$)
  1347. CTCP_Command(nick$,"TIME","")
  1348.  ************************
  1349.  Extra routines by Justin
  1350.  ************************
  1351.  Pad a name if columns is selected
  1352. ReturnPadded(prefix$)
  1353.  columns 
  1354.  prefix$=
  1355. (prefix$)," ")+prefix$
  1356. =prefix$
  1357.  See if the command matches any of the aliases we have set
  1358. CheckAliases(command$,line$)
  1359.  in,a$,com$,found,in
  1360. found=
  1361. (magrathea_user$+".Aliases")
  1362.  in<>0 
  1363.   a$=
  1364.   com$=
  1365. a$+" "," ")-1)
  1366. com$,1)<>"#" 
  1367.  a$<>"" 
  1368. Capitalise(com$)=command$ 
  1369.     found=
  1370. +    
  1371. a$," ")=0 
  1372. a$," "))=" {" 
  1373.     ,     
  1374.  A long command, delimited by {}'s
  1375.      a$=
  1376. Strip(
  1377.      
  1378.  (a$<>"}" 
  1379.       
  1380.  a$="{" 
  1381.        
  1382.  Ignore
  1383.       
  1384. '       a$=
  1385. SubstituteArgs(a$,line$)
  1386.        
  1387. UserLine(a$)
  1388.       
  1389.       a$=
  1390. Strip(
  1391.      
  1392.         
  1393. !     
  1394.  A short simple command
  1395. !     a$=
  1396. Strip(
  1397. a$," ")))
  1398. %     a$=
  1399. SubstituteArgs(a$,line$)
  1400.      
  1401. UserLine(a$)
  1402.         
  1403.  found 
  1404.  Skip any long commands
  1405. a$," ")=0 
  1406. a$,1)<>"#") 
  1407. a$," "))=" {") 
  1408.  a$<>"" 
  1409.     a$=
  1410. Strip(
  1411.  (a$<>"}" 
  1412.      a$=
  1413. Strip(
  1414. "        
  1415.  found)
  1416. =found
  1417.  Substitue arguments from line$ into a$ using :
  1418.  %[0-9] for words
  1419.  %*[0-9] for the text after that (inc)
  1420.  %% for % symbol
  1421.  %R for the current recipient
  1422.  %M for our nick name
  1423.  %b for bold toggle
  1424. SubstituteArgs(a$,line$)
  1425.  b$,i,c$,n
  1426. 3    b$=""
  1427. a$,i,1)="%" 
  1428.   i=i+1
  1429. a$,i,1) 
  1430. 91   
  1431.  "0","1","2","3","4","5","6","7","8","9":
  1432.     c$=line$
  1433.     n=
  1434. a$,i,1))
  1435.      c$=
  1436. c$+" "," ")+1)
  1437.      n=n-1
  1438. ?        
  1439. @!    b$=b$+
  1440. c$+" "," ")-1)
  1441.  "*":
  1442.     i=i+1
  1443.     c$=line$
  1444.     n=
  1445. a$,i,1))
  1446.      c$=
  1447. c$+" "," ")+1)
  1448.      n=n-1
  1449. I        
  1450.     b$=b$+c$
  1451.  "%":
  1452.     b$=b$+"%"
  1453.  "R":
  1454. P/    
  1455.  Current recipient (SendingToDisplay$)
  1456.     b$=b$+SendingToDisplay$
  1457.  "b":
  1458.  Use bold characters
  1459.     b$=b$+
  1460.  "M":
  1461.  My nick name
  1462.     b$=b$+OurNick$
  1463. Z       
  1464.     b$=b$+"%"+
  1465. a$,i,1)
  1466.   b$=b$+
  1467. a$,i,1)
  1468.  i=i+1
  1469.  *********************************************************
  1470.  The following are routines you should use for overloading
  1471.  The display should be recognised from it's name and should
  1472.  usually start with ## if you are providing extensions
  1473.  *********************************************************
  1474.  Overload_DisplaySelected : A display has been selected
  1475.  only displays with ## prefixes will be passed here
  1476. Overload_DisplaySelected(display$)
  1477.  display$ 
  1478.  "##InputBox##"
  1479. DisplaySelected(SendingToDisplay$)
  1480.  "##server##"
  1481. SelectNoFocus
  1482.  Overload_UserLine : Process a users input
  1483. Overload_UserLine(str$)
  1484.  Overload_AboutToSay : About to say something - pre-process
  1485.  type will be 0 for 'spoken' thing, and 1 for actions
  1486.  You should overload this ALWAYS with
  1487.  =FN@(newstr$,type) or similar
  1488. Overload_AboutToSay(str$,type)
  1489.     =str$
  1490.  Overload_UnknownCommand : Process an unknown command
  1491.  The last thing will be this routine which processes aliases
  1492.  The command will be capitalised already, so don't waste time
  1493. Overload_UnknownCommand(command$,str$)
  1494. &found=
  1495. CheckAliases(command$,str$)
  1496.  found 
  1497. DisplayWarning("*** Unknown command '"+command$+"'","")
  1498.  *********************************************************
  1499.  Execute a script as we log on
  1500. RunInitialScript
  1501.  in,a$
  1502. (magrathea_user$+".Initial")
  1503.  in<>0 
  1504.   a$=
  1505. Strip(
  1506. a$,1)<>"#" 
  1507. Capitalise(
  1508. a$,5))="/JOIN" 
  1509. NewChannel(
  1510. moveon(a$),32,"Channel "+
  1511. moveon(a$),0,0)
  1512. UserLine(a$)
  1513.