Locating Code for Best Buy/Sell

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
CaplinCaplin
Posts: 94
Joined: Wed, 16. Jan 19, 20:23
x3ap

Locating Code for Best Buy/Sell

Post by CaplinCaplin » Fri, 1. Feb 19, 22:15

Hi All,

I'm trying to script a function for the Best Buy/sell locator, because the default one doesn't really play very well with OCR.

I was wondering where exactly this is located in the game's code? Is it hard-coded somewhere or is there a script command being run I could look at? I want to basiclaly just reformat the info already presented, and log it to a file, same as my trade script.

Thanks for any insights.

Taylor2008
Posts: 295
Joined: Fri, 20. Mar 09, 16:38
x4

Re: Locating Code for Best Buy/Sell

Post by Taylor2008 » Sat, 2. Feb 19, 08:21

Maybe this can help you : viewtopic.php?t=223503 .

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Re: Locating Code for Best Buy/Sell

Post by Cycrow » Sun, 3. Feb 19, 19:48

the best buys/sells locator simply gets all the products/resources in sector, and display the one with the best price.

you can create the same functionality via a script.

create an array of ware wares in sector, then for each ware create 2 arrays, one with the station and one with the price. Sort both arrays using the price array as the data one (sort the station array first).
Then simply grab the first entry from each array and log it

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”