[SCRIPT] [2008.11.27] Automated Shopper v0.30 [WIP]

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
alex2069
Posts: 205
Joined: Thu, 22. Dec 05, 21:19
x3tc

[SCRIPT] [2008.11.27] Automated Shopper v0.30 [WIP]

Post by alex2069 » Tue, 25. Nov 08, 12:05

Automated Shopper v0.30 [WIP]
by alex2069

[ external image ] GameFront (.spk)
WARNING: This is a Work In Progress. It is functional, but most likely buggy, missing features, or incomplete features.
See the second post for a detailed version state and happenings.


:arrow: Install :arrow: Description
  • Sick of going from station to station trying to outfit your new fancy ship? Or are you hesitating buying that new wing of ships out of fear/frustration in trying to deck them out? Look not further.
    With this script you can give a ship a list of items to buy, and it will do its best to fulfil its duty!
:arrow: Usage and Details
  • The script requires Trade Command Software MKII installed on the ship in question (I'd recommend a fast TS ship, though any ship will work)
:arrow: Uninstall
  • Uninstall via. the plugin manager.
:arrow: Technical
  • Uses Text File and Page File 2072
  • Uses Trade Command Slot 453
:arrow: Version History
  • v0.30 - 2008-11-27 - Added ability to remove/change items + Added ship command status + Added organised ware menu (test release).
  • v0.20 - 2008-11-26 - Minor menu addition + More log details + Other small fixes/changes (test release).
  • v0.10 - 2008-11-25 - Initial Release (test release).
Last edited by alex2069 on Tue, 18. Oct 11, 06:26, edited 5 times in total.

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

Post by alex2069 » Tue, 25. Nov 08, 12:06

As this is a bit more of a complex script than my other two, I've decided to release it much earlier in its life cycle; otherwise it'd take weeks to get to where 'I' wanted it, lol.
Also since this is my first "big" script, and first script involving ship movements and commands, there are probably oddities all over the place while I learn more about ship controls and what not.

So, with that, I was sick of constantly ordering ships from station to station, especially when I wanted them to have a ton of items, so I've started writing this.

v0.30:
-Ware menu now clean/organised and generated from library files.
-The ships command status will tell you what item it is currently on, as well as its destination.
-Added ability to remove an item from the list.
-Added ability to change an item's quantity.
-The command/menu will no longer toggle/disengage the ships autopilot forcing you to start over.
-The item list will no longer be cleared after a successful shop.
-The ship will now correctly notify you via. the standard "Notify me once completed" option if applicable.

v0.20:
-Much more detailed logging added.
-Added info to the info-menu containing current list and general ship details.
-Couple of fixes/changes here and there.

v0.10:
It does the absolute minimum of what I wanted:
You can add items to its list, and you can tell it to start. (I'd recommend adding all the items BEFORE hitting start... I haven't tested what happens if you add items during, lol.
The ship currently REQUIRES a jump drive. :lol:
You can't remove items, and you can't change an items quantity once you've added it (but you can add it again I guess (not tested) to add more).
It will jump to sectors, dock, buy what it can, and continue until it has completed its list.
If it can't complete an item, it will go to the next one. At the end of the list, it will wait 5-6 seconds and loop back searching again.
Note: The list on a ship will never be cleared UNLESS it completes its list. However if it completes an item, it will never do it again. So it doesn't really matter that it's never cleared I guess... You can just keep adding more items indefinitely with no problems (I hope).
There is a command in the menu to clear all vars which will reset everything anyways, if something goes weird.

Also note, that debug is turned ON, and logging will be in text file 2072 (cleared each load).
Oh, and since it's very test-like, the ship's "Current Command" is pretty much always "None"... Not very helpful, but bleh.



I welcome (and encourage) any and all suggestions by people; the best scripts are those that are catered to the desires of the users.
Last edited by alex2069 on Wed, 26. Nov 08, 14:41, edited 2 times in total.

XFree
Posts: 62
Joined: Fri, 22. Jun 07, 16:37
x3tc

Post by XFree » Tue, 25. Nov 08, 13:19

Excellent idea :)
But won't work for me. I've fit a TS with jump drive and commercial software mk2, can the the menu of automated shopper, add item
- but can't see what i have had (is that normal?)

I'v tried dock and undock

After adding (one or more) items and push Start : it's stay inactive.

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

Post by alex2069 » Tue, 25. Nov 08, 13:29

Hmmm, I guess I should add in more detailed messages and state notifications, lol.
Does it have energy?

Also, check the log file, it will tell you. Tthe reason there is no in-game notifications is because I've had the log file open on the comp next to me constantly refreshing telling me what it's doing.
The log file is located in your My Documents > Egosoft > X3TC > log02072.txt

XFree
Posts: 62
Joined: Fri, 22. Jun 07, 16:37
x3tc

Post by XFree » Tue, 25. Nov 08, 13:44

I will chek the log. Yes it has energy cells. Enough to jump far away.
In: setup
In: main
In: menu
In: menu.additem
Ware Selected: Photopile
Amount: 500
In: items
In Sub: add
In: menu.additem
Ware Selected: Tourelle laser
Amount: 10
In: items
In Sub: add
In: menu.additem
Ware Selected: Circuits intégrés
Amount: 20
In: items
In Sub: add
In: main
State: null
In: main
In: menu
In: menu.additem
Ware Selected: null
In: menu.additem
Ware Selected: Photopile
Amount: 500
In: items
In Sub: add
In: main
State: null
In: main
In: menu
In: menu.additem
Ware Selected: Tourelle laser
Amount: 10
In: items
In Sub: add
In: main
State: null
In: main
In: menu
In: main
State: null
In: main
In: menu
In: menu.additem
Ware Selected: Tourelle laser
Amount: 10
In: items
In Sub: add
In: main
State: null
State : null is when i push START

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

Post by alex2069 » Tue, 25. Nov 08, 15:34

New version up now, try that.
If it still doesn't work paste me the log again; it's a lot more detailed and should help me pin-point it.
With that, time for me to sleep (I wasn't even supposed to do any more tonight, damn X3TC and its addictiveness).

XFree
Posts: 62
Joined: Fri, 22. Jun 07, 16:37
x3tc

Post by XFree » Wed, 26. Nov 08, 02:28

Sorry i was playing other game.

First of all : great job for the new menu : colors and status is better :)

I've tried (it's late here) only few things but i can say that it work.
Add laser turrets, and it go (with jump drive) to buy it somewhere.

BUT there is a problem : the status remain inactive, very... surprising.
In: setup, Version: 20
[YTSES-29] In: main
[YTSES-29] In: menu
[YTSES-29] In: menu.generateinfo
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] In: menu.additem
[YTSES-29] Ware Selected: Tourelle laser
[YTSES-29] Amount: 10
[YTSES-29] {YTSES-29} In: items
[YTSES-29] {YTSES-29} In Sub: add
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: set, VarString: a2069.autoshop.vars.items.YTSES-29, Value: ARRAY ( ARRAY(3) )
[YTSES-29] In: menu.generateinfo
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: set, VarString: a2069.autoshop.vars.state.YTSES-29, Value: start
[YTSES-29] In: main (after menu)
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] State: start
[YTSES-29] In: work
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] Items Found: 1
[YTSES-29] Do Item [0]: ARRAY ( Tourelle laser , 10, 0 )
[YTSES-29] Do Item [0]: Tourelle laser , Quantity Remaining: 10
[YTSES-29] Jumping to station Avant poste Militaire(Cœur du Royaume), Sector: Cœur du Royaume
[YTSES-29] In: main
[YTSES-29] In: menu
[YTSES-29] In: menu.generateinfo
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: set, VarString: a2069.autoshop.vars.state.YTSES-29, Value: start
[YTSES-29] In: main (after menu)
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] State: start
[YTSES-29] In: work
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.state.YTSES-29, Value: null
[YTSES-29] {YTSES-29} In: vars
[YTSES-29] {YTSES-29} Action: get, VarString: a2069.autoshop.vars.items.YTSES-29, Value: null
[YTSES-29] Items Found: 1
[YTSES-29] Do Item [0]: ARRAY ( Tourelle laser , 10, 0 )
[YTSES-29] Do Item [0]: Tourelle laser , Quantity Remaining: 10
[YTSES-29] Jumping to station Avant poste Militaire(Cœur du Royaume), Sector: Cœur du Royaume
[YTSES-29] Arrived at Station: Avant poste Militaire(Cœur du Royaume)
[YTSES-29] Buying x2 of ware Tourelle laser
[YTSES-29] Bought x2 of Tourelle laser , Remaining: 8
[YTSES-29] Do Item [0]: Tourelle laser , Quantity Remaining: 8
[YTSES-29] Jumping to station Avant poste Militaire(Soleil Noir), Sector: Soleil Noir

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

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

There ya go XFree; v0.30 - The status of a ship will actually tell you what it's doing. Also, the list will no longer be cleared after completion (it kind of sucked losing your hard-chosen list without warning), and you can now remove items from the list as well as change their quantities.

However there is still little in the way of messages to the player concerning problems (not enough e-cells, not found, can't dock, etc - I want to get it actually working before I do this).

XFree
Posts: 62
Joined: Fri, 22. Jun 07, 16:37
x3tc

Post by XFree » Wed, 26. Nov 08, 16:20

New menu is very good. Stop now work and remove item too. We can select what we remove.
Status is currently active and we can see what it's doing.

Just : in main menu, wares are not in collumns. But not a problem.
http://nsa03.casimages.com/img/2008/11/ ... 784638.jpg


Great work :)

Thrandisher
Posts: 357
Joined: Sun, 1. Jul 07, 03:33
x4

Post by Thrandisher » Sat, 29. Nov 08, 08:06

I am haveing a problem with this. I can tell it i want to buy 7 hept's and it will goto one place, buy em, and stay there, then after a few minutes it will start to slow down my performance. Noticed a bunch of NULL in logbook which i think is comeing from it when it stay's like that.
I know the ts could dock at another argon place and buy them and had around 4k energy so jumping wasnt a problem.

John2022
Posts: 9
Joined: Tue, 26. Jul 11, 13:41

Post by John2022 » Thu, 18. Aug 11, 23:50

Hi
Already a Work in progress or ...hum? :?

Post Reply

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