Page 1 of 1 1
Topic Options
#133149 - 2005-01-31 01:19 AM Need help getting started in the right direction
ChadOx Offline
Lurker

Registered: 2005-01-30
Posts: 1
I'm not new to scripting... but I am new to advanced scripting. I've been using KiXtart for a while now as a logon script processor for my domain controllers.

However, this is not work related. I've come to realize the potential for KiXtart. I'm in a gaming clan. Every match we need to record demos and take screenshots. We then upload those demos and screenshots to an FTP server.

Now... I've decided to try and help our clan out. Most of our members are not very computer savvy. They have no idea how to zip files up and how to transfer them via FTP... even though I've posted very detailed steps on how to do so. Therefore, I've decided to make a simple to use utility for them (using KiXtart) that will do the following:

1. convert screenshots from BMP format to JPG format using external utility - using pvw32con.exe
2. zip up their demos and screenshots (making an external call to WinZip Command line add-on)
3. save zip files to a "que" for later transfer (make a simple ini file for this)
4. transfer "que'd" files when user ready by using external ncftpput.exe (part of the ncftp package)

I have a good start on my script. However, this script is becoming much more complex than what I'm used to. Where I'm having difficulty is here...

All demos and screenshots are stored in a certain folder on the hard drive (this folder varies on each computer). I'm doing a check on a registry key to find the folder location to help minimize user input.

The problem - the users don't necessarily clean out the contents of their game folder. Therefore I can't take a blanket wildcard statement to grab *.bmp and convert them to *.jpg and then add *.jpg to the zip file I'm creating.

What I need to do is this...
Use the DIR() function to find all BMP files... then display all found BMP files on screen and let the user select which of the BMP files need to be zipped up.

I'm sure this can be done... but I've become lost trying to figure out how.

On a second question.... I have an option for the users to delete all demo files and screenshots from their game folder. I tried to use the built in function DEL() but am unable to due to long file name problems from the command line. Instad I had to use the SHELL statment to use native oS delete...

:RemoveDemos
CLS
$removedemos = MessageBox("This will erase ALL DEMOS AND SCREENSHOTS from your $dodfolder folder. Do you wish to continue?", "FILE ERASE WARNING", 308)
If $removedemos = 6
Shell 'CMD.EXE /C DEL "' + $dodfolder_nqbae + '\*.dem"'
Shell 'CMD.EXE /C DEL "' + $dodfolder_nqbae + '\*.bmp"'
Shell 'CMD.EXE /C DEL "' + $dodfolder_nqbae + '\*.jpg"'
$rc = MessageBox("All demos and screenshots in your $dodfolder folder have been deleted!", "Demos and screenshots deleted", 48)
EndIf
If $removedemos = 7 Goto "MainProgramMenu"
EndIf

$dodfolder is found by examining for a particular key in the Registry. This location will be different on every computer.

The default location is usually...

C:\Program Files\Steam\SteamApps\\day of defeat\dod

However, I've seen three different variations of the Steam installation that installs the files into different folders...

C:\Valve\Steam\....
C:\Program Files\Valve\Steam\....

Then there's the obvious alternate location - intentionally installing to a different folder or a different hard drive.

The location is stored in the registry, so it's easy enough to locate. However, if I try to use any of the KiXtart functions for DIR(), DEL(), etc... I cannot due to long file name operations.

In a DOS environment through Windows... any file operations pertaining to long file names either must have quotes around the entire object... or use shortened 8.3 convention of accessing the objects. Due to the necessity of encasing my filenames within quotes... the KiXtart processor fails when working with long file names (yet the SHELL command works for some reason). I've tried the single quote character and I've tried the CHR(34) reference, all to no avail.

DEL '"' + $dodfolder_nqbae + '\*.dem"'

Is the command I would expect to work but it doesn't. Does anybody have any ideas how to get around this?

Thanks in advance,

ChadOx

Top
#133150 - 2005-01-31 04:21 AM Re: Need help getting started in the right direction
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You seem to be asking for too much in one post, but I will give you one little snippet of advice. AFAIK KiX has no problem with properly formatted long document names.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133151 - 2005-01-31 04:37 AM Re: Need help getting started in the right direction
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Hello ChadOx and welcome to the board.

I agree with Les. Don't recall KiXtart v4.22 having any issues with long file names.

What version of KiXtart are you using and what OS are the other game players using?

All of what you ask can easily be done with KiXtart, but might be nicer to do in KiXforms which can handle user feedback a lot easier then KiXtart alone. However I'm sure that it can all be done in KiXtart alone as well.


Why don't you post the code you're currently using (please remember to use the code tags to preserve the formatting).

Then maybe we can further assist you in your task.

You could also look at this post for how to handle the folders and dates and deletes and newer images to show.

Scanning sub folders
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB14&Number=129805


Edited by NTDOC (2005-01-31 04:45 AM)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 363 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.131 seconds in which 0.069 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org