Teladi Information Technologies Inc. - Profit Opportunity Scanner

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply

Do you find this upgrade useful?

Yes
4
57%
No
1
14%
Only some parts of it
2
29%
 
Total votes: 7

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Teladi Information Technologies Inc. - Profit Opportunity Scanner

Post by azaghal » Fri, 7. Dec 07, 16:29

Profit Opportunity Scanner

The idea behind this script is to allow player to easily find wares that he needs, at right price, or to find good spots for selling goods, or to find good spots for placing factories. In other words - it scans for good profit opportunities. But the service is not free. Each scanning is charged per sector scanned, and per station match, so input your arguments wisely.
Let me know if you find any bugs, or have any feature requests.

From 'README' file:

Code: Select all

WARNING: FILE USES *NIX LINE ENDINGS!
================================================================================
Name        : Profit Opportunity Scanner
Version     : 0.1
Author      : azaghal
Contact     : Via Egosoft forum.
Description : Provides access to Teladi Information Technologies Inc. profit
              analysis services.
================================================================================

Installation
------------
    Extract the zip file into "X2: The Threat" installation directory. All the
files should end-up in correct places. If unsure, all *.xml files except
441024.xml file should end-up in 'scripts' directory in your main installation
directory, while 441024.xml should end-up in 't' directory.
    If you are a GNU/Linux user, instead of extracting to your "X2: The Threat"
installation directory, you may want to extract the files into '~/.lgp/x2'
directory (within that directory you should have directories 'scripts' and 't'
created).

Commands
--------
1: Analyse ware offer/demand in sectors...
    - This command will request a report from TIT Inc. mainframe about ware
      offer and demand in all sectors within specified jump range from starting
      sector. Report will contain information about number of suppliers, and
      primary and secondary consumers of specified ware per EXACT jump radius.
      This command is useful for finding good locations for factories (locating
      sectors that have a big demand for some ware, and small number of
      suppliers nearby).
    = 3 Arguments: Ware, starting sector, jump range from starting sector.

2: Scan sectors for wares...
    - This command will request a report from TIT Inc. mainframe about wares
      stock availability in stations of sectors within the specified jump range
      from the starting sector, based on ware category.
      Report will contain information about station, jump distance of sector it
      is located within, and wares details like name, availability, and price
      for each station.
      This command is useful when trying to find well-stocked or poorly-stocked
      stations in surrounding sectors. Poorly-stocked stations might also offer
      jobs for quick delivery of wares (if it's a primary resources).
    = 5 Arguments: Starting sector, jump range, ware category, minimum
      availability, maximum availability. Ware category can be any of the
      strings 'product', 'primary', 'secondary', and 'misc' for station product,
      station primary resource, station secondary resource, or other wares in
      station, in that order. Minimum and maximum availability are specified as
      promilles and represent how full the storage areas for wares are.

Current bugs and issues
-----------------------
 * None that I know of.

ChangeLog
---------
0.1 - First official release
[ external image ]
Last edited by azaghal on Fri, 14. Dec 07, 17:59, edited 1 time in total.

User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Fri, 7. Dec 07, 21:36

hi azaghal

nice to see some new X2-script :)

On the %%-issue:
If $current is the current stock, and $maximum is your maximum stock for each ware, you can easily create a string $arg for the current stock percentage, using the line

Code: Select all

$arg = 10000 * $current / $maximum
$arg = ( ( $arg - ( $arg mod 100 ) ) / 100 ) + "." + ( $arg mod 100 ) + " %"
This is a lot of maths, but creates a really exact value for the stock percentage. Just use this and see what it does if you feel like doing so. ;)

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Fri, 7. Dec 07, 22:42

Thanks for that tidbit of code. I was wondering if I should do something like that. I managed to print promilles when writing to log file, but X2 obviously can't display them ;)

Here's a screenshot of the script output so far. I've made a short range scan in order to fit everything to one screen. There's many colours there, mostly because I wanted to see how it would look like. I'll probably reduce them.

Screenshot

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Sun, 9. Dec 07, 21:28

Ok, I've finally written this thing (for start only that "ware scan" option is available). The package should be considered alpha. Waiting for feedback.

Download script

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Fri, 14. Dec 07, 18:00

Official release, version 0.1 is finally available. See the first post for download links. Awaiting comments (hopefully). ;)

User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

Post by Chris Gi » Tue, 18. Dec 07, 13:31

I will try it. But it may take a while, because I'm busy with other X2 related things.... (I wonder if there's any shortage of ressources in my custom map :D ).

One question:
azaghal wrote:Report will contain information about number of suppliers, and primary and secondary consumers of specified ware per EXACT jump radius.
Does this mean it only shows the result of stations three jumps away (given a jump range of 3), not those of stationens 2 jumps away?

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Tue, 18. Dec 07, 18:14

Chris Gi wrote:I will try it. But it may take a while, because I'm busy
azaghal wrote:Report will contain information about number of suppliers, and primary and secondary consumers of specified ware per EXACT jump radius.
Does this mean it only shows the result of stations three jumps away (given a jump range of 3), not those of stationens 2 jumps away?
Report will include sectors at jump range of 3, 2, 1, and 0 (in your example where maximum jump range is 3). It's just that it will show you number of producers/consumers for range 3, not including sectors at jump range <=2, then for jump range 2, not including sectors at jump range <=1 (and not including those at jump range of 3, of course), etc.
Just to be sure, here's an example of sectors:
S1 - S2 - S3

So, let's say S1 is starting sector, jump range entered is 2, and we want ore report. In S1 we have 1 ore mine, and 2 consumers. In S2 we have 4 consumers, in S3 we have 5 consumers, and 1 ore mine (you'll get the primary/secondary report, but I'm lazy to type it all:). So, the report would looks something like this:

Code: Select all

There are 5 consumers, and 1 suppliers at jump radius of 2.
There are 4 consumers, and 0 suppliers at jump radius of 1.
There are 2 consumers, and 1 suppliers at jump radius of 0.
I think with this example it will be clear :)
I was actually beating my head on how to explain the report thing, actually. If anyone can figure out a better sentence for README, let me know ;)

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Fri, 15. Feb 08, 21:15

Does it have any known problems with other scripts? I've installed it and everything seems to be ok, but it doesn't appear at the Teladi Equipment docks so I cannot buy it.
Cada estrella podria ser la ultima.

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Fri, 15. Feb 08, 22:09

It might conflict with some of the scripts out there (due to limited number of slots for software upgrades). I can't tell for sure with which ones, though. :)

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Fri, 15. Feb 08, 23:09

Ok, but anyways the problem it's not that the software doesnt work; there is no such software, it simply doesn't appear at the Teladi equipment dock wich makes me think maybe it's a wares command interference. I'm using Cycrow's Bounty Hunter, Stiehl Corp Station Upgrades, Complex kit and FLDS and Bonus Pack (but don't think the last one has something to do since is very common and most scripters have it).

Only Bounty Hunter and Complex Kit add new wares and no one of those add new trade command at the ship console.

Thanks azaghal.
Cada estrella podria ser la ultima.

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Sat, 16. Feb 08, 10:41

There's a limited number of software upgrade wares that can be "dynamically" added to the game. So, if one more software upgrade uses the same ware I selected, one of them won't show-up. :)

User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

Post by Chris Gi » Sat, 16. Feb 08, 11:05

Even if two different software upgrades use the same ware, they both should show up. But both software upgrades use the same name.

I just downloaded the package and checked the scripts. It seems the script get.all.stations.by.type called by add.upgrade.to.docks is missing. That is the reason the software doesn't show up.

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Sat, 16. Feb 08, 11:15

Chris Gi wrote:Even if two different software upgrades use the same ware, they both should show up. But both software upgrades use the same name.
I'm not so sure about this, but ok :)
Chris Gi wrote:I just downloaded the package and checked the scripts. It seems the script get.all.stations.by.type called by add.upgrade.to.docks is missing. That is the reason the software doesn't show up.
Well, the script is present in the downloaded file. I wonder if the problem comes from me using *nix line endings, and not the Window$ ones.

User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

Post by Chris Gi » Sat, 16. Feb 08, 11:25

Oh sorry, I used the second DL which gave me the tit_inc_pos.zip. Maybe Inda downloaded this file, too?

Edit:
Just checked with the package 'Profit Opportunity Scanner 0.1.zip'. Everything works allright for me, but I have no other ware with id 5853.

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Sun, 17. Feb 08, 14:47

I downloaded the one that directs you to RapidShare, the second one I think.

I tried it with only Bonus Pack and BHunter and didnt work, I'm gonna try it alone to see if it presents the problem that way.
Cada estrella podria ser la ultima.

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Sun, 17. Feb 08, 14:53

Please download again, that was a testing release ;)
The REAL link is in the first post. :)
Last edited by azaghal on Sun, 17. Feb 08, 14:54, edited 1 time in total.

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Sun, 17. Feb 08, 14:54

Lol, thanks you a lot. But do I have to download it from the link at the top or the second one?
Cada estrella podria ser la ultima.

azaghal
Posts: 94
Joined: Wed, 21. Mar 07, 13:19
xr

Post by azaghal » Sun, 17. Feb 08, 15:04

The links on the FIRST POST are the "official" links to download. There's also this nice "Download" image there, that's actually an URL link :)

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Sun, 17. Feb 08, 15:43

Ok, thanks. But it wouldn't 've beeb the first time the first post isn't updated with the last ones, so I wasn't sure, thanks again.
Cada estrella podria ser la ultima.

Inda
Posts: 235
Joined: Sun, 22. Jul 07, 17:11

Post by Inda » Sun, 17. Feb 08, 15:44

Ok, thanks. But it wouldn't 've been the first time the first post isn't updated with the last ones, so I wasn't sure, thanks again.

Edit: It seems to work and by the moment I haven't seen any problems with Cycrow's BHunyer or Bonus pack.
Cada estrella podria ser la ultima.

Post Reply

Return to “X²: The Threat - Scripts and Modding”