WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

UT2004 Cache Convertor


Got sick of the cached files expiring and clearing them selves out forcing re-download of the same files so I wrote a little script. Nothing awesome and there are other similar tools out there, but why use those when you have winbatch?

Stick it in your cache directory, change the path to the cache.ini and off you go...

;--------------------------------------------
; UT2004 cache to permanent files convertor
; -= KK (Crypt) 2004 =-
;--------------------------------------------

Files=IniItemizePvt("cache", "C:\UT2004\Cache\cache.ini");change to your path
Count=ItemCount(Files,@TAB)
fh=FileOpen("output.txt","WRITE") ; if you want a historical log change to append

for x=1 to count
iniitem=itemextract(x,Files,@TAB)
File=IniReadPvt("cache", iniitem, "", "C:\UT2004\Cache\cache.ini")
Extension=itemextract(-1,File,".")
If !FileExist(Strcat(iniitem,".uxx")) Then goto SkipCopy
If Extension=="uax" Then FileMove("%iniitem%.uxx","..\Sounds\%File%",@TRUE) ;UAX Sounds
If Extension=="ut2" Then FileMove("%iniitem%.uxx","..\Maps\%File%",@TRUE) ;ut2 Maps
If Extension=="usx" Then FileMove("%iniitem%.uxx","..\StaticMeshes\%File%",@TRUE) ;usx StaticMeshes
If Extension=="utx" Then FileMove("%iniitem%.uxx","..\Textures\%File%",@TRUE) ;utx Textures
If Extension=="u" Then FileMove("%iniitem%.uxx","..\System\%File%",@TRUE) ;u System

:skipCopy
IniDeletePvt("cache",iniitem, "C:\UT2004\Cache\cache.ini")

:log
outdata=Strcat(iniitem,"=",File)
FileWrite(fh,outdata)
; Message("",file)

next

FileClose(fh) 

Article ID:   W16707
File Created: 2005:02:18:12:21:56
Last Updated: 2005:02:18:12:21:56