home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 October / Amiga_Games_Extra_CD_10-96.bin / rexx / suffer.rexx < prev    next >
OS/2 REXX Batch file  |  1996-06-28  |  3KB  |  133 lines

  1. /* Suffer 1.0 (c) by Marcel Doering (DonDoringo@XOX.commo.mcnet.de)
  2.    Supplemental-Arexx-Script for HippoPlayer (c) by K-P Koljonen
  3.  
  4.    This script requests the name of the playing module from HiP and
  5.    then switches the suffix. For example if the name is
  6.    Modules:test.mod the module`s new name will be modules:mod.test.
  7.    This also works vice versa.
  8.  
  9.    Greets to Kari Pekka Koljonen for sending me this idea.
  10.  
  11.    REQUiREMENtS:
  12.    -------------
  13.  
  14.    Amiga, 1 Meg of free RAM, HiPPOPlAYER by K-P Koljonen,
  15.    RexxTricks.library 38.4 and better, RexxReqTools.library,
  16.    RexxSupport.library, some Soundmodules, little bit of brain.
  17.    Steer it all togehter and mix really hard, there you go,
  18.    this is 'Suffer'. ;)
  19.  
  20.    CREDiTS:
  21.    --------
  22.  
  23.    'Suffer' was written on an AMIGA 1200/030/50MHz, OS 3.1
  24.    with 18 MByte RAM. It was tested on an AMIGA 4000,
  25.    OS 3.1, Cyberstorm 060` and Cybergraphics, together with
  26.    34 Meg of RAM.
  27.  
  28.    CoPYRiGHt:
  29.    ----------
  30.    This script should be shipped with the HiPPOPLAYER
  31.    distribution package by K-P Koljonen, it must not be
  32.    sold for any profit ! It`s allowed to put it on Aminet
  33.    and Aminet-CD`s as long it`s in unchanged condition.
  34.    It`s absolutely FD, that means you can use it however
  35.    you want, you might change it for private use only,
  36.    you MUST NOT put changed versions without my permission
  37.    into the public domain !
  38.  
  39.    BuGS:
  40.    -----
  41.    If you find an bug (very unpropable), write me via E-Mail
  42.    with an short description of it and I`ll fix it.
  43.  
  44. */
  45.  
  46. IF ~SHOW('LIBRARIES','rexxreqtools.library') THEN DO
  47.    IF ~ADDLIB('rexxreqtools.library',0,-30,0) THEN DO
  48.          SAY 'No tritonrexx.library found !'
  49.          SAY 'Available on Aminet !'
  50.    EXIT(10)
  51.    END
  52. END
  53.  
  54.  
  55. IF ~SHOW('LIBRARIES','rexxtricks.library') THEN DO
  56.    IF ~ADDLIB('rexxtricks.library',2,-30,0) THEN DO
  57.       SAY 'No Rexxtricks.library found !'
  58.       Say 'Available on Aminet !'
  59.       EXIT(10)
  60.     END
  61. END
  62.  
  63. IF ~SHOW('LIBRARIES','rexxsupport.library') THEN DO
  64.    IF ~ADDLIB('rexxsupport.library',0,-30,0) THEN DO
  65.       SAY 'No Rexxsupport.library available '
  66.       EXIT(10)
  67.     END
  68. END
  69.  
  70.  
  71. OPTIONS RESULTS
  72.  
  73. gplay:
  74. ADDRESS 'HIPPOPLAYER'
  75. GET PLAY
  76. playing=result
  77.  
  78. if playing=0 then do
  79. nop=rtezrequest('HiP must be playing an Module, try again ?','_Yes|_No','Error !','rtez_flags=ezreqf_centertext','rtez_defaultresponse = 0',)
  80. if nop=1 then
  81. call gplay
  82. if nop=0 then
  83. exit(5)
  84. end
  85.  
  86. gcnam:
  87. options results
  88.  
  89. address 'HIPPOPLAYER'
  90.  
  91. GET CNAM
  92. filename=result
  93. address
  94.  
  95. oldfile=filename
  96.  
  97. if filename='' then do
  98. cgf=rtezrequest('Error getting filename from HiP, try again ?','_Yes|_No','Error !','rtez_flags=ezreqf_centertext','rtez_defaultresponse = 0',)
  99. if cgf=1 then
  100. call gcnam
  101. if cfg=0 then
  102. exit(5)
  103. end
  104.  
  105. suffix=SUFFIXPART(filename)
  106. direct=PATHPART(filename)
  107. dname=FILEPART(filename)
  108.  
  109. differencer=''
  110.  
  111. IF RIGHT(direct,Length(direct)-Length(direct)+1)~=':' then
  112. differencer='/'
  113.  
  114. if suffix='' then do
  115. nsuf=rtezrequest('Error getting Suffix from file, maybe it`s name is already mod.#? ?','_Could be','Error !','rtez_flags=ezreqf_centertext','rtez_defaultresponse = 0',)
  116. exit(5)
  117. end
  118.  
  119. PARSE VAR filename filename '.' (suffix)
  120. filename=FILEPART(filename)
  121.  
  122. newfile=direct''differencer''suffix'.'filename
  123.  
  124. address command 'C:Rename 'oldfile' 'newfile''
  125.  
  126. ADDRESS 'HIPPOPLAYER'
  127. DEL
  128. exit
  129.  
  130. ADD newfile
  131.  
  132. exit
  133.