[SCRIPT] [2012.04.02] Universal Best Buys/Sells Locator v2.51a

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

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

Post Reply
alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

[SCRIPT] [2012.04.02] Universal Best Buys/Sells Locator v2.51a

Post by alex2069 » Thu, 13. Nov 08, 04:14

Universal Best Buys/Sells Locator v2.51a
by alex2069

:arrow: Install
  • SPK (recommended)

    [ external image ] GameFront (.spk) [version 2.51]
    [ external image ] GameFront (.spk) [version 2.51a by dblade - Note: This version does not have Ship IDs; if that doesn't concern you, get this one (see version history)]
    To install, use Cycrow's Plugin Manager.
  • ZIP

    [ external image ] GameFront (.zip)
    To install, extract to your X3TC directory, or more specifically, open the zip file, files in the scripts folder go in scripts folder, t in the t folder.
    If it asks to overwrite any files, do so (will just be an older/same versions or my library files from some of my other scripts).
:arrow: Description
  • Sick of having to go from sector to sector trying to find the best price? Or can't seem to find that last weapon to outfit your ship? Or trying to find a ship or station to buy, but can't seem to find which shipyard it's sold at?
    With the Universal Best Buys/Sells Locator, you needn't look any further. Simply use it, select the desired ware, and you'll receive a nicely displayed and sorted list of all the known stations sorted by price, quantity and jumps.

    The Menu:
    [ external image ]

    The Output:
    [ external image ]

    The Ship Selection:
    [ external image ]

    This Ship Selection v2.51a (update by: dblade)
    [ external image ]
:arrow: Usage
  • Commands through the Trade section on your command console. Select either Universal Best Buy or Universal Best Sell, then select a ware.
    Requires that the ship have Best Buys Locator or Best Sells Locator installed.
:arrow: Disclaimer
  • This is my first "real" script... So here's hoping your computers don't blow up (should be fine, lol).
    The script was initially going to be a conversion of Tomcat's X3R script, however in the end it was a complete rewrite with only the output remaining slightly similar.
:arrow: Uninstall
  • Uninstall via. the script package.
:arrow: Technical
  • -Uses Text File and Text Page 2070.
    -Uses Trade Command Slots 451 (BB) and 452 (BS).
:arrow: Version History
  • v2.51a - 2012.04.02 (by dblade).
    • Added isbb checks and/or title args as needed.
      Added different title on the menu screens (according to hotkey command launched: 'Universal Buy Locator' or 'Universal Sell Locator').
      Removed the ship ID from the ship select screen.
      Changed ship command to display a more human readable form (green "Idle") instead of COMMAND_NONE.
  • v2.51 - 2009.12.30
    • Fixed debug switch I'd left on (thanks draba).
  • v2.50 - 2009.12.06
    • Updated the send script so it now uses my intelligent jump lib (automatic energy refuelling, etc).
      Updated the sent ship to use its command status so it will now notify you if you have it set.
      Updated the Save Results to Log to include the Race and Notoriety.
      Added ability to force jump drive usage on sending ships.
      Added the option to message you when the sent ship arrives.
      Fixed a few graphical issues that had been irritating me.
      Fixed a bug relating to gate-less/"disconnected" sectors like Aldrin causing inf. loops.
      Changed the 'E' to 'Enemy' (was annoying me; looks nicer, lol).
      Fixed a couple more read-text errors.
  • v2.41 - 2009.12.02
    • Fixed minor read-text error.
  • v2.40 - 2009.12.02
    • Added a Race column to the results.
      Added a Notoriety column to the results (Green = Can Buy, Red = Can't, 'E' = Enemy Station; e.g. Argon Sector M148).
      Fixed a bug where not-known stations would be added to the list (correctly fixed this time).
      Fixed a player relations bug where many items would turn up as not sold anywhere.
  • v2.32 - 2009.12.01
    • Fixed a stupid bug that would overwrite the pageId number that occurred only on first installs.
  • v2.31 - 2009.11.31
    • Fixed a minor library start up error.
  • v2.30 - 2009.11.30
    • Added ability to change sorting order for the Jumps, Price, and Quantity.
      Added ability to select/send a ship to a station result (uses standard !moveto.station script at the moment).
      Gave the results system an overhaul - No longer uses messages, columns neater, etc.
      Added a hotkey setup - This currently *requires* Cycrow's Hotkey Manager (http://forum.egosoft.com/viewtopic.php?t=226805).
      Fixed a bug where unknown stations would be returned (thanks ThisIsHarsh).
      Modified a lot of the t-file usage. It should be a lot easier to completely translate now.
  • v2.21 - 2008.12.06
    • Fixed null ware menu bug.
      Fixed a couple of minor spelling errors.
  • v2.20 - 2008.12.05
    • Menu has 3x new categories for easy ship outfitting.
      Now uses my own array sort and text fill library (much much faster).
      Fixed a bug where copy button would not be available.
  • v2.10 - 2008.11.26
    • Menu now uses lib files.
      Using will no longer toggle/interrupt the autopilot.
  • v2.00 - 2008.11.24
    • Major code overhaul (increased speed).
      Added menu caching to increase speed (reset each game load).
      Only displays "valid" wares (no more blank or unknowns).
      Now only displays wares that can actually be bought or sold.
      Added ability to save to player log.
  • v1.10 - 2008.11.18
    • Added custom menu.
      Random bug fixes.
  • v1.00 - 2008.11.13
    • Initial release.
_________________
My X3TC Scripts:
Universal Best Buys/Sells Locator
Automated Satellite Network
Station Repacker
Automated Shopper
My Library Scripts
Last edited by alex2069 on Mon, 2. Apr 12, 09:54, edited 30 times in total.

Chroniss
Posts: 155
Joined: Mon, 10. Nov 03, 21:15
x3tc

Post by Chroniss » Thu, 13. Nov 08, 05:03

Works good here. Thanks for this script, its extremely helpful.

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Thu, 13. Nov 08, 05:43

Sweet! Thanks a bunch for this. Any reason why there's a choice of "null" when the menu pops up? Not a big deal, since I don't select it, just wondering. :)

Gotta love this script! 8)

-Grax

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Thu, 13. Nov 08, 06:26

The arg type is Var/All Wares... For some reason it's just there...
I'm unsure how to get rid if it (if it's possible), but selecting it is basically just like "cancel" in this case.
If someone knows how to get rid of it, it'll do it, but yea, it annoys me too, lol.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 13. Nov 08, 06:49

Use a custom menu [script function], add all wares to the menu items.

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Thu, 13. Nov 08, 07:08

Hmmm, I was thinking about doing that in a later release (custom menus) for more configuration and what not. I'll have a look at it.

Painman
Posts: 1694
Joined: Fri, 6. Apr 07, 07:12
x3tc

Post by Painman » Sun, 16. Nov 08, 04:01

This is handy!

At the moment, it looks like it only works with property that's deployed in space, ie. if I park a ship at a dock in a sector rather than deploy a sat or what-not, I don't get any info from that sector in the report.

But still, thanks for the script ;)

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Sun, 16. Nov 08, 04:51

I will just say "yes!"

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Sun, 16. Nov 08, 15:54

Painman wrote:This is handy!

At the moment, it looks like it only works with property that's deployed in space, ie. if I park a ship at a dock in a sector rather than deploy a sat or what-not, I don't get any info from that sector in the report.

But still, thanks for the script ;)
Ah, opps. I'd assumed the "get all from sector" did it. Apparently not.
I've fixed that, and made it a little more efficient (for some reason I originally decided to check for in-sector presence EVERY station, lol).

I've also got the whole custom menu thing down, so next version should be nice a "neat" once I finish it (tomorrow).
On that note, does anyone know of any good ware type lists? From my guess work 5 and 6 are stations, 7 are ships, 8 are weapons, 9 shields, 10 missiles... Is there a proper list somewhere? x.x

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Mon, 17. Nov 08, 15:45

Alrighty, added the pretty menu (no more null! lol), and made it so docked ships are included as in-sector, also fixed a couple of oddities here and there.
Currently the ware list includes some... Odd entries... (blank or duplicate entries for things that shouldn't be)... I'm not sure why this is, but it's a lot more "pretty" and functional than it used to be, so meh. I'll figure it out later.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Mon, 17. Nov 08, 18:29

Sounds cool, but I don't want any spoiler entries of dodgy or plot-only or whatever wares...

There is a script command, I think in the universe command menu, to check if an item is 'known' by the player. I assume that does the same thing as like in the encyclopedia that only shows items that have been discovered.

Also, does this script only search for best price in sectors where the player has some property, or all sectors regardless?

Painman
Posts: 1694
Joined: Fri, 6. Apr 07, 07:12
x3tc

Post by Painman » Tue, 18. Nov 08, 00:57

ThisIsHarsh wrote:Also, does this script only search for best price in sectors where the player has some property, or all sectors regardless?
It only reports from sectors in which you have assets, and basically just summarizes it for you. Not abusive.

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Mon, 24. Nov 08, 06:27

@ThisIsHarsh: That command doesn't work for wares (I had tried it already - it says "yes" to discovered for everything). Fixed that now though.

Alrighty, nice v2.00 update for peoples.

-Fixed the stupid double mines thing in the factories ware list.
-All those Unknown Object or blank wares are no longer in the listings.
-It will now only display wares that can actually be bought or sold (so no more plot objects or anything weird like that).
-Due to the above (and custom menus in general) in order to increase display speeds, the menus that don't change between loads will be cached (you'll notice it if you go to All Wares, then esc and go back - instant the second time).
-Added the ability to save the output to your log so you don't have to do it over and over when trying to order your ships around.
-And just general code optimisations, as I've learnt a lot more than when I first wrote it.
-Also removed the "Natural" ware section (none of them can be bought or sold anyways).

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Mon, 24. Nov 08, 08:01

Thanks for the update, Alex, and keep up the good work! I use this thing about once every 20 minutes on average. :)

-Grax

angrysquirrel
Posts: 267
Joined: Tue, 18. Nov 03, 00:46
x3

Post by angrysquirrel » Tue, 25. Nov 08, 02:05

nice job. Thanks!

User avatar
TSM
Not a Moderator
Posts: 2947
Joined: Thu, 1. Jul 04, 12:31
x4

Post by TSM » Tue, 25. Nov 08, 02:47

Great Job Alex been very useful to Equip my fleet :) and its pretty useful for the hub aswell :wink:
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

Painman
Posts: 1694
Joined: Fri, 6. Apr 07, 07:12
x3tc

Post by Painman » Tue, 25. Nov 08, 03:45

Agreed, this is a very handy tool :thumb_up: it beats manually checking every sector by a light year!

Thanks for sticking with the project and making it better :)

camus2555
Posts: 6
Joined: Mon, 24. Nov 08, 16:37
x4

Post by camus2555 » Tue, 25. Nov 08, 21:52

thanks i was looking for a script like this, yours is very helpfull :D

alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

Post by alex2069 » Wed, 26. Nov 08, 14:11

Minor update for people:
v2.10
The Menu uses my shared library files (see below), and (YAY!!!) using the script will NOT toggle/interrupt the autopilot any more. Damn that was annoying me.

In my quest to create an Automated Shopper, the ware menu will now be usable through simple library scripts (as the auto shopper needed a "cleaned" ware menu as well).
This also means that the menu and lists will be cached between them giving even more speed for all! I don't know about you, but I skip through the menus like a crazy man on speed, and slow custom menus annoy me, lol.

Esgaro
Posts: 91
Joined: Tue, 25. Nov 08, 06:42
x3tc

Post by Esgaro » Thu, 27. Nov 08, 02:35

This sounds extremely useful, but the plug-in manager crashes for me, and looking at the thread, many other people when it exits. I tried extracting the script manually and putting it in the X directory, but it doesn't seem to work. Is there anything extra I need to do?

Post Reply

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