[Script] Autotransfer Alternative and Station Profit Monitoring v1.23 7-3-06
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
[Script] Autotransfer Alternative and Station Profit Monitoring v1.23 7-3-06
This piece of scripting has two functions. The first is an autotransfer credits alternative to run on your stations. I've released this before but now I've gotten rid of some bugs and am making it v1.0. The second is a profit monitoring tool, which outputs to a txt file that can be imported into a spreadsheet (or the like) and displayed nice and graphically. Full descriptions below.
1) Autotransfer Alternative 1.2:
This handy function replaces the built in "Autotransfer Credits to Player" station command with "Autotransfer Credits". This functions the same as the official script except it keeps a record of how much credits have been transfered. Using the "Request Update" station command, a readout of the stations total credits made and credit making rate is made to the players logbook.
For example:
EXAMPLE COMING SOON
I like this script because I can keep track of which stations are pulling their weight and which are languishing behind. The script remembers how many credits have been made and how long the script has run for, even if deactivated, thus allowing top ups to be made.
IMPORTANT (fixed in v1.2 but still applicable): Top ups cause problems. Because the only way in which the script can monitor the amount of credits the station has made by keeping track of the amount of credits transfered to player, it will not be able to tell the difference between credits you have added and credits it has made. Thus transfereing 1 trillion credits with a credit limit of 100k will give you quite a large spike in the stations profits!!! (Yes I realise 1 trillion credits can't be obtained in this game easily. Shame on you for picking that up!)
The best way I have for topping up stations is switching temporarily to the official transfer credits until you're willing to leave the station alone. This includes new stations, wait till they're trading independently before using this script.
2) Profit Monitoring 1.0
This is quite a simple tool. It requires you to be running Autotransfer Alternative to work. Choose Monitor Station in the station commands to activate. You will be asked for a 5-digit number for the log file name and how many minutes between updates. I like 5 minutes.
The script will make sure you have not duplicated log book entries between stations, and if so will not run and leave a message in the log book with details of the station using that particular log file. At this stage, you can only use a log number once for ever, until I can figure out a (elegant) way around it. You can deactivate the script on a station and then activate the script on the same station, and this will accept the same log entry as previously used on the station.
The output file is located in the X3 directory on your computer in a file named logXXXXX.txt, where XXXXX is the 5-digit number choosen for that station. The file consists of two headings and two columns of data. The left column is the time in minutes while the right column is the credits made. The columns are seperated by comma delimiters. Below is an example:
COMING SOON
I'll check tomorrow how to load the data in to Excell, I think you choose import data somewhere. In OpenOffice, open up Calc and then go FILE - OPEN and choose the file type as Text CSV (*.csv, *.txt) and choose comma delimiters from the options.
I'm not going to go into how to display the data, unless I'm begged to. Pretty standard method for plotting graphs. In either Excell or Calc, choose scatter graph with lines, not line graph. I will say however, to display the "run-rate" (think cricket) which is total credits / total time, start in row 1 and do something like:
=B1 / A1
then fill it down to bottom.
And lastly, here are links to the scripts. I recommend Cycrows installer because I'm liable to decide its all wrong and needs a complete overhaul, and it'll make life easier for everyone. But I include a zip and a rar anyways.
Updated Links
Autotransfer and Profit Monitor Package v1.23 SPK
Autotransfer and Profit Monitor v1.2 RAR - Currently out of service (due to extreme laziness
Autotransfer and Profit Monitor v1.23 ZIP
Note: Autoupdate not working
Update Notes:
v1.23
- Actually fixed the problems. Finally.
v1.22
- Fixed conflict with DDRS, added no functionality so don't update if you don't have a problem
v1.2
- New option to set lower credit limit for station. If station goes below this threshold, credits are deducted from the players account and recorded as a negative transfer by the script. If you enter null for this value, then no lower limit is set. This feature enables you to transfer credits to the station and have it recorded correctly.
v1.1
- Fixed a wrong commenting out of code which left the script writing to the log book rather than log file when station monitoring was on.
v1.0
- Initial release
NB:
I have included extra scripts for removing or starting the autotransfer script for every station. They so far must be run from the script menu. Ask me if you need a better interface. The scripts are:
JR.StartAuto.AllStations :- Will start script in every player owned station with the same initial values as set when running the script
JR.CancelAuto.AllStations :- Will stop script in every player owned station and start the original transfer script (official) with choosen initial value. Second input is for a number, if 1 is entered, then the script will also set the local variables used (importantly the variables holding the time run for and the total credits saved) to null, thus if scipt is run again, it will start from 0,0.
Planned Updates:
- Stuff I'm asked for. Please ask. I want to feel needed
STATION COMMANDS USED: 41,42,43
TEXT FILE USED: 7700
1) Autotransfer Alternative 1.2:
This handy function replaces the built in "Autotransfer Credits to Player" station command with "Autotransfer Credits". This functions the same as the official script except it keeps a record of how much credits have been transfered. Using the "Request Update" station command, a readout of the stations total credits made and credit making rate is made to the players logbook.
For example:
EXAMPLE COMING SOON
I like this script because I can keep track of which stations are pulling their weight and which are languishing behind. The script remembers how many credits have been made and how long the script has run for, even if deactivated, thus allowing top ups to be made.
IMPORTANT (fixed in v1.2 but still applicable): Top ups cause problems. Because the only way in which the script can monitor the amount of credits the station has made by keeping track of the amount of credits transfered to player, it will not be able to tell the difference between credits you have added and credits it has made. Thus transfereing 1 trillion credits with a credit limit of 100k will give you quite a large spike in the stations profits!!! (Yes I realise 1 trillion credits can't be obtained in this game easily. Shame on you for picking that up!)
The best way I have for topping up stations is switching temporarily to the official transfer credits until you're willing to leave the station alone. This includes new stations, wait till they're trading independently before using this script.
2) Profit Monitoring 1.0
This is quite a simple tool. It requires you to be running Autotransfer Alternative to work. Choose Monitor Station in the station commands to activate. You will be asked for a 5-digit number for the log file name and how many minutes between updates. I like 5 minutes.
The script will make sure you have not duplicated log book entries between stations, and if so will not run and leave a message in the log book with details of the station using that particular log file. At this stage, you can only use a log number once for ever, until I can figure out a (elegant) way around it. You can deactivate the script on a station and then activate the script on the same station, and this will accept the same log entry as previously used on the station.
The output file is located in the X3 directory on your computer in a file named logXXXXX.txt, where XXXXX is the 5-digit number choosen for that station. The file consists of two headings and two columns of data. The left column is the time in minutes while the right column is the credits made. The columns are seperated by comma delimiters. Below is an example:
COMING SOON
I'll check tomorrow how to load the data in to Excell, I think you choose import data somewhere. In OpenOffice, open up Calc and then go FILE - OPEN and choose the file type as Text CSV (*.csv, *.txt) and choose comma delimiters from the options.
I'm not going to go into how to display the data, unless I'm begged to. Pretty standard method for plotting graphs. In either Excell or Calc, choose scatter graph with lines, not line graph. I will say however, to display the "run-rate" (think cricket) which is total credits / total time, start in row 1 and do something like:
=B1 / A1
then fill it down to bottom.
And lastly, here are links to the scripts. I recommend Cycrows installer because I'm liable to decide its all wrong and needs a complete overhaul, and it'll make life easier for everyone. But I include a zip and a rar anyways.
Updated Links
Autotransfer and Profit Monitor Package v1.23 SPK
Autotransfer and Profit Monitor v1.2 RAR - Currently out of service (due to extreme laziness
Autotransfer and Profit Monitor v1.23 ZIP
Note: Autoupdate not working
Update Notes:
v1.23
- Actually fixed the problems. Finally.
v1.22
- Fixed conflict with DDRS, added no functionality so don't update if you don't have a problem
v1.2
- New option to set lower credit limit for station. If station goes below this threshold, credits are deducted from the players account and recorded as a negative transfer by the script. If you enter null for this value, then no lower limit is set. This feature enables you to transfer credits to the station and have it recorded correctly.
v1.1
- Fixed a wrong commenting out of code which left the script writing to the log book rather than log file when station monitoring was on.
v1.0
- Initial release
NB:
I have included extra scripts for removing or starting the autotransfer script for every station. They so far must be run from the script menu. Ask me if you need a better interface. The scripts are:
JR.StartAuto.AllStations :- Will start script in every player owned station with the same initial values as set when running the script
JR.CancelAuto.AllStations :- Will stop script in every player owned station and start the original transfer script (official) with choosen initial value. Second input is for a number, if 1 is entered, then the script will also set the local variables used (importantly the variables holding the time run for and the total credits saved) to null, thus if scipt is run again, it will start from 0,0.
Planned Updates:
- Stuff I'm asked for. Please ask. I want to feel needed
STATION COMMANDS USED: 41,42,43
TEXT FILE USED: 7700
Last edited by fortysix2nz on Tue, 7. Mar 06, 09:57, edited 12 times in total.
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
Here are two graphs I prepared earlier. As links so they don'y fill up your screen. only like 8kB each. These are from my Solar Power Complex in a sector
Profit Rate
Profits
Profit Rate
Profits
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
Fixed the RAR and ZIP links. Was getting late last night and couldn't be bothered checking them properly. Hope its working alright for anyone that has downloaded it. I included a bunch of scripts with it, most are not really necessary, they're helpful if people run into troubles and I need to give a hand. If you use Cycrow's installer, a couple of scripts are marked as "shared". Unless I release any other scripts, just ignore, you're safe to remove. Its just that a few of my scripts could end up using those.
Its a shame stations cannot really run into the red, that would give the graphing side a bit more of a reason to exist. But it is fun anyway
Its a shame stations cannot really run into the red, that would give the graphing side a bit more of a reason to exist. But it is fun anyway
An idea regarding the autotransfer.
How about a global command to set all stations t the same transfer amount. for instance, if you have 70 stations but only have a handful where the auto amount for transfer would be different, then this would help. You would set them all globally and then amend the handful instead of setting each one manually (and often duplicating).
Or, how about global for all stations of the same type. For instance, if you do the command on a SOlar Plant, the option to 'Set for all Solar Plants'.
How about a global command to set all stations t the same transfer amount. for instance, if you have 70 stations but only have a handful where the auto amount for transfer would be different, then this would help. You would set them all globally and then amend the handful instead of setting each one manually (and often duplicating).
Or, how about global for all stations of the same type. For instance, if you do the command on a SOlar Plant, the option to 'Set for all Solar Plants'.
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
Yup. Back from holiday.
Good idea, will put that 'dip into' one in. How would you want it done? I can either turn the Print Report or whatever it is into a multi-option selection so you'd say choose 1 for Print, 2 to set lower cap, 3 etc for anything else I think of, or I can have a seperate option for it so there would be three commands in the station menu for this script (not ideal cause there's only a limited number of station commands for scripts) or, I could make it an option when you set the script running on a station, so you'd have to select max and min amount for the station to hold, or lastly I could have a hardwired lower bound.
Sorry for the lack of formatting, but anyone prefer any in particular?
I was also thinking of making a command to add credits to a station that would mark itself on the total amount saved. Would be more cumbersome but would do the job.
Anyways, will get onto it tomorrow sometime. To tired now. Also, in my haste I forgot to mention that I updated to v1.1 cause v1.0 wasn't writing to a logfile, it was writing to a logbook for the Monitor command. Whoops
Good idea, will put that 'dip into' one in. How would you want it done? I can either turn the Print Report or whatever it is into a multi-option selection so you'd say choose 1 for Print, 2 to set lower cap, 3 etc for anything else I think of, or I can have a seperate option for it so there would be three commands in the station menu for this script (not ideal cause there's only a limited number of station commands for scripts) or, I could make it an option when you set the script running on a station, so you'd have to select max and min amount for the station to hold, or lastly I could have a hardwired lower bound.
Sorry for the lack of formatting, but anyone prefer any in particular?
I was also thinking of making a command to add credits to a station that would mark itself on the total amount saved. Would be more cumbersome but would do the job.
Anyways, will get onto it tomorrow sometime. To tired now. Also, in my haste I forgot to mention that I updated to v1.1 cause v1.0 wasn't writing to a logfile, it was writing to a logbook for the Monitor command. Whoops
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
UPDATE
v1.2
New option to set lower credit limit for station. If station goes below this threshold, credits are deducted from the players account and recorded as a negative transfer by the script. If you enter null for this value, then no lower limit is set. This feature enables you to transfer credits to the station and have it recorded correctly.
v1.2
New option to set lower credit limit for station. If station goes below this threshold, credits are deducted from the players account and recorded as a negative transfer by the script. If you enter null for this value, then no lower limit is set. This feature enables you to transfer credits to the station and have it recorded correctly.
thanks fortysix2nz
Sorry for not responding to your question. However, your final solution seems good to me.
I did just have q uick test and couldn't get the minimum amount input. It seems when i run the command it asks for the 'high' amount but at no point asks for th e'low' amount.
I have not tried rerunning the script though, so it may be that. Any other ideas or thoughts?
Keep up the good work.
Sorry for not responding to your question. However, your final solution seems good to me.
I did just have q uick test and couldn't get the minimum amount input. It seems when i run the command it asks for the 'high' amount but at no point asks for th e'low' amount.
I have not tried rerunning the script though, so it may be that. Any other ideas or thoughts?
Keep up the good work.
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
Weird, I use the SPK myself, and it works fine. You downloaded v1.2. If you go to the scripts directory and doubleclick on JR.AutoMoneyTransfer.xml the top should read:
Script JR.AutoMoneyTransfer
Version: 2
for Script Engine Version: 31
Description
Autotransfers credits to player, keps record of credits transfered
Arguments
* 1: UpperCap , Number , 'Transfer at:'
* 2: LowerCap , Number , 'Lower credit cap:'
Did ZIP work?
Script JR.AutoMoneyTransfer
Version: 2
for Script Engine Version: 31
Description
Autotransfers credits to player, keps record of credits transfered
Arguments
* 1: UpperCap , Number , 'Transfer at:'
* 2: LowerCap , Number , 'Lower credit cap:'
Did ZIP work?
Yep, I have that version as above.
Just tried again and I only get one screen asking or upper limit. Tried on many station types.
I think it would be useful if someone else had a quick test as it may be my game which is corrupt (I use over 20 other scripts).
Still, I do hope to get it working when I next reinstall
Just tried again and I only get one screen asking or upper limit. Tried on many station types.
I think it would be useful if someone else had a quick test as it may be my game which is corrupt (I use over 20 other scripts).
Still, I do hope to get it working when I next reinstall
-
- Posts: 84
- Joined: Wed, 3. Dec 03, 09:48
@djssuk
the line-
* 2: LowerCap , Number , 'Lower credit cap:'
should ensure you get asked for a lower cap. Since its an argument. I really don't know what is wrong if you have the line on the script you downloaded. PM me if you want and I'll give you an email address you can send a save too.
@Mailo
Cheers. I felt the same and it worked out to be a good first script for me to write.
the line-
* 2: LowerCap , Number , 'Lower credit cap:'
should ensure you get asked for a lower cap. Since its an argument. I really don't know what is wrong if you have the line on the script you downloaded. PM me if you want and I'll give you an email address you can send a save too.
@Mailo
Cheers. I felt the same and it worked out to be a good first script for me to write.
-
- Posts: 19
- Joined: Sat, 12. Nov 05, 05:54
Hi fortysix2nz,
I'm running into an odd issue when running DDRS at the same time as your Autotransfer Alternative and Station Profit Monitoring v1.2, and I wanted to see if you'd heard of this happening before.
Whenever I try to assign a station a new command (Station->"Command Console"->Add a new command), in the list of available commands a couple of your commands are replaced with DDRS commands. Specifically, the "Autotransfer Credits [AutoT.St]" command is replaced by "Build Ship [BuSh]" and the "Request Update [AutoT.Pr]" command is replaced by "Remodel Ship [ReSh]" If I do a "Reinit Script Caches," everything is fine (the DDRS scripts disappear and yours appear in the correct location). But I have to reinit the cache every time I run the game (the fix isn't persistent).
Are you aware of any way to fix this? I can't remove the DDRS mod, as all my current save games are using this mod. And I'd really like to use your scripts - they add so much value to my play!
Thanks for any input.
I'm running into an odd issue when running DDRS at the same time as your Autotransfer Alternative and Station Profit Monitoring v1.2, and I wanted to see if you'd heard of this happening before.
Whenever I try to assign a station a new command (Station->"Command Console"->Add a new command), in the list of available commands a couple of your commands are replaced with DDRS commands. Specifically, the "Autotransfer Credits [AutoT.St]" command is replaced by "Build Ship [BuSh]" and the "Request Update [AutoT.Pr]" command is replaced by "Remodel Ship [ReSh]" If I do a "Reinit Script Caches," everything is fine (the DDRS scripts disappear and yours appear in the correct location). But I have to reinit the cache every time I run the game (the fix isn't persistent).
Are you aware of any way to fix this? I can't remove the DDRS mod, as all my current save games are using this mod. And I'd really like to use your scripts - they add so much value to my play!
Thanks for any input.