home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / comms / a / docs / FAQs / ScriptHelp < prev    next >
Encoding:
Text File  |  1995-02-19  |  20.5 KB  |  622 lines

  1. ScriptHelp
  2. ==========
  3.  
  4. This help file applies to R.Orwin/A.P. Fitch slipdial script.
  5. Script file Revision 950218
  6.  
  7. Contents
  8. --------
  9.  
  10. 1.0 Introduction
  11.  
  12. 2.0 Using the script
  13.  
  14. 3.0 Script Requirements
  15.  3.1 Modem Driver
  16.  3.2 Setting up your modem to transmit status messages
  17.  3.3 Making sure that TTFN etc have been "seen".
  18.  
  19. 4.0 Customizing the script
  20.  4.1 To change the default dialler to Mercury.
  21.   4.1.1 To remove your Mercury PIN from a local number.
  22.  4.2 To Alter the Dialler Menu.
  23.  4.3 To Alter the List of Numbers
  24.  4.4 To Alter the Number of Retries.
  25.  4.5 To Add a New Telephone Number.
  26.  4.6 To Change the Local Dialler Icon Number. 
  27.  
  28. 5.0 Some Frequently Asked Questions.
  29.  
  30. 6.0 Conclusions and Acknowledgements. 
  31.  
  32. 1.0 Introduction
  33. ================
  34.  
  35. This script was originally written by Rob Orwin.  I initially modified 
  36. to make it more readable, and also to learn the script language
  37. myself. Recently it has been customised to work with TTFN/Newsbase,
  38. and included in Dr. Alan Hassey's Internet Starter Pack for Acorn 
  39. Computers.
  40.  
  41. This version of the script incorporates an extra icon bar icon which
  42. can attached to your normal (local) number.  
  43.  
  44. 2.0 Using the script
  45. ====================
  46.  
  47. The script is placed in the !SlipDial.scripts directory.  You can either
  48. load it by dragging it and dropping it on the SlipDial icon bar icon, or
  49. you can set SlipDial up to run the script automatically.  You should read the
  50. SlipDial documentation file !SlipDial.!Help to understand this.
  51.  
  52. For the default setup with the starter pack, the scriptfile should be named
  53.  
  54. demon
  55.  
  56. When the script is run for the first time, it asks for setup information
  57. and stores it in a configuration file.
  58.  
  59. There are a number of requirements for getting the script to work in
  60. the best way.  In particular, you need to
  61.  
  62. 1) make sure you are using the correct modem driver file
  63. 2) set up your modem to return certain messages
  64. 3) make sure that TTFN, NewsBase, and TCPIP have been "seen" by the filer
  65.  
  66. There are also a number of ways you can customise the script.  The
  67. simplest ones are 
  68.  
  69. 1)  to change the default dialler to Mercury
  70. 2)  to alter the entries that appear on the menu for dialling
  71. 3)  to alter the default entries when dialling a list of phone numbers
  72. 4)  to alter the number of times SlipDial retries each number if the
  73. line is busy 
  74. 5)  to change the local number 
  75.  
  76. Slightly more complicated is...
  77.  
  78. 6)  to add a new telephone number
  79.  
  80. Note that to make changes to the script, you simply have to edit it in 
  81. a normal text editor, e.g. Edit.
  82.  
  83. With !SlipDial, there is a file called !SlipDial.scripts.DemonSpr,
  84. which  contains sprite definitions.  You must make sure you have the
  85. most up-to-date version of these sprites. If the file contains three
  86. sprites, you are ok - if it only contains 2, you should update it to
  87. the latest one by download it from demon ftp.
  88.  
  89. 3.0 Script Requirements
  90. =======================
  91.  
  92. 3.1 Modem Driver
  93. ----------------
  94.  
  95. The modem drivers are stored in the directory !SlipDial.Drivers. 
  96. There are examples for US Robotics and Hayes modems.  To select the
  97. driver,  look in the script file for the string "driver".  You should
  98. find part of the script like this
  99.  
  100. #-----------------------------------------------------------
  101. # Subroutine: setserial
  102. # Set Serial Port/Driver Parameters
  103. #-----------------------------------------------------------
  104. :setserial
  105. driver USR
  106. port %wport %prtnum
  107. speed %speed
  108. set protocol slip
  109. return 1
  110.         
  111. To use the Hayes driver, change the line 
  112.  
  113. driver USR
  114.  
  115. to 
  116.  
  117. driver Hayes
  118.  
  119. 3.2 Setting up your modem to transmit status messages
  120. -----------------------------------------------------
  121.  
  122. If you run the script, and it appears to hangup after the call has got
  123. through but before TCPIP has started; or it doesn't recognise that the
  124. line is busy; then you need to make sure that the modem is returning
  125. messages indicating its (the modem's) status.  These messages are text
  126. strings, and their meaning is defined in the  driver file.  For
  127. instance, with the US Robotics Sportster modem, you need to send the
  128. setup string "X4" to enable all messages.
  129.  
  130. This means that when the modem detects the line is busy, it will
  131. return the string "BUSY".  You can tell the script to expect the
  132. string "BUSY" to indicate engaged by putting it in the modem driver
  133. file and assigning it to the script variable $busy. When dialling the
  134. modem looks for the string to see if it is equal to the contents of
  135. $busy and uses this to detect engaged lines.
  136.  
  137. The various possible strings, and their setups for a USR modem are
  138. shown in the example driver file below
  139.  
  140. set $init "ATB0&M4&H1&R2&I0&K3 AT&B1&N0&S0&Y1&D2&C1 ATV1Q0X4&A2E1F1M1"
  141. set $busy "BUSY"
  142. set $conn "CONNECT"
  143. set $nocarr "NO CARRIER"
  144. set $nodial "NO DIAL TONE"
  145.  
  146. The $init string is sent to the modem to set it up.  You will notice that
  147. the example above has X4 enabled.     
  148.  
  149. If you have a modem which returns different strings, you would have to 
  150. create your own modem driver.  For instance, if your modem returned
  151. "ENGAGED", you would have to modify the driver file to contain
  152.  
  153. set $busy "ENGAGED"
  154.  
  155. 3.3 Making sure that TTFN etc have been "seen".
  156. -----------------------------------------------
  157.  
  158. The script runs TTFN, Newsbase, and TCPIP automatically.  To do this,
  159. it needs to know where they are.  It can find them if you have opened
  160. a filer window with these programmes visible.  The  simplest way to
  161. ensure that they have been seen is to put all the internet related
  162. programmes in one directory.  Then when you open the directory in
  163. order to double-click SlipDial, you  know that all the other
  164. programmes have been seen.
  165.  
  166. 4.0 Customizing the Script
  167. ==========================
  168.                                  
  169. 4.1 To change the default dialler to mercury.
  170. ---------------------------------------------
  171.  
  172. Edit the script, and search for the subroutine call
  173.  
  174. call mercury_off
  175.  
  176. (it's quite near the top of the script).
  177.  
  178. Change the line to read
  179.  
  180. call mercury_on
  181.  
  182. 4.1.1 To remove your Mercury PIN from a local number.
  183. -----------------------------------------------------
  184.  
  185. If you have a Mercury PIN which is only required for long distance
  186. calls, you will have to remove the PIN from your local number.  By
  187. default the script is set up to use the Isle of Wight as the local
  188. number.
  189.  
  190. To change this, you must modify the makeNumbers subroutine.  The steps
  191. are as follows
  192.  
  193. a) search for the string :makeNumbers to find the subroutine
  194. b) look through the subroutine for your local number
  195. c) delete the string
  196.    
  197.        %mercury_pin\
  198.  
  199.    from the front of the number
  200. d) put the above string in front of the old local number (which would
  201. have  been the Isle of Wight in the default case).
  202.  
  203. As an example - to change your local number from Isle of Wight to
  204. Edinburgh :-
  205.  
  206.  
  207. Original (default Isle of Wight) makeNumbers subroutine...
  208.  
  209. #-----------------------------------------------------------
  210. # Subroutine: makeNumbers
  211. # Make a set of variables to hold the phone numbers.
  212. # By default, this is set up for Mercury users near the Isle
  213. # of Wight. You should of course edit this if you are local
  214. # to somewhere else.
  215. #-----------------------------------------------------------
  216. :makeNumbers
  217. set Birmingham %mercury_pin\01212754848
  218. set Bradford   %mercury_pin\01274755066
  219. set Bristol    %mercury_pin\01179814848
  220. set Cambridge  %mercury_pin\01223576010
  221. set Cardiff    %mercury_pin\01222274848
  222. set Coventry   %mercury_pin\01203284848
  223. set Edinburgh  %mercury_pin\01315528883
  224. set Gloucester %mercury_pin\01452354848
  225. set Hull       %mercury_pin\01482495580
  226. # local number - don't prefix with mercury_pin
  227. set IsleOfWight 01983523306
  228. set Leeds      %mercury_pin\01132984848
  229. set Leicester  %mercury_pin\01162904848
  230. set Liverpool  %mercury_pin\01512104848
  231. set London     %mercury_pin\01813384848
  232. set Luton      %mercury_pin\01582644848
  233. set Manchester %mercury_pin\01613854848
  234. set Newcastle  %mercury_pin\01912474848
  235. set Nottingham %mercury_pin\01159544848
  236. set Preston    %mercury_pin\01772484848
  237. set Reading    %mercury_pin\01734284848
  238. set Saffron    %mercury_pin\01799506010
  239. set Sheffield  %mercury_pin\01142384848
  240. set Sunderland %mercury_pin\01915225005
  241. set Wolverhampton %mercury_pin\01902464848       
  242.  
  243. Modified (Edinburgh) makeNumbers subroutine...
  244.  
  245.  
  246. # local number - don't prefix with mercury_pin
  247. set Edinburgh 01315528883
  248. set Gloucester %mercury_pin\01452354848
  249. set Hull       %mercury_pin\01482495580
  250. set IsleOfWight %mercury_pin\01983523306
  251.  
  252.  
  253. 4.2 To Alter the Dialler Menu.
  254. ------------------------------
  255.  
  256. The dialler menu has a selection of 'phone numbers from the available
  257. numbers at the time the script was written.  Unfortunately, this leads
  258. to a very long menu!  Also, your particular number may not be on
  259. there, so you may want to modify the menu by searching for the
  260. subroutine
  261.  
  262. :makemenus
  263.  
  264. The default subroutine looks like this
  265.  
  266. #-----------------------------------------------------------
  267. # Subroutine: makemenus
  268. # Defines the menus for dialling etc.  Note menus must be
  269. # less than 255 characters, hence the squashed names.  Also
  270. # this menu does not contain all possible Pops, again due
  271. # to length restrictions.
  272. #-----------------------------------------------------------
  273. :makemenus
  274. menu "Bir:call Bi" "Bri:call Bri" "Car:call Car" "Edin:call Ed" "IoW:call Iw" "Leed:call Le" "Liv:call Liv" "Lond:call Lon" "Lut:call Lu" "Man:call Ma" "New:call Ne" "Not:call No" "Read:call Re" "Shef:call Sh" "Wol:call Wo" "List:call Lis"
  275. menu /icon="Mercury" "Mercury On:call mercury_on" "Mercury Off:call mercury_off"
  276. menu /icon="Local"   "Local call:call Iw" 
  277. return 1
  278.  
  279. If you wanted to use only Sheffield, Leeds, London, and the list of 
  280. numbers, you could change it to 
  281.  
  282. :makemenus
  283. menu "Sheffield:call Sh" "London:call lo" "Leeds:call Le" "Shef:call Sh" "List:call Lis"
  284. menu /icon="Mercury" "Mercury On:call mercury_on" "Mercury Off:call mercury_off"
  285. menu /icon="Local"   "Local call:call Sh" 
  286. return 1
  287.                           
  288. Note that the total menu string for any one menu must be less than 255
  289. characters.  Because you have shortened the total menu length, it is
  290. possible to use longer menu entry names (i.e. "Sheffield" instead of
  291. "Shef").
  292.  
  293. But you must not alter the subroutine names (e.g. don't change
  294. "Shef:call Sh" to "Shef:call Sheffield", because there isn't a
  295. subroutine named Sheffield, only one called Sh).
  296.  
  297. Note also in the example above, the Local icon bar icon has been
  298. altered to setup Sheffield as the local number (see below).
  299.  
  300. 4.3 To Alter the List of Numbers
  301. --------------------------------
  302.  
  303. The script has a dialler menu option "List" which dials a sequence
  304. of phone numbers.  For instance, if you normally dial Reading, but
  305. after a number of tries want to try London instead, you can edit
  306. the List menu definition.
  307.  
  308. To change the List, look for the subroutine makeNumbers.  This is
  309. quite close to the bottom of the file.
  310.  
  311. The default setup is 
  312.  
  313. #
  314. #Edit the following line to customise the list of numbers which
  315. # slipdial dials in sequence.  Note that the list is made up
  316. # names defined above, preceded by a '%'.  Note that the spaces
  317. # between the names in the List must be included.
  318. #
  319. # Example - to call hull, bradford, saffron walden in that order
  320. # you would use
  321. #
  322. # set List "%Hull %Bradford %Saffron"
  323. #
  324. # Note that the number of retries made at each number is
  325. # set in the subroutine :Lis
  326. #
  327. set List "%IsleOfWight %London %Reading"
  328. return
  329.  
  330. Suppose that you want to dial Sheffield first, Leeds second, and
  331. London third.  Then you would modify the second from last line
  332. from
  333.  
  334. set List "%IsleOfWight %London %Reading"
  335.  
  336. to
  337.  
  338. set List "%Sheffield %Leeds %London"
  339.  
  340. You must include the "%", and also the spaces.
  341.  
  342.  
  343. 4.4 To Alter the Number of Retries.
  344. -----------------------------------
  345.  
  346. For each phone number, there is a subroutine.  For instance, for
  347. Bradford, there is a subroutine called Br.  To find this, search
  348. for the string ":Br".
  349.  
  350. The subroutine looks like this
  351.  
  352. #-----------------------------------------------------------
  353. # Subroutine: Br
  354. # calls Bradford demon phone number
  355. #-----------------------------------------------------------
  356. :Br
  357. set nRetries 50
  358. set phonenum %Bradford
  359. goto dodial
  360.  
  361. If you want to alter the number of retries (i.e. how many times 
  362. SlipDial will attempt to dial a number and finding it is engaged
  363. before giving up), change the line
  364.  
  365. set nRetries 50
  366.  
  367. For instance, suppose you want to retry 100 times.  Change this line
  368. to 
  369.  
  370. set nRetries 100
  371.  
  372. Note: there is a separate number of retries for each phone number in 
  373. the script, and also for the "List" list of numbers.  To change
  374. the number of retries for the List, search for ":Lis".
  375.  
  376. Note that in the case of the list, the number of retries defined will
  377. be the same for each number in the list.  So if you dial Sheffield, 
  378. Leeds, and London in the list, and set nRetries to 5 in the :Lis
  379. subroutine, SlipDial will
  380.  
  381. a) dial Sheffield 5 times maximum
  382. b) if Sheffield was engaged, dial Leeds 5 times maximum
  383. c) if Leeds was engaged, dial London 5 times maximum.
  384. d) give up in disgust
  385.  
  386. The default setup is that all menu items are tried up to 50 times,
  387. except for the list where each number is tried 5 times.  The idea
  388. behind this is that you would only use the List if you were trying
  389. to get through quickly.
  390.  
  391.  
  392. 4.5 To Add a New Telephone Number
  393. ---------------------------------
  394.  
  395. This is the most tricky one, as you would have to edit the script.  If
  396. you are doing this, you could either
  397.  
  398. a) copy exactly how one of the other numbers is set up, just change
  399. the number and the subroutine names
  400.  
  401. b) contact me
  402.        alan@cycle.demon.co.uk
  403.        
  404. and ask me to update the script.   
  405.  
  406. If you want to do it yourself, remember
  407.  
  408. 1) don't exceed 255 characters in the menu definitions
  409. 2) don't use a variable or subroutine name that's already in use
  410. 3) remember that the subroutine names are case-sensitive
  411.    
  412. For instance, if Demon opened a line at Lowestoft, you can't use
  413.  
  414. :Lo 
  415.  
  416. for the subroutine name, as it has already been used for London.
  417.  
  418. 4) Don't forget to add the new phonenumber to the 
  419.  
  420.     makeNumbers 
  421.     
  422. subroutine.
  423.  
  424. 4.6 To Change the Local Dialler Icon Number.
  425. --------------------------------------------
  426.  
  427. This version of the script allow your favourite number to be attached
  428. to an icon on the icon bar. This allows you to dial that number
  429. without having to use the menu item.  However to be useful you must
  430.  
  431. a) make sure you have the correct version of the file
  432. !SlipDial.scripts.DemonSpr
  433.  
  434. b) edit the makeMenus subroutine so that clicking on the icon calls
  435. your number, and not the default (which is the Isle of Wight)
  436.  
  437. c) edit the initMain subroutine to make sure clicking on the icon 
  438. dials the number you want.
  439.  
  440. For a), you should be ok if you download the up-to-date version of the
  441. script file, as contained in the Acorn Starter-Pack.  If you have a
  442. demonspr file with only two sprites in it, you have got the wrong
  443. version - you can overcome this temporarily by creating a dummy sprite
  444. in the DemonSpr file called loc (short for local).
  445.  
  446. For b) you need to find the makeMenus subroutine - search for
  447. :makeMenus.  It looks like this by default 
  448.  
  449. :makemenus
  450. menu "Bir:call Bi" "Bri:call Bri" "Car:call Car" "Edin:call Ed" "IoW:call Iw" "Leed:call Le" "Liv:call Liv" "Lond:call Lon" "Lut:call Lu" "Man:call Ma" "New:call Ne" "Not:call No" "Read:call Re" "Shef:call Sh" "Wol:call Wo" "List:call Lis"
  451. menu /icon="Mercury" "Mercury On:call mercury_on" "Mercury Off:call mercury_off"
  452. menu /icon="Local"   "Local call:call Iw" 
  453. return 1
  454.  
  455. This sets up three menus.  The last one is attached to the local icon
  456. on the icon bar.  To make Edinburgh your local number, change the line
  457.  
  458. menu /icon="Local"   "Local call:call Iw" 
  459.  
  460. to 
  461.  
  462. menu /icon="Local"   "Local call:call Ed" 
  463.  
  464. For c), the action on clicking the icon, search for :initMain.  Then
  465. change the line
  466.  
  467. icon /id="Local" /action="call Iw" loc
  468.  
  469. to 
  470.  
  471. icon /id="Local" /action="call Ed" loc
  472.  
  473. again using Edinburgh as the example.
  474.  
  475. 5.0 Some Frequently Asked Questions
  476. ===================================
  477.  
  478. 1) When I log on, SlipDial appears to miss the "l" off "login" - is
  479. this a bug?
  480.  
  481. No - it is recommended by Demon that during login, diallers should
  482. wait for the strings  "ogin:", "otocol:" etc.  See the section "The
  483. Login Sequence" in the file 
  484.  
  485.          ftp.demon.co.uk:/pub/doc/Demon.txt
  486.          
  487. 2) When I start up SlipDial it exits immediately with an error.  What
  488. can I do?
  489.  
  490. Firstly, this is most likely to be due to the DemonSpr file.  You need
  491. the latest version of this which contains three sprites.  See below
  492. (how to get DemonSpr when !SlipDial isn't working).
  493.  
  494. However it might be some other problem. The best way of finding out is
  495. to enable the script log.  To do this, edit the script file, and
  496. search for the line
  497.  
  498. #trace "SlipDial:logoutput"
  499.  
  500. and change it to 
  501.  
  502. trace "SlipDial:logoutput"
  503.  
  504. i.e. delete the #.  This will cause SlipDial to write debugging
  505. information to the file !SlipDial.Scripts.logoutput
  506.  
  507. You can use the information obtained to try and find out what is going
  508. on.
  509.  
  510. 3) SlipDial starts up, dials, my modem gets through, but then the
  511. call finishes immediately?  
  512.  
  513. The SlipDial script is set up to watch the DCD (data carrier detect)
  514. line from your modem. If this line remains low, SlipDial will think
  515. the call has finished straight away.  You should check
  516.  
  517. a) your modem setup
  518. b) your cable
  519. c) your serial interface driver
  520.  
  521. Be especially careful to match lead and serial driver. The lead can be
  522. either Archimedes wiring or PC wiring - they are not compatible!  Also
  523. the BlockDriver must be set to match the interface port and the cable
  524. wiring.  The BlockDriver loaded by the SlipDial script is defined in
  525. the file !SlipDial.Scripts.demonconfg, which is initialised the first
  526. time your run the script.  Here are some examples
  527.  
  528. You have a PC wired cable, with an internal port - first two lines of
  529. demonconfg are
  530.  
  531. InternalPC
  532. 0
  533.  
  534. You have an Arc cable, with an internal port - should lead to 
  535.  
  536. Internal
  537. 0
  538.  
  539. You have a Serial port Dual interface card, you have connected the
  540. cable to port 1, you have a PC wired lead - should lead to 
  541.  
  542. SP_DualPC
  543. 1
  544.  
  545. 4) I've updated the script, and now it doesn't work because I haven't
  546. got the latest DemonSpr file - how can I log on if the script doesn't
  547. work?
  548.  
  549. Good question. The simplest answer is to use Paint to create an extra
  550. sprite in the DemonSpr file.  For instance, copy one of the existing
  551. sprites (such as hgon) and rename the copy to loc.  It might be a good
  552. idea to change its colour so that you don't mix it up with hgon.  Then
  553. log on to demon, and download the latest version of DemonSpr.
  554.  
  555. You can of course create your own sprite, representative of local
  556. traditions and/or landmarks.
  557.  
  558. 5) Last time I logged into Demon I changed my password, and now
  559. SlipDial doesn't work - what should I do?
  560.  
  561. You have to edit the file !SlipDial.scripts.demonconfg.  The last line
  562. of this should be changed to your new password (which is case sensitive
  563. I believe).
  564.  
  565. 6) I've modified the script, and nothing seems to have changed.
  566.  
  567. You must make sure the new script has been loaded in.  Quit SlipDial
  568. and  load it again to ensure this.
  569.  
  570. 7) The script never calculates the newsrate - why?
  571.  
  572. The SlipDial script computes the newsrate by looking at the timestamp
  573. on the downloaded news batch.  If you run Newsbase while you are on
  574. line (for instance so that you can edit and send new mail while logged
  575. in), Newsbase will remove the batch of news before the script can get
  576. at it to measure the timestamp. Hence SlipDial is not able to compute
  577. the newsrate.  
  578.  
  579. The only way round this is not to have Newsbase running at the same
  580. time as you are on line. 
  581.  
  582. 8) The news rate reported by Newsbase when debatching is not the same
  583. as SlipDial - why?
  584.  
  585. The newsrate reported by SlipDial is computed by looking at
  586. timestamps, and is an estimate of the speed of downloading news.
  587.  
  588. The debatching rate measured by Newsbase is simply a measure of the
  589. speed of Newsbase - it has no relation at all to the speed of
  590. downloading.
  591.  
  592. 9) Even though I get good download rates for ftp, and everyone says
  593. Demon is running fast, I can't get good rates from newsrate - why?
  594.  
  595. The newsrate computed by SlipDial is simply a measure of the
  596. timestamps on the two files DemNG and DemNews.  If you are downloading
  597. other information (for instance mail, or an ftp session), the average
  598. newsrate will be low even if everything is operating at maximum speed,
  599. simply because the available line capacity is being shared by ftp,
  600. mail, and news.
  601.  
  602. To get a true measure of newsrate, you must have nothing else running
  603. at the same time.
  604.  
  605. With a 14400 baud modem with mnp5/v42bis you should get 2500cps on a
  606. good day.
  607.  
  608. 6.0 Conclusion and Acknowledgements.
  609. ====================================
  610.  
  611. I hope this helps if you want to modify the script.
  612.  
  613. I should like to acknowledge Robert Orwin for writing the original
  614. script, and of course thank Graham Allen for writing SlipDial in  the
  615. first place.  Also thanks to Mike James for improving the support for
  616. Mercury numbers. and introducing the Local icon.
  617.  
  618. Alan Fitch  18th February 1995
  619. alan@cycle.demon.co.uk
  620.  
  621.  
  622.