home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
arexx
/
ep_pack
/
ep_techlist.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-10-13
|
4KB
|
200 lines
/*
Technolister By Warp of GiGA Productions...©1996
Designed for 'Eagleplayer v1.54c Generic' (Should work on older vers!·)
Use this to generate a list, of your best techno-modz!?
Assign a Hotkey to this script, using option=ADD, then whenever
you hear a cool module, you press the hotkey...KEWL!
Then it's Friday, and you want to hear only your coolest modz!,
but you can't seem to remember a single filename...Hmmm!
YUP! You run Technolister with the 'USE' option (via Hotkey!),
This proggy then scans your modlist, and plays one of them...(Random!)
ß·) - simple huh?
BTW: The datafile is stored in 'S:Techno.dat' as plain ASCII...
History:
V1.1 - 13 Oct 1996 - When in USE mode:
Cleans up the list, so it only stores one of each mod.
The Writing process is done after the mod. Has been loaded.
When using CLR mode, backups are made (S:Techno.BAK - Hey Source!)
V1.0 - 17 May 1996 - Initial release.
*/
Xver='V1.1'
Parse upper arg OPT
Waittime=5
Testflag=0
Time ('R')
Options results
do while (Testflag=0) & (Time('E') < Waittime)
if (pos('rexx_EP',SHOW('Ports')) ~= 0) then testflag =1
end
if testflag=0 then do
say 'Eageplayer could not be reached...Try starting it...'
exit(0)
end
Address 'rexx_EP'
EXI = exists('S:Techno.dat')
if EXI ~= 1 | OPT='CLR' then do
IF EXI = 1 then address command "C:Copy S:Techno.dat S:Techno.BAK"
Success = Open(ModFile,'S:Techno.dat',Write)
if Success = 0 then do
Say 'IO-Error!!!! - quitting...'
exit(0)
end
call Close(Modfile)
end
if OPT='CLR' then do
Scrolltext 'Modlist is cleared...Backup: S:Techno.BAK'
Exit(0)
end
Select
when opt = 'ADD' then do
status m fil
Modname = result
Success = Open(ModFile,'S:Techno.dat',Append)
if Success = 0 then do
Say 'IO-Error!!! - quitting...'
exit
end
Call WriteLN(ModFile,Modname)
Call Close(ModFile)
Scrolltext Modname' has been added...\X/'
end /* END ADD */
when opt = 'USE' then do
if exists('S:Techno.dat') = 1 then do
Success = Open(ModFile,'S:Techno.dat',Read)
if Success = 0 then do
Scrolltext 'IO-Error!!! - quitting...'
exit
end
mod.=''
modcoun=0
Do while EOF(ModFile) ~= 1
modcoun = modcoun + 1
mod.modcoun = ReadLN(Modfile)
end
Call Close(ModFile)
modcoun=modcoun-1
mods.=''
modscoun=0
do i = 1 to modcoun
if LookUp(mod.i) = 0 then do
modscoun = modscoun + 1
mods.modscoun = mod.i
end
end
if modscoun<2 then do
Scrolltext 'Modlist is empty, add some first...(Min. 2 Max .?)'
exit
end
status m fil
Modname = result
status m dir
modpath = result
seed = time(s)
ran = random(1,modscoun,seed)
do while mods.ran = modname
seed = time(s)
ran = random(1,modscoun,seed)
end
pmod='"'||modpath||'" '
pmod=pmod||'"'||mods.ran||'" '
do i=1 to modscoun
if i~=ran then do
pmod=pmod||'"'||mods.i||'" '
end
end
Loadmodule pmod
Success = Open(ModFile,'S:Techno.dat','W')
if Success = 0 then do
Scrolltext 'IO-Error!!! - quitting...'
exit
end
Do i = 1 to modscoun
Call WriteLN(ModFile,Mods.i)
end
Call Close(ModFile)
end
end /* END USE */
otherwise do
Say '' ; Say Center(".·Welcome to Technolister "XVER" By Warp oh' GiGA Prod. ©1996·.",80)
say '' ; say ' Designed only for use with Eagleplayer V1.52+'
say ''
say ' Usage:'
say ' Rx S:EP_Techlist.rexx [Add | Use | Clr]'
say '' ; say ''
say ' Please see the top of the Source for more detailed explantion of the prog...ß·)'
end /* END HELP */
end /* END Select */
exit(0)
/* Funcs() - Begin */
Lookup: Procedure Expose mods. modscoun
Parse arg mod
Do M = 1 to modscoun+1
If mod = mods.M then return M
End
Return 0
/* Lookup() checks if a mod. is already in the list, and returns it's position
If it can't find it, it returns 0
*/