Page 2 of 15

Re: AI Trading Assistant OXP

Posted: Sat Sep 15, 2012 7:29 am
by Thargoid
Yes it is a real usable property.

Re: AI Trading Assistant OXP

Posted: Sat Sep 15, 2012 10:36 am
by Commander McLane
Wildeblood wrote:
I think it messy, inelegant and anaesthetic*, …

* Spell-checker insisted.
Well, of course the spell-checker insisted. I doubt, however, that it does have the capacity to put you to sleep before getting a surgery. :wink:

You probably wanted to use "unaesthetic".

Re: AI Trading Assistant OXP

Posted: Sat Sep 15, 2012 10:45 am
by Cody
Wildeblood wrote:
... prevent buying of illegal goods at GalCop main stations, by instantly reversing such trades.
I have to ask why?

Re: AI Trading Assistant OXP

Posted: Sat Sep 15, 2012 10:53 am
by Wildeblood
Commander McLane wrote:
Wildeblood wrote:
I think it messy, inelegant and anaesthetic*, …

* Spell-checker insisted.
Well, of course the spell-checker insisted. I doubt, however, that it does have the capacity to put you to sleep before getting a surgery. :wink:

You probably wanted to use "unaesthetic".
Indeed, I did. Opera suggests anaesthetic, synaesthetic, kinaesthetic, anaesthetist or aesthetic in place of unaesthetic, which it gives the dreaded squiggly, red underline. It also doesn't know the plural of you is youse, but I have to draw the line and stand up to these computers at that.
El Viejo wrote:
Wildeblood wrote:
... prevent buying of illegal goods at GalCop main stations, by instantly reversing such trades.
I have to ask why?
Why not?

Re: AI Trading Assistant OXP

Posted: Sat Sep 15, 2012 11:30 am
by Commander McLane
Wildeblood wrote:
El Viejo wrote:
Wildeblood wrote:
... prevent buying of illegal goods at GalCop main stations, by instantly reversing such trades.
I have to ask why?
Why not?
The usual terms and conditions apply: You don't need to install the OXP if you don't like/want what it does.

Or, in a lesser case, you can modify it for your own use.

Re: AI Trading Assistant OXP

Posted: Sun Sep 16, 2012 3:22 am
by Wildeblood
El Viejo wrote:
Wildeblood wrote:
... prevent buying of illegal goods at GalCop main stations, by instantly reversing such trades.
I have to ask why?
Or tax them 10% GST. :twisted: :twisted: :twisted:

Going back to the bell sounds: I've just been listening to them, there are two; the buying chime is okay, but the selling chime is slightly louder, higher in pitch, and longer sustained and hurts my poor ear.
Commander McLane wrote:
The usual terms and conditions apply: You don't need to install the OXP if you don't like/want what it does.

Or, in a lesser case, you can modify it for your own use.
Quite so. The script in this isn't written to be a model of brevity. It's written with two big switch statements listing each commodity separately, so it's easy for anyone to start hacking into to add exceptional handling for any particular commodity that interests them. Hence it was easy to change the reaction to buying illegal goods, back in version 1.1, and is just as easy to revert it if you have no qualms: open script.js and scroll down to $playerBoughtCargo, it starts like this then 16 more cases for the other commodities follow...

Code: Select all

this.$playerBoughtCargo = function(cargo,quantity,totalprice)
	{
	if(this.logging) log(this.name, "Player bought " + quantity + " units of " + cargo + " for " + totalprice + " credits, total price.");
	player.ship.hud = "trading-assistant-hud.plist";
	var price = totalprice / quantity;
	switch(cargo)
		{
		case "food":
			if(price > 5.0) this.$paidTooMuch(cargo);  // Paying above the average price.
			if(price < 3.5) this.$paidLowPrice(); // Minimum GalCop price: 2.0
			break;
Scroll down to slaves, it looks like this...

Code: Select all

		case "slaves":
		//	if(price > 15.2) this.$paidTooMuch(cargo);
			if(price < 8.6) this.$paidLowPrice(); // Minimum GalCop price: 2.0
			else this.$illegalGoods(displayNameForCommodity(cargo));
			break;
To make it behave like the other commodities, just remove the comment marker // from the first line, and add it to the third line:-

Code: Select all

		case "slaves":
			if(price > 15.2) this.$paidTooMuch(cargo);
			if(price < 8.6) this.$paidLowPrice(); // Minimum GalCop price: 2.0
		//	else this.$illegalGoods(displayNameForCommodity(cargo));
			break;
Voilà, no more nagging.

Re: AI Trading Assistant OXP

Posted: Sun Sep 16, 2012 7:51 am
by Thargoid
One small heads-up. At least according to the wiki, this.playerBoughtCargo is coming as a built-in function in 1.77 (although I do recall some discussion over it in the past elsewhere). So your $playerBoughtCargo self-defined function, whilst separate due to the $, may end up causing a little bit of confusion?

Or is it a placeholder, as the build-in one is very similar (the third parameter is price per unit rather than total price in the trunk one)?

Anyway just a FYI.

Re: AI Trading Assistant OXP

Posted: Sun Sep 16, 2012 6:56 pm
by DeathKnyte
Wildeblood wrote:
Righto, how does this arrangement of reminders look?

Image

I think it messy, inelegant and anaesthetic*, and remind you that you apparently got by without such reminders before. But if it meets with your approval, it will become the new 1.7 some time later this week. You might be surprised how much fiddling about is involved in a small change like this.

So, an idea I had for 1.7, which I suppose will now be 1.8, was to prevent buying of illegal goods at GalCop main stations, by instantly reversing such trades. What do youse think? (Is player.ship.dockedStation.isMainStation a real property - it looks familiar?)

* Spell-checker insisted.
What I like about that picture, is that you have somehow modified the settings so that it detects the commodities in cim's New Cargos oxp.
:)

Ja, I did get by without such reminders before, but I did so by removing this oxp and going back to either the core game way, or using the Market Aide oxp. Those didn't have a voice telling me about every transaction I was doing that was causing me to lose credits, because I did not know about the "SHIFT" key. It is not documented anywhere, until cim mentioned it in his above post.

I can not imagine how much work undoubtedly goes into programming such things. You guys are gods to people like me. I bow my head in your presence.
:)

Personally, I would not implement the illegal commodity reversal - what if I actually want to buy them?
Instead; you could have the computer voice give a warning that you are going to be tagged as an offender or fugitive, if you have bought a bunch.

Re: AI Trading Assistant OXP

Posted: Sun Sep 16, 2012 11:41 pm
by Commander McLane
DeathKnyte wrote:
What I like about that picture, is that you have somehow modified the settings so that it detects the commodities in cim's New Cargos oxp.
"Modifying the settings" means "installing New Cargoes OXP". Different OXPs play along with each other. There's no need to modify one OXP in order to install another OXP.

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 12:37 am
by Cpt
As requested feedback: I have an issue that when I press enter twice, the fastest way - to sell all and then buy all which accomplishes my usual goal with most alacrity. The AI treats this as two different transactions... it would be more accurate if it could tell net transactions over the session, otherwise it misjudges my activity which is fine, but I thought this might be something you could tweak?

How you would actually utilise this feedback, well that would be an engineering/programming issue...

More variance in the AI responses might be nice but the English RP voice on 'Whoa' is rather amusing...

It also perpetually warns me that I buy Gems and precious metals over their average price, I know I do but I sell even higher. Perhaps I could interact with the AI to set my buy/sell fixed price boundary of 41 credits for gold, 75c for Platinum and 22c for Gems so it knows my strategy?

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 1:42 am
by Wildeblood
Cpt wrote:
As requested feedback: I have an issue that when I press enter twice, the fastest way - to sell all and then buy all which accomplishes my usual goal with most alacrity. The AI treats this as two different transactions...
This is my own biggest bugbear, and what DeathKnyte was complaining about above. To buy more when you already have some aboard, press [shift] [>], not [enter] twice.
Cpt wrote:
It also perpetually warns me that I buy Gems and precious metals over their average price, I know I do but I sell even higher. Perhaps I could interact with the AI to set my buy/sell fixed price boundary of 41 credits for gold, 75c for Platinum and 22c for Gems so it knows my strategy?
That's why it remembers what you actually paid, and reminds you when you sell. If you sell a commodity one unit at a time, and see those average price reminders trending higher, it means you're losing money with every unit you sell. If they trend downwards, then you're making a profit, regardless of average prices.

(Welcome aboard, cpt.)
DeathKnyte wrote:
What I like about that picture, is that you have somehow modified the settings so that it detects the commodities in cim's New Cargos oxp.
No, that's just what my market screen always looks like. It's nothing to do with cim's New Cargoes:-
READ ME wrote:
If you wish to change the names of the commodities shown on the market screen, find the file named "descriptions.plist OFF" inside the "Config" folder, rename it to "descriptions.plist" and edit it using a text-editor. The example file supplied over-rides only the section of descriptions.plist (a quite large file elsewhere within Oolite) pertaining to commodity names.
I don't know anything about New Cargoes, but I'm sure it has no effect on the normal market screen, so these two OXPs shouldn't have any incompatibility. Cim?

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 2:06 am
by Cpt
*grin* thank you Wildeblood...

The controls are as displayed... plus the extra ones you find out about later on the forum... well that is a lot like life and the game really...

The only times I can recall making a loss in the game was a cargo dump for something more lucrative as I changed direction due to getting a new opportunity and selling a few units of stock to buy that upgrade now...

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 5:33 am
by Wildeblood
-----------
Change Log:
-----------

1.6.2 (September 17th, 2012) Moved script from Config to Scripts folder, and re-arranged its contents for easier editing. Don't be shy to get in there and hack it.
P.S. I left a backup copy in there, too, in case you break it. Whoever you are.

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 7:00 am
by cim
Wildeblood wrote:
I don't know anything about New Cargoes, but I'm sure it has no effect on the normal market screen, so these two OXPs shouldn't have any incompatibility. Cim?
No, no effect on normal markets at all.

Re: AI Trading Assistant OXP

Posted: Mon Sep 17, 2012 10:52 am
by Commander McLane
Wildeblood wrote:
Cpt wrote:
It also perpetually warns me that I buy Gems and precious metals over their average price, I know I do but I sell even higher. Perhaps I could interact with the AI to set my buy/sell fixed price boundary of 41 credits for gold, 75c for Platinum and 22c for Gems so it knows my strategy?
That's why it remembers what you actually paid, and reminds you when you sell. If you sell a commodity one unit at a time, and see those average price reminders trending higher, it means you're losing money with every unit you sell. If they trend downwards, then you're making a profit, regardless of average prices.
The only "price" I ever "buy" precious commodities at is 0. :twisted:

Still, I don't sell below a certain, self-defined threshold (40 for Gold, as-close-as-possible-to-80 for Platinum, and 20 for Gem-stones).