Page 11 of 15

Re: AI Trading Assistant

Posted: Wed Jan 07, 2015 2:15 pm
by Wildeblood
From what you described earlier, I was expecting to see in the log an error, "Parse failed in ai_trading_interfaces.js" and maybe a line number where could be found a stray control character or something. It sounded like the other scripts were loading but the interfaces script (the ugly duckling of the family) was not, but according to that log all the scripts are successfully loaded.

I can only suggest to stick with it for a while and see what happens; unless you specifically want to try out Market Observer there's no reason to remove the Trading Assistant OXZ, it won't interfere with anything else. This will require the attention of smarter people than me.

Re: AI Trading Assistant

Posted: Wed Jan 07, 2015 4:22 pm
by Marte
No sweat. I've played around with the game and now I've found this clue in the log. :)

Code: Select all

15:54:20.585 [script.javaScript.exception.ooliteDefined]: ***** JavaScript exception (AI Trading Interfaces 2.12.3): Error: Station.setInterface: Invalid arguments ("docking_history") -- expected key [, definition]; if definition is set, 'title' property must be a non-empty string..
15:54:20.585 [script.javaScript.exception.ooliteDefined]:       /Users/Marte/Library/Application Support/Oolite/Managed AddOns/oolite.oxp.Wildeblood.ai_trading.oxz/Scripts/ai_trading_interfaces.js, line 24.
Gotcha?! ;)

AI Trading Assistant version 2.13.1

Posted: Thu Jan 08, 2015 6:24 am
by Wildeblood
Version 2.13.1 is now available from the OXZ manager.

Recent changes:

2.13.1 (January 8th, 2015)
(1) Docking history was broken on first run. It should now work correctly, even in the strange case of the ship not being docked at start.
(2) Clutching at straws, trying to resolve Marte's bug I can't reproduce. Something is going wrong with expandMissiontext() in ai_trading_interfaces.js.

2.13 (October 26th, 2014) Added export legality display mode, and retired the plug-in called AI Trading Legality Reminder.

Re: AI Trading Assistant version 2.13.1

Posted: Thu Jan 08, 2015 12:38 pm
by Marte
Wildeblood wrote:
Version 2.13.1 is now available from the OXZ manager.

Recent changes:

2.13.1 (January 8th, 2015)
(1) Docking history was broken on first run. It should now work correctly, even in the strange case of the ship not being docked at start.
(2) Clutching at straws, trying to resolve Marte's bug I can't reproduce. Something is going wrong with expandMissiontext() in ai_trading_interfaces.js.

2.13 (October 26th, 2014) Added export legality display mode, and retired the plug-in called AI Trading Legality Reminder.
Flying around in the space, I've caught an interstellar flu... When I get well, I'll try the update to see if anything is changed. ;)

Re: AI Trading Assistant version 2.13.1

Posted: Fri Jan 09, 2015 12:08 am
by Diziet Sma
Wildeblood wrote:
Clutching at straws, trying to resolve Marte's bug I can't reproduce.
<wonders if having a copy of Marte's gamesave file might help>

Re: AI Trading Assistant

Posted: Fri Jan 09, 2015 11:53 pm
by Wildeblood
I had suspected it's some kind of code page issue, sort of like the way if I ever open and re-save one of spara's scripts without changing anything they stop working because a junk character gets added in the change from ISO-8859-15 to ISO-8859-1. But according to wikipedia Marte's computer should be using ISO-8859-1, so I'm mystified.

On a lighter note... Made a Yoda plug-in last night, I did. Curious to see how many days before anyone downloaded it, I was. Surprised this morning, I am. :D

Re: AI Trading Assistant

Posted: Sat Jan 10, 2015 12:11 am
by Diziet Sma
Wildeblood wrote:
On a lighter note... Made a Yoda plug-in last night, I did. Curious to see how many days before anyone downloaded it, I was. Surprised this morning, I am. :D
Noticed that, I did. Curious to check it out, I am.

Re: AI Trading Assistant

Posted: Sat Jan 10, 2015 3:27 am
by spud42
if you make a ja ja binks plugin ,im out of here... lol

Re: AI Trading Assistant

Posted: Sat Jan 10, 2015 3:46 am
by Wildeblood
spud42 wrote:
if you make a ja ja binks plugin, im out of here... lol
This is a strange OXP which has grown so much over the years, and has hardly any resemblance to the way it started. So I'd say nothing is out of the question. :twisted:

Re: AI Trading Assistant

Posted: Sat Jan 10, 2015 4:40 pm
by Wildeblood
Version 2.15 is not available through the download manager, because it is untested by me. I'm not playing Oolite any more, and even when I did play, I never did cargo contracts, only passenger contracts. Willing testers would be appreciated.

In theory, with this version you can use automatic selling as well as automatic buying even when you have bulk cargo contracts under way without fear it will sell the goods you need to fulfil contracts. Each time Autotrade starts it scans your contracts list and notes cargo that needs to be reserved.

http://wiki.alioth.net/img_auth.php/0/0 ... t_2.15.oxz

Re: AI Trading Assistant

Posted: Sun Jan 11, 2015 10:54 am
by Wildeblood
Thank you to all the people who have sent me messages asking why the version number appears to have jumped from 2.13.x to 2.15. Yes, there was a 2.14, which added a logging interface to Autotrade. Here's a quick plug-in which demonstrates how to use it:-

http://wiki.alioth.net/img_auth.php/4/4 ... Screen.oxz

After Autotrade runs it will add an interface screen listing the transactions it made on your behalf at that station. The log is not cumulative, and is reset for each station. Requires AI Trading Assistant version 2.14 or later.

Re: AI Trading Assistant

Posted: Sun Jan 18, 2015 6:52 pm
by Marte
Wildeblood wrote:
I had suspected it's some kind of code page issue, sort of like the way if I ever open and re-save one of spara's scripts without changing anything they stop working because a junk character gets added in the change from ISO-8859-15 to ISO-8859-1. But according to wikipedia Marte's computer should be using ISO-8859-1, so I'm mystified.

On a lighter note... Made a Yoda plug-in last night, I did. Curious to see how many days before anyone downloaded it, I was. Surprised this morning, I am. :D
I've the feeling that the clue is correct...

In fact, I've made a lot of tests.

Now, under my italian Mac, "TA" is still without configuration screen but under PC (Windows 8.1 64, Italian), it works...

But again, under "Windows", the italian keyboard is all messed up (the game works as the keyboard is english and you need to use it in positional way...). Under Mac, italian keyboard is correct (every game function on the correct key...) AND "TA" is problematic...

I see a crossed scheme, here.

Re: AI Trading Assistant

Posted: Thu Jan 22, 2015 8:14 am
by Wildeblood
Thanks, Marte.

For ffutures, try this:

Code: Select all

this.name    = "Contracted Goods Reminder";
this.version = "1.0";

    this.guiScreenChanged = function (to, from) {
        "use strict";
        if (player.ship.docked &&
            to === "GUI_SCREEN_MARKET") {
            this._reserveGoodsForContracts();
        }
    }

    this._reserveGoodsForContracts = function () {
        "use strict";
        this.$reservedGoods = {};
        var arrayLength = player.ship.contracts.length;
        if (arrayLength) {
            for (var i = 0; i < arrayLength; i++) {
                var commodity = player.ship.contracts[i].commodity;
                var quantity  = player.ship.contracts[i].quantity;
                var reserve   = this.$reservedGoods[commodity];
                if (reserve) {
                    this.$reservedGoods[commodity] += quantity;
                } else {
                    this.$reservedGoods[commodity] = quantity;
                }
            }
        }
    }

    this.playerSoldCargo = function (commodity, quantity, unitPrice) {
        "use strict";
        var panic = false;
        var reserve = this.$reservedGoods[commodity];
        if (reserve && !manifest[commodity]) {
            panic = true;
        } else if (reserve && reserve > manifest[commodity]) {
            panic = true;
        }
        if (panic) {
            var displayName = displayNameForCommodity(commodity);
            player.consoleMessage("You need at least " + reserve + " units of " + displayName.toLowerCase() + " to fulfil your contracts.", 5);
        }
    }

Re: AI Trading Assistant

Posted: Sun Feb 22, 2015 1:12 am
by richard.a.p.smith
Hello. Nice work, and useful, but I have found a couple of difficulties. It seems to cause MFDs in numeric HUD to disappear after launching. I also found its screens in f8 a little difficult to follow, seemed to change in an odd manner when I was pressing buttons to trade, eg, average prices, when they appeared or I had made them appear by pressing 8 a few times, went away when I traded something. Not intended to be destructive criticism, just trying to offer up observations, Very pleasing, the Yoda add-on, I found. Ta! Rich.

Re: AI Trading Assistant

Posted: Sun Feb 22, 2015 4:16 am
by Wildeblood
richard.a.p.smith wrote:
Hello. Nice work, and useful, but I have found a couple of difficulties.
Hi, Richard. Long time, no see.
richard.a.p.smith wrote:
I also found its screens in f8 a little difficult to follow, seemed to change in an odd manner when I was pressing buttons to trade, eg, average prices, when they appeared or I had made them appear by pressing 8 a few times, went away when I traded something.
Let's see if I can remember how they work, since I've never documented it anywhere, not even inside the javascripts... So...
- Behaviour is different at main stations ("official market") and other markets. At main stations, it starts with either average prices or legality reminder. At other stations, it starts with either average prices or arbitrage screen.
- Behaviour is different doing milk runs or hoarding cargo. After a few seconds it changes to the opportunity cost (number of docks you've hauled cargo to without selling it) screen for 3 seconds, then back again. It will skip that step if you're selling everything every time, and not hoarding anything.
- Behaviour is different using the trainable AI ("observational learning mode") and preset price expectations. When autotrade starts (if you've enabled it), it changes to the buy/sell recommendations list. But that list is based on the preset prices (ruthless or ethical mode), and doesn't appear in observational learning mode.
- While autotrade is running (or if it's off completely) the display won't change again on its own, and you can then cycle through them using the 8 key if you want to.
- But, it should not change the display when you actually perform a trade. If it's doing that(?), that'll be a bug I've introduced somewhere along the way.