home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / comm / comstack.sit / Commstack_2.6.bin / Commstack 2.6 / stack.txt < prev   
Encoding:
Text File  |  1989-12-21  |  15.6 KB  |  611 lines

  1. -- stack: in.6
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 3
  11. -- first background id: 2598
  12. -- card count: 26
  13. -- first card id: 3234
  14. -- list block id: 10937
  15. -- print block id: 0
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 31
  19. -- free size: 95712 bytes
  20. -- total size: 229376 bytes
  21. -- stack block size: 13824 bytes
  22. -- created by hypercard version: 0x01228000
  23. -- compacted by hypercard version: 0x01228000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. on saveBINHEX ENDSTRING
  69.   global NewsState
  70.   openascii
  71.   ask "Anna nimi, jolle t├ñm├ñ BINHEX talletetaan."
  72.   put it into BINHEXNIMI
  73.   put false into OK
  74.   repeat until OK
  75.     get offset(":",BINHEXNIMI)
  76.     if it > 0 then
  77.       put "-" into char it of BINHEXNIMI
  78.       put "Nimest├ñ poistettu :-merkki. Nimi on nyt " & BINHEXNIMI
  79.     else
  80.       put true into OK
  81.     end if
  82.   end repeat
  83.  
  84.   if BINHEXNIMI is empty then
  85.     exit saveBINHEX
  86.   end if
  87.  
  88.   open file BINHEXNIMI
  89.  
  90.   repeat 60 times
  91.  
  92.     get offset("(This file must be converted with BinHex",card field 1)
  93.     -- put "This must ...=" & it
  94.     if it > 0 then
  95.       select char 1 to it-1 of card field 1
  96.       put empty into the selection -- of card field 1
  97.     else
  98.       put space into card field 1
  99.       writeascii " "
  100.       displayscreen "dis"
  101.     end if
  102.   end repeat
  103.  
  104.   repeat 10000 times
  105.     get number of lines of card field 1
  106.     put it into n
  107.     repeat with i = 1 to n
  108.       get line i of card field 1
  109.       put it
  110.       if offset("--MORE--",it) > 0 then exit repeat
  111.       write it & return to file BINHEXNIMI
  112.     end repeat
  113.     get offset(ENDSTRING,card field 1)
  114.     if it > 0 then exit repeat
  115.     writeascii " "
  116.     put empty into card field 1
  117.     displayscreen "dis","--MORE--"
  118.   end repeat
  119.   close file BINHEXNIMI
  120.   displayscreen "dis"
  121.   closeascii
  122.   put "BINHEX on talletettu HyperCard -kansioon nimelle" && BINHEXNIMI
  123. end saveBINHEX
  124.  
  125. on closestack
  126.   global CommSpeed,CommPrompt, NodeName, NodeType, Username
  127.   openascii
  128.   writeascii "stty rows 24" & return
  129.   displayscreen dis,CommPrompt
  130.   if NodeType is "unix" then
  131.     writeascii "set term=vt200" & return
  132.   else
  133.     writeascii "wait 00:00:10" & return
  134.     writeascii "set term/dev=vt200" & return
  135.   end if
  136.   displayscreen dis,CommPrompt
  137.   answer "Terminal is now VT200"
  138.   closeascii
  139. end closestack
  140.  
  141. on talk text,p1,p2
  142.   put text && p1 && p2
  143.   Speak words,text
  144. end talk
  145.  
  146. on SendField1
  147.   global CommSpeed,CommPrompt, NodeName, NodeType, Username
  148.   put zero into lsum
  149.   put false into OK
  150.   put 0 into count
  151.   --deletedots
  152.   repeat until OK
  153.     put count+1 into count
  154.     if count > 100 then exit repeat
  155.     repeat with i = 1 to number of lines of card field 1
  156.       get  number of characters of line i of card field 1
  157.       if it > 80 then
  158.         --put "line " & i & " has " && it & " characters"
  159.         --wait 1 sec
  160.         set cursor to watch
  161.         put 80 into ccc
  162.         repeat with cc=1 to 20
  163.           put 80-cc into k
  164.           --put k & " " after message
  165.           get character k of line i of card field 1
  166.           --put it && " at pos " & k & " of line " & line i of card field 1
  167.           --wait 2 sec
  168.           if it is space then
  169.             put k into ccc
  170.             exit repeat
  171.           end if
  172.         end repeat
  173.         --put "return to" && ccc && line i of card field 1
  174.         --wait 2 sec
  175.         put return  after character ccc of line i of card field 1
  176.         put false into OK
  177.         exit repeat
  178.       else
  179.         put true into OK
  180.       end if
  181.     end repeat
  182.   end repeat
  183.   put number of lines of card field 1 into count
  184.   repeat with i=1 to count
  185.     writeascii line i of card field 1 & return
  186.   end repeat
  187. end SendField1
  188.  
  189. function getprompt p1,p2
  190. get first word of card field "Node Type" of card "Config"
  191. if it is "unix" then
  192.   return p1
  193. else
  194.   return p2
  195. end if
  196. end getprompt
  197.  
  198. -- These handlers for Macintalk
  199. on MouseDown
  200.   get the hilite of card button "Talk Target" of card "Config"
  201.   if it is true then
  202.     get the short name of the target
  203.     put it into ShortName
  204.  
  205.     get the name of the target
  206.     if second word of it is "field" then
  207.       get first line of the value of the target
  208.       --!!!!talk "Field" && ShortName & ":" && it, 100,120
  209.       talk "Field" & ":" && it, 100,100
  210.     else
  211.       talk ShortName & ".",100,120
  212.     end if
  213.   end if
  214. end MouseDown
  215.  
  216. on MouseLeave
  217.   get the hilite of card button "Talk Target" of card "Config"
  218.   if it is true and the ShiftKey is "down" then beep
  219. end mouseleave
  220.  
  221. on MouseEnter
  222.   if the OptionKey is "down" or the ShiftKey is "down" then
  223.     get the hilite of card button "Talk Target" of card "Config"
  224.     if it is true then
  225.       get the short name of the target
  226.       put it into ShortName
  227.  
  228.       get the name of the target
  229.       if second word of it is "field" then
  230.         if the OptionKey is "down"  then
  231.           get first line of the value of the target
  232.           talk "Field" && ShortName & ":" && it, 100,120
  233.           -- talk "Field" & ":" && it, 100,120
  234.         end if
  235.       else
  236.         talk ShortName & ".",100,100
  237.       end if
  238.     end if
  239.   end if
  240. end MouseEnter
  241. -- End Macintalk handlers
  242.  
  243. on PANIC
  244.   set cursor to watch
  245.   openascii
  246.   writeascii numtochar(3)
  247.   wait 2 sec
  248.   writeascii numtochar(3)
  249.   wait 2 sec
  250.   get first word of card field "Node Type" of card "Config"
  251.   if it is "unix" then
  252.     writeascii "x" & return
  253.     writeascii "q" & return
  254.     wait 1 sec
  255.     writeascii "q"
  256.     wait 1 sec
  257.     writeascii "q"
  258.     wait 1 sec
  259.     writeascii "q" & return
  260.   else
  261.     writeascii "exit" & return
  262.   end if
  263.   go card "card1"
  264.   put space into card field 1
  265.   displayscreen
  266.   closeascii
  267. end PANIC
  268.  
  269. on SendMailX
  270.   openascii
  271.   get word 1 of card field "Node Type" of card "Config"
  272.   put it into NodeType
  273.   if NodeType is "unix" then
  274.     get word 2 of line 3 of card field 1
  275.   else
  276.  
  277.     get word 2 of line 2 of card field 1
  278.   end if
  279.  
  280.   put it into osoite
  281.   ask "Anna osoite (ellei t├ñm├ñ)" with osoite
  282.   if NodeType = "unix" then
  283.     writeascii "m " & it & return
  284.   else
  285.     writeascii "mail " & return
  286.     writeascii "send " & return
  287.     writeascii it & return
  288.   end if
  289.   get offset("Subject:",card field 1)
  290.   get char it+8 to it+80 of card field 1
  291.   put it into rivi
  292.   get offset(return,rivi)
  293.   get char 1 to it of rivi
  294.   ask "Anna kirjeen aihe" with it
  295.   put it into aihe
  296.   writeascii aihe & return
  297.   go card "MailSendX"
  298.   closeascii
  299. end SendMAilX
  300.  
  301. on ReadThemAll count
  302.   get first word of card field "Node Type" of card "Config"
  303.   put it into NodeType
  304.   set cursor to watch
  305.   repeat with i =1 to 10
  306.     put "VANHA KIRJE" into card field "LineCount" of card "Letter" & i
  307.   end repeat
  308.   global MailNumber
  309.   if NodeType is "unix" then
  310.     put return & "& " into prompt
  311.     repeat with MailNumber = 1 to count
  312.       openascii
  313.       put "Kirje numero" && MailNumber
  314.       go card "Letter" & MailNumber
  315.       put space into card field 1
  316.       writeascii MailNumber & return
  317.       writeascii "d" & return
  318.       displayscreen "dis",prompt
  319.       get name of card
  320.       put date() && it into card field "LineCount"
  321.       closeascii
  322.     end repeat
  323.  
  324.   else
  325.     openascii
  326.     put "MAIL>" into prompt
  327.     repeat with MailNumber = 1 to count
  328.       put "Kirje numero" && MailNumber
  329.       writeascii MailNumber & return
  330.       writeascii "extract" & " MacMail_" & MailNumber & ".txt" & return
  331.       writeascii "d" & return
  332.       put space into card field 1
  333.       displayscreen "dis",prompt
  334.     end repeat
  335.     writeascii "exit" & return
  336.     writeascii "purge MacMail*.*" & return
  337.     displayscreen "flush"
  338.     repeat with MailNumber = 1 to count
  339.       put "Kirje numero" && MailNumber
  340.       go card "Letter" & MailNumber
  341.       put space into card field 1
  342.       writeascii "type/nopage MacMail_" & MailNumber & ".txt" & return
  343.       put space into card field 1
  344.       displayscreen
  345.       get name of card
  346.       put date() && it into card field "LineCount"
  347.     end repeat
  348.     closeascii
  349.   end if
  350.  
  351.   put "Kirjeet haettu pinoon, voit nyt selailla niit├ñ."
  352. end ReadThemAll
  353.  
  354. on openstack
  355.   global XonXoff
  356.   global CommSpeed,CommPrompt, NodeName, NodeType, Username
  357.   put true into XonXoff
  358.  
  359.   get the hilite of card button "Speed1200" of card "Config"
  360.   if it is true then put "1200" into CommSpeed
  361.   get the hilite of card button "Speed2400" of card "Config"
  362.   if it is true then put "2400" into CommSpeed
  363.   get the hilite of card button "Speed9600" of card "Config"
  364.   if it is true then put "9600" into CommSpeed
  365.   get the hilite of card button "Speed19200" of card "Config"
  366.   if it is true then put "19200" into CommSpeed
  367.  
  368.   put empty into card field 1
  369.   -- hide card field 1 of card "card1"
  370.   put "**** PAINA NAPPULAA"  && quote  & "AVAA YHTEYS" & quote & " ****" into card field "UserMessage"
  371.   get card field "username" of card "config"
  372.   put it into Username
  373.   put it & space into card field "Connection"
  374.   get card field "Node Name" of card "config"
  375.   put it into a
  376.   put it into NodeName
  377.   get card field "Node Type" of card "config"
  378.   put it into NodeType
  379.   put a && it after card field "Connection"
  380.   --send SetBoud to card "card1"
  381.   if NodeType is "unix" then
  382.     put "% " into CommPrompt
  383.   else
  384.     put return & "$ " into CommPrompt
  385.   end if
  386. end openstack
  387.  
  388. function Tidyit P1
  389. get number of characters of P1
  390. put it into count
  391. repeat with i = 1 to count
  392.   if char i of P1 = "." or char i of p1 = "!" then
  393.     put space after char i of P1
  394.     put count+1 into count
  395.   end if
  396.  
  397. end repeat
  398.  
  399. if char 1 to 7 of P1 is "Resent-" then
  400.   return empty
  401. end if
  402. if char 1 to 7 of P1 is "Receive" then
  403.   return empty
  404. end if
  405. if char 1 to 7 of P1 is "X-vms-t" then
  406.   return empty
  407. end if
  408. -- if char 1 to 5 of P1 is "From:" then
  409. --  return empty
  410. -- end if
  411. if char 1 to 4 of P1 is "From" then
  412.   return empty
  413. end if
  414. if char 1 to 3 of P1 is "To:" then
  415.   return empty
  416. end if
  417. if char 1 to 11 of P1 is "Newsgroups:" then
  418.   return empty
  419.  
  420. end if
  421. if char 1 to 11 of P1 is "References:" then
  422.   return empty
  423.  
  424. end if
  425. if char 1 to 8 of P1 is "Message-" then
  426.   return empty
  427.  
  428. end if
  429. if char 1 to 3 of P1 is "Cc:" then
  430.   return empty
  431.  
  432. end if
  433. if char 1 to 6 of P1 is " id aa" then
  434.   return empty
  435.  
  436. end if
  437. if char 1 to 8 of P1 is "in-reply" then
  438.   return empty
  439.  
  440. end if
  441. if char 1 to 8 of P1 is "X-mailer" then
  442.   return empty
  443.  
  444. end if
  445. return P1
  446. end Tidyit
  447.  
  448. on ReadField1
  449.   get number of lines of card field 1
  450.   put it into count
  451.   repeat with i = 1 to count
  452.     get line i of card field 1
  453.     put tidyit(it) into it
  454.     put it
  455.     -- wait 10
  456.     if it is not empty then talk it ,120,100
  457.     if the Mouse is "down" then exit repeat
  458.   end repeat
  459. end ReadField1
  460.  
  461. function clickLine
  462. return ((the mouseV + the scroll of the target - item 2 of the rect of the target-4) div the textheight of the target) + 1
  463. end clickLine
  464.  
  465. on deletedots
  466.   replace numtochar(138) ,"{"  -- ae
  467.   replace numtochar(140)  ,"}"  -- ruots
  468.   replace numtochar(154)  ,"|"  -- oe
  469.   replace   numtochar(128) ,"["  -- AE
  470.   replace   numtochar(129)  ,"]"  -- RUOTS
  471.   replace  numtochar(133) ,"\"  -- OE
  472. end deletedots
  473.  
  474. on delextedots
  475.   replace quote & numtochar(138) & quote,"{"  -- ae
  476.   replace quote & numtochar(140) & quote,"}"  -- ruots
  477.   replace quote & numtochar(154) & quote,"|"  -- oe
  478.   replace quote & numtochar(128) & quote,"["  -- AE
  479.   replace quote & numtochar(129) & quote,"]"  -- RUOTS
  480.   replace quote & numtochar(133) & quote,"\"  -- OE
  481. end delextedots
  482.  
  483. on replace a,b
  484.   put 1 into AE
  485.   repeat until AE = 0
  486.     set cursor to busy
  487.     put offset(a,card field 1) into AE
  488.     if AE = 0 then exit repeat
  489.     put b into character AE of card field 1
  490.     -- put "Replacing " & a & " with " & b & "."
  491.   end repeat
  492. end replace
  493.  
  494. on displayscreen y,wstr,wstr2
  495.   global commstorage
  496.   global LastInput
  497.   global StringGot
  498.   global XonXoff
  499.   set scroll of card field 1 to 0
  500.   put false into StringGot
  501.   if XonXoff then writeascii (numtochar(17))
  502.   put 900 into i
  503.   put 0 into ex
  504.   -- put "?" into card field "LineCount"
  505.   -- put space into card field 1
  506.   repeat for i
  507.     set cursor to busy
  508.     put commf("read") into x
  509.     if x is empty then
  510.       put 1 + ex into ex
  511.     else
  512.       put 0 into ex
  513.       put x after card field 1
  514.       get  number of lines of card field 1
  515.       put "Lines " & it into card field "LineCount"
  516.       put it into lastline
  517.       if it > 500 then
  518.         writeascii numtochar(3) & numtochar(19)
  519.         put "THIS TEXT IS TOO LONG. CANNOT BE SAVED INTO FIELD."
  520.       end if
  521.       put x into LastInput
  522.       -- put last line of card field 1
  523.       if wstr is not empty then
  524.         --if lastline > 2 then
  525.         if wstr is in line lastline-1 to lastline of card field 1 then
  526.           put true into StringGot
  527.           exit displayscreen
  528.         end if
  529.         if wstr2 is not empty then
  530.           if wstr2 is in line lastline-1 to lastline of card field 1 then
  531.             put true into StringGot
  532.             exit displayscreen
  533.           end if
  534.         end if
  535.         --end if
  536.       end if
  537.     end if
  538.     if ex > 65 then
  539.       exit repeat
  540.     end if
  541.   end repeat
  542.   if y is "flush" then
  543.     put space into card field 1
  544.   end if
  545.  
  546. end displayscreen
  547.  
  548. on openascii
  549.   global CommStorage
  550.   global CommSpeed
  551.  
  552.   put commf("open" & CommSpeed) into x
  553.   -- put commf("open") into x
  554.   -- put commf("open","modem","1200","1","no","8") into x
  555.  
  556. end openascii
  557.  
  558. on closeascii
  559.   global CommStorage
  560.   put commf("close") into x
  561. end closeascii
  562.  
  563. on writeascii x
  564.   global CommStorage
  565.   put commf("write",x) into x
  566. end writeascii
  567.  
  568. on readascii
  569.   global CommStorage
  570.   get commf("read")
  571. end readascii
  572.  
  573. on MailDirectory
  574.   global DirectoryGot
  575.   global CommStorage
  576.   go card "MailDir"
  577.  
  578.   if not DirectoryGot then
  579.     put space into card field 1
  580.     openascii
  581.     get first word of card field "Node Type" of card "config"
  582.     if it is "vms" then
  583.       writeascii (numtochar(17) & "dir" & return)
  584.       put "MAIL>" into prompt
  585.     end if
  586.     if it is "unix" then
  587.       writeascii (numtochar(17) & "h" & return)
  588.       put return & "& " into prompt
  589.     end if
  590.     displayscreen "dis",prompt
  591.     if offset("No applicable messages",card field 1) > 0 then
  592.       put "no mail" into card field 1
  593.       go card "MailDir"
  594.     end if
  595.  
  596.     put number of lines of card field 1 into i
  597.     repeat with a = 1 to i
  598.       delete char 78 to 130 of line a of card field 1
  599.     end repeat
  600.  
  601.     put true into DirectoryGot
  602.     closeascii
  603.   end if
  604.  
  605. end MailDirectory
  606.  
  607.  
  608.  
  609.  
  610.  
  611.