home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 167.lha / Player / PackSk.Rexx < prev    next >
OS/2 REXX Batch file  |  1988-04-28  |  1KB  |  45 lines

  1. /* Consolidate skill list to eliminate unused skills */
  2. /* Works on currently selected character */
  3. options results
  4. src=2
  5. dest=1
  6. shell player
  7. 'lock'
  8. do until src>43
  9.   /* Check if a skill line is unused */
  10.   say 'Checking skill line' dest
  11.   'get skill' dest 'num'
  12.   if result=0 then do
  13.     /* Find the next skill which is used, stop if end is passed */
  14.     'get skill' src 'num'
  15.     do while result=0 & src<43
  16.       src=src+1
  17.       'get skill' src 'num'
  18.     end
  19.     /* If we exited because we found a skill, move it into unused slot */
  20.     if result~=0 then do
  21.       say 'Replacing line' dest 'with line' src 
  22.       'get skill' src 'num'
  23.       'set skill' dest 'num' result
  24.       'get skill' src 'name'
  25.       'set skill' dest 'name' result
  26.       do z=1 to 4
  27.         'get skill' src 'prime' z
  28.         'set skill' dest 'prime' z result
  29.         'get skill' src 'weight' z
  30.         'set skill' dest 'weight' z result
  31.       end
  32.       'get skill' src 'tp'
  33.       'set skill' dest 'tp' result
  34.       'set skill' src 'num 0'
  35.     end
  36.   end
  37.   dest=dest+1
  38.   src=src+1
  39. end
  40.  
  41. /* Recalculate and redisplay */
  42. 'redisplay'
  43. 'unlock'
  44. exit
  45.