home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus5 / DC-OP55B.LZX / Opus5 / storage / Modules / Beavis.dopus5 < prev    next >
Encoding:
Text File  |  1996-07-01  |  10.8 KB  |  298 lines

  1. /* Beavis for Directory Opus 5.5
  2.    by Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.    email: leo.davidson@keble.oxford.ac.uk  www: http://users.ox.ac.uk/~kebl0364
  4.  
  5. $VER: Beavis.dopus5 1.3 (1.7.96)
  6.  
  7.    WARNING: Some knowledge of AmigaDOS and a little ARexx is required to
  8.    get anything out of this script (sorry!).
  9.  
  10.    Beavis AppIcon! Make Beavis a part of your everyday Amiga experience.
  11.    Hail to the king, baby. (Uh, oops, too much Duke Nukem 3D...)
  12.  
  13.    (LITTLE DUDE! STAMP ON HIS HEAD!... GEDDIM!!!...  PIPE BOMB... Oh oh,
  14.     it's 7:00am... Oops)
  15.  
  16.    Much thankness to Jon Potter for his amazing work on Opus 5 -- nothing
  17.    in the world comes close. Nothing else would let Beavis himself be
  18.    conjured up from a simple ARexx script. <Stuffs spoonfull of peanut
  19.    butter into mouth>.
  20.  
  21.    Ahem, where was I? Well, this script could be made to do many things with
  22.    a little configuring so do with it what you want. As it is you define
  23.    the default icon below as "iconname". When you double-click the icon
  24.    whatever is defined as "opencommand" below is executed. I have it tell
  25.    Super-Select (one of my utils which can be found on Aminet) to randomly
  26.    play one of my 129 Beavis'n'Butthead samples.  Oh, by the way, don't
  27.    include the ".info" at the end of the icon name. You'll regret it if
  28.    you do, I'll see to that, sunny.
  29.  
  30.    Ahh.. ahhhhhhhhh!!!!!!
  31.  
  32.    The drop-down menu on the AppIcon has several custom entries as well as
  33.    the usual "Close", "Information", "Snapshot", and "Unsnapshot" which
  34.    work as you would expect. The "Stop Sample" item runs whatever is
  35.    defined below as "stopcommand". I have this setup to break DSound so
  36.    that I can abort playing long samples I don't want to hear.
  37.  
  38.    The "Select Sample" entry runs whatever is defined as "pickcommand"
  39.    and in my case it executes a script which opens a file requester allowing
  40.    me to choose any sample on my harddrive for playing.
  41.  
  42.    <Scoops peanut butter out with finger> tHe giBBer drIve! ThE GIbbER DRiVE!!!
  43.    Take me to your leader. I will give him flowers. I will make him bow. Then
  44.    all hell shall break lose. Then you all shall sip on my lemon tea. For then,
  45.    and only then shall people know the true taste of the gibber drive and it's
  46.    full-on robot chubby of computational power. Oh yes. Oh, yes.
  47.  
  48.    Finally, you can define as many extra menu items using the "coolsample.x"
  49.    and "coolsaname.x" variables below (uh, "as you like" ought to be in that
  50.    sentense somewhere. I'll leave that as an exercise for the reader). It's
  51.    easier if you just look at them, I don't think it's worth explaining,
  52.    especially when it's already 2:20pm and I haven't had a shower yet. (HOW
  53.    MANY times have I listened to Load today?... ulp. Talk about welded into
  54.    my CD player.. dah-na dunna dahhh!!) The filenames are plonked on the end
  55.    of "playcommand" when you click on them. Nuff said.
  56.  
  57.    You know when you're doing some kind of test and the question is "What
  58.    do you think xyz is?". Well, unless you're dishonest and put down what
  59.    you don't think the answer is, shouldn't you always get the question
  60.    right? They asked for what you think and you told them what you though so
  61.    the answer is correct. But, they're sneaky ya see, they judge the answer
  62.    by whether what you thought was correct, not whether you correctly wrote
  63.    down what you thought. Little gits.
  64.  
  65.    You should find 1:2 and 1:1 aspect Beavis icons with this script somewhere
  66.    (should be put in DOpus5:Icons/) -- hope you like them, too -- never again
  67.    do I want to even TRY to draw a fist in about 10 pixels.. argh.. Still,
  68.    for a non-artist I think the result is pretty good... Make sure the icon
  69.    is borderless as it looks much cooler.
  70.  
  71.    Knowing my luck I'll fall in that hole at the end of this road. Oh bugger.
  72.    Is it cold? Is it fhu... CHEESY PEAS!!  THINK CHEESE, THINK PEAS... THINK
  73.    No. Don't think. Thinking is bad. Thinking takes power from the individual
  74.    and gives it to the group. Avoid at all costs empowering yourselves for you
  75.    do not want power. Give it all to me. I'll take care of it all for you. I
  76.    am your friend. And I have lots of strawberry cheesecake for you. Yes,
  77.    yummy yummy. Here it is... Munchies!!
  78.  
  79.    If you want Beavis to be there from startup set "initstart" below to "y".
  80.    Whether you do or not a command called "OpenBeavis" will be added to Opus
  81.    which can be used to open him at any time. "OpenBeavis" takes an optional
  82.    argument which specifies the name of a different icon to use, without
  83.    ".info" at the end.
  84.  
  85. "Everyone's got to have the sickness, because everyone seems to need the cure"
  86. -----------------------------------------------------------------------------*/
  87. iconname  = "DOpus5:Icons/Beavis_HNL"
  88. initstart = y
  89.  
  90. opencommand = 'Run >NIL: Super-Select L Config:Lists/Samples_Beavis B "DH0:Tools/Music/Utils/DSound -2 -f -n -b51200 -w"'
  91. stopcommand = 'BreakName DSound'
  92. playcommand = 'Run >NIL: DH0:Tools/Music/Utils/DSound -2 -f -n -b51200 -w'
  93. pickcommand = 'Run >NIL: Execute S:Startups/SelectSample.script'
  94.  
  95. coolsaname.0 = "Ahhhh!"
  96. coolsample.0 = "DH2:Samples/Boot_Short/BnB/Ahhhhh.IFF"
  97.  
  98. coolsaname.1 = "Cornholio"
  99. coolsample.1 = "DH2:Samples/Boot_Short/BnB/Cornholio.IFF"
  100.  
  101. coolsaname.2 = "DahhDaDaDa..."
  102. coolsample.2 = "DH2:Samples/Boot_Short/BnB/DahhDaDaDa.IFF"
  103.  
  104. coolsaname.3 = "DunDunDunah..."
  105. coolsample.3 = "DH2:Samples/Boot_Short/BnB/DunDunDanah.IFF"
  106.  
  107. coolsaname.4 = "Laugh"
  108. coolsample.4 = "DH2:Samples/Boot_Short/BnB/Hehe2"
  109.  
  110. coolsaname.5 = "Insane"
  111. coolsample.5 = "DH2:Samples/Boot_Short/BnB/insane.membrane.IFF"
  112.  
  113. coolsaname.6 = "Inner Child"
  114. coolsample.6 = "DH2:Samples/Boot_Short/BnB/InnerChild.IFF"
  115.  
  116. coolsaname.7 = "Blue light special"
  117. coolsample.7 = "DH2:Samples/Boot_Short/BnB/JockStrap.IFF"
  118.  
  119. coolsaname.8 = "Oooh..."
  120. coolsample.8 = "DH2:Samples/Boot_Short/BnB/OOHH.IFF"
  121.  
  122. coolsaname.9 = "Score"
  123. coolsample.9 = "DH2:Samples/Boot_Short/BnB/Score.IFF"
  124.  
  125. coolsaname.10 = "10:00 pm..."
  126. coolsample.10 = "DH2:Samples/Boot_Short/BnB/Wiener.IFF"
  127.  
  128. coolsaname.11 = "Yeaaahh"
  129. coolsample.11 = "DH2:Samples/Boot_Short/BnB/yeaaaaaaaaah"
  130.  
  131. coolsaname.12 = "Zap 'im"
  132. coolsample.12 = "DH2:Samples/Boot_Short/BnB/ZapHimInTheButt.IFF"
  133.  
  134. /*---------------------------------------------------------------------------*/
  135.  
  136. options results
  137. options failat 11
  138. parse arg DOpusPort function source dest arguments
  139.  
  140. If (function~='init' & function~="OpenBeavis") then exit
  141.  
  142. CR = '0a'x
  143.  
  144. Address value DOpusPort
  145.  
  146. If ~Show('L','rexxsupport.library') then
  147.     call addlib('rexxsupport.library',0,-30,0)
  148.  
  149. /* add restart command (for restart after closing the icon) - quit after that if initstart off */
  150. if function = 'init' then do
  151.     dopus command "OpenBeavis" program "Beavis" desc "'(Re)open Beavis. huh huh, cool'" template "ICON/K"
  152.     if left(Upper(initstart),1) ~= "Y" then exit
  153.     end
  154.  
  155.  
  156. If (function="OpenIntOut" & arguments~="") then do
  157.     iconname = arguments
  158.     end
  159.  
  160. /* Where's your crown? King Nothin' */
  161.  
  162. /* Some quotes for the Information requester */
  163. quote.0 = "This sucks!"
  164. quote.1 = "Hey, baby. Come to Butthead"
  165. quote.2 = "I'm getting a woodro"
  166. quote.3 = "Diarreah, cha-cha-cha"CR"Diarreah, cha-cha-cha"
  167. quote.4 = "AHHH! Don't touch me, asswipe!"
  168. quote.5 = "When I was little and had no sense,"CR"I took a whiz on an electric fence,"CR"It hurt so bad, it shocked my balls,"CR"And then I took a crap in my overalls"
  169. quote.6 = "We're there, dude"
  170. quote.7 = "Dammit, Beavis, Pull up your pants"
  171. quote.8 = "He's fallen, and he can't get it up"
  172. quote.9 = "huh huh huh heh heh huh huh, yeah"
  173. quote.10 = "YOU WILL GIVE ME TP! BUNGHOLIO!!"
  174. quote.11 = "Are you threatening me?"
  175. quote.12 = "I'll kick your ass,"CR"then I'll wound your inner child"
  176. quote.13 = "Attention K-Mart shoppers:"CR"There's a blue-light special in the"CR"Jockstrap department"
  177. quote.14 = "It's 10:00pm: Do you know where you weiner is?"
  178. quote.15 = "Master Painting is cool"
  179. quote.16 = "We're like gunna have to mow the lawn,"CR"scrub the grill -- We're never gunna score!"
  180. quote.17 = "Don't make me shove this thing up your butt..."
  181. quote.18 = "When your wiener's happy, you're happy"
  182. quote.19 = "Zip 'im -- Zip 'im in the butt!"
  183. quote.count = 20
  184.  
  185. /* Get unique name and open a port. */
  186. Call Forbid()
  187.     i = 0
  188.     myportname = "DOBeavisIcon."i
  189.     Do i=0 While Show("P",myportname)
  190.         myportname = "DOBeavisIcon."i
  191.         End
  192.     If ~openport(myportname) then do
  193.         Call Permit()
  194.         dopus request '"Beavis Icon: Could not open message port" OK'
  195.         Exit
  196.         End
  197. Call Permit()
  198.  
  199.  
  200. /* See if there is any snapshot info in the icon's filecomment */
  201. address command "list >PIPE:"myportname" "iconname".info LFORMAT %c"
  202. if open(comfile,"PIPE:"myportname,"R") then do
  203.     comment = readln(comfile)
  204.     close(comfile)
  205.     end
  206.  
  207. If Word(comment,1) = "NudelSnap:" Then do
  208.     comment =   word(comment,2)
  209.     comcom  =  index(comment,",")
  210.     comx    =   left(comment,comcom-1)
  211.     comy    =  right(comment,length(comment) - comcom)
  212.     comment = "POS" comx comy
  213.     End
  214. Else
  215.     comment = ""
  216.  
  217. coolsaname.count = 0
  218. do i=0 while coolsaname.i ~= "COOLSANAME."i
  219.     coolsaname.count = coolsaname.count + 1
  220.     end
  221.  
  222. If i ~= 0 then do
  223.     coolsaname.count = i + 1
  224.     coolsaname.i = "---"
  225.     i = i + 1
  226.     End
  227.  
  228. coolsaname.count = i + 2
  229. coolsaname.i = "Select sample"
  230. i = i + 1
  231. coolsaname.i = "Stop sample"
  232.  
  233.  
  234. /* add an icon */
  235. dopus addappicon myportname "''" 1 comment icon iconname info snap close local menu coolsaname.
  236. icon=result
  237.  
  238. flag = 0
  239.  
  240. /* loop around */
  241. do while flag = 0
  242.     call waitpkt(myportname)
  243.  
  244. /* Why, hello handsome. What's a sex bomb like you doing in a script like this? */
  245.  
  246.     packet=getpkt(myportname)
  247.     arg0=getarg(packet,0)
  248.     arg1=getarg(packet,1)
  249.     arg2=getarg(packet,2)
  250.     arg3=getarg(packet,3)
  251.     arg4=getarg(packet,4)
  252.  
  253.     call reply(packet,0)
  254.  
  255.     if arg0 = 'doubleclick' then
  256.         address command opencommand
  257.     if arg0 = 'menu' then do
  258.             If arg2 = (coolsaname.count - 1) then address command stopcommand
  259.             If arg2 = (coolsaname.count - 2) then address command pickcommand
  260.             If arg2 < (coolsaname.count - 3) then address command playcommand coolsample.arg2
  261.             End
  262.     if arg0 = 'close' then flag = 1
  263.     if arg0 = 'removed' then flag = 2
  264.     if arg0 = 'info' then do
  265.         dopus setappicon icon busy on
  266.         flag_about = 0
  267.         do while flag_about = 0
  268.             x = Time(S) // quote.count
  269.             dopus request '"Beavis for Directory Opus'CR"by Leo 'Nudel' Davidson"CR||CR||Quote.x'" OK|More|Close'
  270.             about_result = RC
  271.             If about_result = 0 then do
  272.                 flag = 1
  273.                 flag_about = 1
  274.                 end
  275.             If about_result ~= 2 then
  276.                 flag_about = 1
  277.             end
  278.         dopus setappicon icon busy off
  279.         end
  280.     if arg0 = 'snapshot' then
  281.         address command 'filenote 'iconname'.info "NudelSnap:' arg2'"'
  282.     if arg0 = 'unsnapshot' then
  283.         address command 'filenote 'iconname'.info'
  284.     end
  285.  
  286. /* C'mon, get 'em off... */
  287.  
  288. /* remove icon */
  289. if flag~=2 then dopus remappicon icon
  290.  
  291. Call closeport(myportname)
  292.  
  293. /* Ding dong the door bells ring... I'm completely moose. Moooose. Moooooooooose! */
  294.  
  295. Exit
  296. /* Ever wondered how long ARexx wastes skipping past huge comments at the
  297.    top of people's scripts...   Shaa.. Some people. I don't know... */
  298.