read (filenam.txt) then go to folder and delete (charactername.bic)

I am hosting a nwserver.That is a Neverwinter Nights game server on linux Ubuntu 11.04 server.

I need help creating a script to read a .txt and retrieving character logins and character names.

The game will make a .txt in folder home/nwn/(filenam.txt).

Then I will make a crontab job to run script to read it and go to /home/nwn/servervault/(loginname)/(charactername.bic)

//////////////////////////////////////////////////////////////////////////////////////
I have the tools from another individual that does the script in game but was meant to be on a windows server so no script to read .txt .Here is his instructions below.

// Version 1.0
// AleStorm PvP Server listed under Team
// 10/24/07
// (Written in C++ for our NWN mod.)
// by: Kree

Instructions after unzipping:

  1. Import the .erf into your module.
    It contains 2 placeables, a conversation, a couple of scripts, an item, and an NPC.
  2. Place the placeables somewhere out of the way. They don't have to be accessible.
    (Note: These are called " and /. These HAVE to be in the mod somewhere for this to work)
  3. Place the NPC (under Custom, NPCs, Other called Reaper of Souls) somewhere your players can talk to it.
  4. Place the .exe file in your NWN installation folder INSIDE the folder servervault.
  5. When you are ready to delete the files, simply doubleclick the .exe file you just put in.
    (Note: its a good idea to do this in between server resets. When you are done, erase the nwServerLog1.txt file.
    That way you aren't wiping over and over the same characters. This is found under Logs.0 inside your NWN installation folder)

Included is a demo module. You don't have to use this if you don't want to. It's simply there so you can see it in action quickly.

How it works (Quick Version):
The NPC logs the following in your nwServerLog1.txt:
ERASE (pc login) or
VAULTWIPE (pc login)

/////////below is windows instructions /I need to replace with script

when you double click the exe file:
It will vault wipe any logins that are requested.
It will automatically erase any characters that were requested.

Technical Notes (The Long Version):
The C++ program looks in your server log for the key word, 'ERASE' followed by a log in name.
It also looks for the key word 'VAULTWIPE' followed by '*.bic'
It creates several batch files with this information.
These batch files first delete any .bic file inside the logins requested by VAULTWIPE.
Then it goes into each folder requested by ERASE and copies all their character .bic files into character.txt files.
This is done so another batch file can scan the txt files for the key phrase 'DeleteMePlease'.
(The players get the item in their inventory when they want to erase that specific character by talking to the Reaper of Souls NPC.)
It then makes a nice list looping until all the ERASE calls are done.
It runs the list, deleting ONLY those .bic files that had the DeleteMePlease key phrase inside them.
Then like a good little program, it cleans up after itself for the next time you want to use it.

Thats it ! ENJOY !

Your help is appreciated. I will try to get the .txt file from actual game and post.

---------- Post updated at 02:33 PM ---------- Previous update was at 11:59 AM ----------

Ok here is what is in the serverlog.txt
It looks like vaultwipe shows and can wipe all characters in the login file.
I dont see any character single character file .

I opened this in notepad:

Loading Module: AleStormServerDeleter_Demo
Connection Attempt made by 222222quick (Q76U4FU6)
[Sun Aug 5 14:17:13] 222222quick (Q76U4FU6) Joined as Player 1
VAULTWIPE "222222quick\*.bic"
[Sun Aug 5 14:18:17] 222222quick Left as a Player (0 players left)
Connection Attempt made by 222222quick (Q76U4FU6)
[Sun Aug 5 14:18:40] 222222quick (Q76U4FU6) Joined as Player 1
ERASE "222222quick"
[Sun Aug 5 14:19:00] 222222quick Left as a Player (0 players left)
Connection Attempt made by 222222quick (Q76U4FU6)
[Sun Aug 5 14:19:24] 222222quick (Q76U4FU6) Joined as Player 1
ERASE "222222quick"
[Sun Aug 5 14:20:10] 222222quick Left as a Player (0 players left)