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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting read (filenam.txt) then go to folder and delete (charactername.bic)
# 1  
Old 08-05-2012
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)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete oldest folder based on folder named as date

Hi, I have a script doing backup to synology server, the script create new folder each day with the date as being folder name i.e. 2018-07-30. Just before creating the new folder I want the script to find the oldest folder from the list and delete it including its content. for example... (3 Replies)
Discussion started by: humble_learner
3 Replies

2. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

3. Shell Programming and Scripting

Delete file2.txt from file1.txt using scripting

Hi, I`m a total newbie, well my requirement is that i have 2 files I want to identify which countries i do not currently have in db.. how can i use the grep or another command to find this file .. i want to match all-countries.txt with countries-in-db.txt so the output is equal to... (11 Replies)
Discussion started by: beanbaby
11 Replies

4. Shell Programming and Scripting

ksh shell script to add date (YYYYMMDDHHMISS) to all .txt files in a folder

Everyday 15 files are written to a folder \app\where\thefiles\are\destined\CURRFOLDER Task1: I need to add date in YYYYMMDDHHMISS format to each of them. Example: File: ACCOUNT.txt Should be updated as: ACCOUNT_20101005175059.txt Task 2: After I update the files, they need to be ... (2 Replies)
Discussion started by: Duminix
2 Replies

5. Homework & Coursework Questions

Delete first both lines from .txt

Hi, I have to programming a program in shell script which combine a lot of .txt files. But in all of these files the program had to delete the first both lines. Because I don't know anything about shell script I need your help. Does anyone have a command or a hint, where I can look for? ... (1 Reply)
Discussion started by: mkrol
1 Replies

6. Shell Programming and Scripting

Delete first and second lines from .txt

Hi, I have to programming a program in shell script which combine a lot of .txt files. But in all of these files the program had to delete the first both lines. Because I don't know anything about shell script I need your help. Does anyone have a command or a hint, where I can look for? ... (1 Reply)
Discussion started by: mkrol
1 Replies

7. Shell Programming and Scripting

delete all the files in folder a which exist in folder b

Hi , I need a script which basically deltes all files in folder a which are alreasy present in folder b say folder a has files abc.txt pqr .txt and b has abc.txt pqr.txt rmr.txt then file abc.txt and pqr.txt from a should be deleted (6 Replies)
Discussion started by: viv1
6 Replies

8. UNIX for Dummies Questions & Answers

can't read a .txt file

Hello, I have a set of .txt files I cannot read. This is a part of what I see. Is there a way to view these files? _MO<P.6D@K;WU<B$X-;)SIV/ROO!UL+1P=VTT-?,SLC`MI/6QMS#UYGGT\+)C=#\UIO`TL/0]=#/T) it's about 3 pages. Thanks for your help. Joe (3 Replies)
Discussion started by: rcracerjoe
3 Replies

9. Shell Programming and Scripting

sed to read x.txt and grep from y.txt

How would I write a command(s) to read from a file (list) that looks like this: 29847374384 and grep from a second file (list) that looks like this: 29847374384, jkdfkjdf,3833,ddd:confused: (1 Reply)
Discussion started by: smellylizzard
1 Replies

10. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies
Login or Register to Ask a Question