home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d811 / bsh.lha / bsh / showtime < prev    next >
Text File  |  1993-02-14  |  2KB  |  90 lines

  1. # showtime - A scrolling ad with interstellar cliches.    This was inspired
  2. # by the script marquis.rexx, although it has almost nothing in common except
  3. # for the scrolling effect.
  4. #
  5. # Showtime is presented as is; no warrantee is either expressed or implied
  6. # as to it's suitability to any purpose whatsoever.  You assume all the
  7. # risk for all damage, even if caused by a defect in the software,
  8. # no matter how awful.
  9.  
  10. local msgs i j k n m2 msg hdr p1 w t1=ran(48) hh=t1/2 mm=(t1%2)*30 ttl o IFS window_name
  11. t1=(hh+2)%24, IFS="\n"
  12.  
  13. set msgs `cat << +`
  14. I'm a doctor, not a bricklayer!
  15. I'm a doctor, not a mechanic!
  16. I'm a doctor, not an engineer!
  17. I'm a doctor, not an escalator!
  18. He's Dead, Jim.
  19. Bones, there's a Thing out there
  20. REALLY, Doctor!
  21. Beam me up, Scotty
  22. Sensors indicate no intelligent life
  23. I have a BAD feeling about this
  24. It's our only hope
  25. May the Force be with you
  26. Phasers, on stun
  27. +
  28.  
  29. if mm==0
  30.    mm="00"
  31. endif
  32. if ?argv[1]
  33.     if ?_title
  34.     ttl=_title
  35.     else
  36.     ttl=0
  37.     endif
  38.     _title="Amiga Tunes daily at $hh:$mm and $t1:$mm"
  39.     o=1,w=width
  40. else
  41.     window_name="con:0/0/640/54/Amiga Tunes daily at $hh:$mm and $t1:$mm"
  42.     c:version version 36 >NIL:
  43.     if status == 0
  44.     window_name=cat(window_name,"/nosize")
  45.     endif
  46.     o=open(window_name,"w")
  47.     if o==0
  48.     o=1,w=width
  49.     else
  50.     w=77
  51.     endif
  52. endif
  53.  
  54. onintr goto finis; onerr goto finis
  55. # clear the screen
  56. echo -n "\f" >&$o
  57. msg="bsh -- the interstellar shell!    ",hdr="Where no Amiga has gone before"
  58.  
  59. # center top message
  60. p1=(w-strlen(hdr))/2
  61. echo -n "\e[1;${p1}H\e[4m$hdr\e[0m" >&$o
  62. # center bottom  message
  63. n=ran(#msgs), m2=msgs[n], p1=(w-1-strlen(m2))/2
  64. echo -n "\e[5;${p1}H\"$m2\"" >&$o
  65. # turn cursor off for speed & a more pleasing display
  66. echo -n "\e[0 p" >&$o
  67. k=0, j=strlen(msg), p1=w-2
  68. while k++ < 6
  69.     i=1
  70.     repeat j 'n=substr(msg,i++,1);echo -n "\e[3;4H\e[P\e[3;${p1}H$n" >&$o;sleep .1'
  71. endwhile
  72.  
  73. label finis
  74. onintr ""
  75. if o > 2        # using our own custom window ?
  76.     # allow a short period for admiration of window before closing it (1/2 sec)
  77.     sleep .5
  78.     close $o
  79. else
  80.     echo -n "\e[6;1H"    # position cursor past bottom message
  81.     # turn cursor back on
  82.     echo -n "\e[ p" >&$o
  83.     if ttl
  84.     _title=ttl
  85.     else
  86.     unset _title
  87.     endif
  88. endif
  89. exit 0
  90.