home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / Poll.spot < prev    next >
Text File  |  1994-07-24  |  4KB  |  119 lines

  1. /***************************************************************/
  2. /* spot Call node                                              */
  3. /* $VER: PollHandler 1.1 (23.9.93) Per Jonsson                 */
  4. /* © Per Jonsson 2:203/602.8@fidonet                           */
  5. /*               39:160/100.8@amiganet                         */
  6. /*               Per_J@flerp.ct.se                             */
  7. /*                                                             */
  8. /* The  scripts  make it possible to call other than your boss */
  9. /* with  the Poll gadget.  You can choose between to call your */
  10. /* boss,  to write the nodenumber to call, choose a predefined */
  11. /* base  or  from the files in the outbound directory.  If you */
  12. /* choose  to  write  the  nudenumber manually, then you don't */
  13. /* need to write the whole number, for example:                */
  14. /*                                                             */
  15. /* My addres is 2:203/603 and if i want to call 2:203/600 then */
  16. /* it's  enough  to write 600, and if i want to call 2:204/404 */
  17. /* then i write 204/404.                                       */
  18. /*                                                             */
  19. /* The  AddBBS.spot  script  is  to add bases that you want to */
  20. /* predefine with name and nodenumber put it in the ARexx menu */
  21. /* in  Spot.   Copy  this  and the "AddBBS.spot" script to the */
  22. /* directory where you keep all your spot arexx scripts.       */
  23. /*                                                             */
  24. /* Don't  forget to change the path and nodenumber in this and */
  25. /* the other file.  (see below)                                */
  26. /*                                                             */
  27. /* If  you  have  any suggestions or bugg raporst, please send */
  28. /* them to me at the above address.                            */
  29. /*                                                             */
  30. /************************************************************* */
  31.  
  32. address SPOT
  33. options results
  34.  
  35. /* ----------- Change so it fit your system --------------- */
  36. Zon=2
  37. Net=203
  38. Node=603
  39. tdpath='Mail:'  /* path to TrapDoor, must end woth : or / */
  40. bbspath='mail:baser' /* path to the predefines bbs datafiles */
  41. out='mail:outbound' /* the path to the outbound dir */
  42. /* -------------------------------------------------------- */
  43.  
  44. /*if ~exists(bbspath||'baser') then do
  45.     address command 'makedir '||tdpath||'baser'
  46. end*/
  47.  
  48.  
  49. 'requestresponse TITLE "Poll" PROMPT "Choose where you want to call" GADGETS "_Boss|_Nodnum|Ba_seName|_Filereq|_Abort" CENTER'
  50.  
  51. ret1=RC
  52. select
  53.     when ret1=0 then do /* Avbryt */
  54.         EXIT 
  55.     end
  56.     when ret1=1 then do /* Boss */
  57.         'poll'
  58.         EXIT
  59.     end
  60.     when ret1=2 then do /* NodNum */
  61.         'requeststring TITLE "Poll" PROMPT "Which nodenumber?" CENTER'
  62.         num=RESULT
  63.         if RC=5 then exit 0
  64.     end
  65.     when ret1=3 then do /* BaseName */
  66.         'requestfile TITLE "Choose BBS name" PATH "'||bbspath||'"'
  67.         fname=RESULT
  68.         if RC=5 then exit 
  69.         if ~open(fi, fname, r) then EXIT 
  70.         num=readln(fi)
  71.         call close(fi)
  72.     end
  73.     when ret1=4 then do /* Filereq */
  74.         'requestfile TITLE "Choose *.req fil" PATH '||out
  75.         fname=RESULT
  76.         if RC=5 then exit 
  77.         if lastpos('/',fname)=0 then do
  78.             if lastpos(':',fname)=0 then gnugg=1
  79.             else fname=right(fname,length(fname)-lastpos(':',fname))
  80.         end
  81.         else fname=right(fname,length(fname)-lastpos('/',fname))
  82.         zon=left(fname,pos('.',fname)-1)
  83.         fname=delstr(fname,1,pos('.',fname))
  84.         net=left(fname,pos('.',fname)-1)
  85.         fname=delstr(fname,1,pos('.',fname))
  86.         node=left(fname,pos('.',fname)-1)
  87.         fname=delstr(fname,1,pos('.',fname))
  88.         point=left(fname,pos('.',fname)-1)
  89.         num=zon||':'||net||'/'||node||'.'||point
  90.     end
  91.  
  92.  
  93.     Otherwise exit 
  94. end
  95. if length(num)=0 then exit 
  96. if length(num)~=3 then do
  97.     if index(num,':')=0 then do 
  98.         if index(num,'/')=0 then do
  99.             /*'poll NODE '||num*/  /* Dosn't work? */
  100.             address command tdpath||'trapdoor CALL '||num||' SCREENMODE PUBLIC PUBSCREENNAME SPOT'
  101.             exit
  102.         end
  103.     end
  104. end
  105.  
  106. if length(num)=3 then do
  107.     nod=Zon||':'||Net||'/'||num
  108. end
  109. else 
  110. if index(num,'/')~=0 & index(num,':')=0 then do
  111.     nod=Zon||':'||num
  112. end
  113. else
  114. if index(num,':')~=0 then nod=num
  115. nod=nod||'.0'
  116. /* 'Poll NODE '||nod */
  117. address command tdpath||'trapdoor CALL '||nod||' SCREENMODE PUBLIC PUBSCREENNAME SPOT '
  118.  
  119.