SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-04-10, 01:55 AM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default [Tec] Python Script to renumber items in .ini files

Here's a little jewel of a script I wrote to renumber the items in the .ini files. It will renumber them starting with 1 and incrementing the count for each item. This is handy when you insert or delete items from the .ini file so you don't have to manually correct the 'holes' or additions or even worry if you duplicated a number or not.
Take the Page layout.ini file for example. Let's say you add 35 entries to it dealing with adding dials or something. Let's say you added it somewhere in the middle of the file. That file has 442 entries in it stock. Do you really want to manually fix 200+ entries? Hell no!! This is where this little gem shines.
You also have the ability to rename the items in the .ini file. Say the same file above we wanted to use D3D instead of G3F...again this little jewel comes to your rescue!
I'm writing more scripts to help figure out this mess of a so called sim game we have been handed by Ubi
You have to have python installed on your computer for these to work. Python is a free download. Google it. I'm using version 2.6

http://www.filefront.com/15736129/Page-Renumberer.py/

TheDarkWraith

Edit:

It does NO error checking to ensure you enter the correct values (user input errors). If you're using it you should know what you're doing and thus shouldn't need the error checking. Plus it's a python script, not an application and thus I didn't bother taking the time to code in user input error checking. It will 'bark' if you do something wrong.

Last edited by TheDarkWraith; 03-04-10 at 03:12 AM.
TheDarkWraith is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.