[Release] marketAide
Moderators: winston, another_commander
[Release] marketAide
Hello.
I just can't remember min, avg and max prices of commodities and a I have to check them all the time so I created a very simple oxp that overlays the market screen with the data from the reference sheet.
Hope you find it useful.
Version 1.2
https://www.box.com/s/ixblm3pudvztqzkq8eqn
I just can't remember min, avg and max prices of commodities and a I have to check them all the time so I created a very simple oxp that overlays the market screen with the data from the reference sheet.
Hope you find it useful.
Version 1.2
https://www.box.com/s/ixblm3pudvztqzkq8eqn
Last edited by spara on Sun Sep 02, 2012 8:12 pm, edited 3 times in total.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: marketAide oxp
Lots of people will find this useful. Nice one!
If I have one request, it is could the overlay also be available without an image?
If I have one request, it is could the overlay also be available without an image?
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Captain Beatnik
- Deadly
- Posts: 154
- Joined: Sun Feb 27, 2011 10:15 pm
- Location: Eastern Bavaria (Average Agricultural Confederacy)
Re: marketAide oxp
A good idea resulting in a very useful oxp. Good work, commander spara!
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams, 1952 - 2001)
You have to try the impossible to achieve the possible. (Emil Sinclair, 1877 - 1962)
You have to try the impossible to achieve the possible. (Emil Sinclair, 1877 - 1962)
Re: marketAide oxp
Glad you like it.
I have updated the file to a new version. In the first version I accidentally merged the bgs market background with the commodities prices, so it really wasn't an overlay . I was using the backround to line up things. The new version is a true overlay. And a lot smaller in size .
I have updated the file to a new version. In the first version I accidentally merged the bgs market background with the commodities prices, so it really wasn't an overlay . I was using the backround to line up things. The new version is a true overlay. And a lot smaller in size .
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: marketAide oxp
Awesome idea, waited till the fixes to download... Will be back with a review.
EDIT: Back with a review: simple, clean, and brilliant. I'm calling it a must-have.
EDIT: Back with a review: simple, clean, and brilliant. I'm calling it a must-have.
Last edited by Rese249er on Sat Sep 01, 2012 2:57 am, edited 1 time in total.
Got all turned around, lost my nav connection... Where am I now?
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: marketAide oxp
It works, but not the way you think it does.
Overlays are reset when you change screens, so this should be all you need in the script:-09:56:36.595 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_Aide 1.0): TypeError: this.$marketOverlay is undefined
09:56:36.595 [script.javaScript.exception.unexpectedType]: ../AddOns/marketAide.oxp/Scripts/aide.js, line 11.
Code: Select all
this.guiScreenChanged = function(to, from) {
if (to == "GUI_SCREEN_MARKET" && guiScreen == "GUI_SCREEN_MARKET") {
setScreenOverlay('aide_market_overlay.png');
}
}
Re: marketAide oxp
Thanks for spotting. I thought that the script was so simple that I didn't even bother to look at the log . I did it the way you suggest at first, but it made the overlay disappear when pressing pause key (p). Framecallback seems to be a solution, but the example I was using destroyed this.$marketOverlay too early causing the error. No more destroying and now it seems to work.Wildeblood wrote:It works, but not the way you think it does.
Overlays are reset when you change screens, so this should be all you need in the script:-09:56:36.595 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_Aide 1.0): TypeError: this.$marketOverlay is undefined
09:56:36.595 [script.javaScript.exception.unexpectedType]: ../AddOns/marketAide.oxp/Scripts/aide.js, line 11.
Code: Select all
this.guiScreenChanged = function(to, from) { if (to == "GUI_SCREEN_MARKET" && guiScreen == "GUI_SCREEN_MARKET") { setScreenOverlay('aide_market_overlay.png'); } }
Had to start versioning. Link to version 1.1 updated in the first post.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: marketAide oxp
Still wrong. Still the same mistake. You're trying to remove the actual function, not the frame callback.spara wrote:Had to start versioning. Link to version 1.1 updated in the first post.
Code: Select all
this.guiScreenChanged = function(to, from) {
if (to == "GUI_SCREEN_MARKET") {
this.$myFrameCallback = addFrameCallback(this.$marketOverlay.bind(this));
}
}
this.$marketOverlay = function(delta) {
if (guiScreen != "GUI_SCREEN_MARKET")Â {
removeFrameCallback(this.$marketOverlay); <--------------
return;
}
setScreenOverlay('aide_market_overlay.png');
}
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: marketAide oxp
Downloaded v1.1, though as a pilot and not a coder, probably won't make a difference to me.
Got all turned around, lost my nav connection... Where am I now?
Re: marketAide oxp
I have to be blind . That was exactly the example I was using. I stand corrected, thank you very much. And the oxp is updated. Again.Wildeblood wrote:Still wrong. Still the same mistake. You're trying to remove the actual function, not the frame callback.spara wrote:Had to start versioning. Link to version 1.1 updated in the first post.
See this post for a correct example.Code: Select all
this.guiScreenChanged = function(to, from) { if (to == "GUI_SCREEN_MARKET") { this.$myFrameCallback = addFrameCallback(this.$marketOverlay.bind(this)); } } this.$marketOverlay = function(delta) { if (guiScreen != "GUI_SCREEN_MARKET")Â { removeFrameCallback(this.$marketOverlay); <-------------- return; } setScreenOverlay('aide_market_overlay.png'); }
Re: [Release] marketAide
I have gone through the "OXP Distribution" page on wiki (which I should have done a lot earlier ) and have repackaged the oxp accordingly (included the license and such). If I would like my oxp to be added to the oxp list in the wiki, what should I do?
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: [Release] marketAide
Just ask here! There's usually a wiki-er around who will help.spara wrote:... my oxp to be added to the oxp list in the wiki, what should I do?
It's done for you
Or if you wish to have a wiki account of your own, again, just ask, although I can't help with that I'm afraid.
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Shipbuilder
- ---- E L I T E ----
- Posts: 877
- Joined: Thu May 10, 2012 9:41 pm
- Location: Derby
Re: [Release] marketAide
Spara - If you want a Wiki account Maik set out up for me so he is probably the best person to contact.
Good work with the oxp by the way.
Good work with the oxp by the way.
The GalTech Industries Corporation - Building ships to populate the galaxies.
Increase the variety of ships within your Ooniverse by downloading my OXPs
Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
Increase the variety of ships within your Ooniverse by downloading my OXPs
Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
Re: [Release] marketAide
Out of curiosity is it possible to include the price you have bought the commodity at ? as part of the overlay.
Re: [Release] marketAide
Not possible as overlay. Overlay is simply a png image. At the moment Wildebloods AI Trading Assistant does that. My Troomp also does that, but there are issues with Oolite 1.77, so it can't be recommended.barge411 wrote:Out of curiosity is it possible to include the price you have bought the commodity at ? as part of the overlay.
Price of the bought goods is actually more complicated than it looks. First of all it has to be an average. Then you'll have to cope with goods that are dumped or destroyed or scooped. New Cargoes and Hypercargo also add their quirks in to the mix. And let's not forget handling of cargo contracts and their premiums.