April 30, 2017, 05:58:04 AM

Author Topic: [MOD for GnomoriaModUI] Automatic trading  (Read 19848 times)

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
[MOD for GnomoriaModUI] Automatic trading
« on: February 01, 2015, 07:13:14 AM »
(I am using a Google Translate, sorry about that)

Hello everyone!

I present you the automated trading mod, supported up to 1.0 RC8

Mod using GnomoriaModUI by Faark, thanks a lot!

How to install mod launcher, thanks to majorgetsome

Mod allows you to automate routine trade with merchants. When too many of them, when too many goods produced or just laziness.

What has been done
When you open a shop window, an additional button "Auto preferences" will show



which leads to the Preferences window



there are two tabs, the first responsible for the sale, the second is responsible for the purchase, they are identical in functionality. Each tab on the left there is a list of products at the top right of the goods properties are added and at bottom right list with the list of already selected trading rules

there may be both the quality and material. Xml did not have time to fill in the end, I'm sorry, so some items are missing these features. But now everything is working as it should.
After the quality of the material and there is a field "Save count", which allows you to save a given quantity of goods in the kingdom. In other words, allows you to sell the surplus.
After clicking "Add" rule appears in the list of rules. It can be moved up and down and removed.

You can also use any group of products. If there is at least one item with quality, it will be displayed in the info. (Goods without quality is always Average, remember this). Materials are also aggregated and grouped



Thus, only sell all Poor Statuette, Fine Yak Statuette and Wheat straw over 2K.



Buy some metals. In merchant has not yet provided the use Save count

order rules affect the alignment of prices. That is the bottom will be rejected first

Further, when the merchant came into the store, it is possible to use the second button. Maud walk through all the goods, choose the appropriate according to the rules will cut as needed to leave and caught up in the price of both lists. Values with zero cost will not be cutted.


This picture is in-debug mode without filtration, just to show in-rules values (and yep, straw saves 2K)

Next algoritm align cost values to the nearest values down-up direction (we have priority)


This is image with real result

DOWNLOAD from gDrive for indev

Changelog:
v0.2:
[FIX] Bug in sort function in fortress goods

v0.3:
[FIX] Added sort rule-priority to merchant. Occur buy different goods if "Auto trade" button is pressed several times
[FIX] Now no more windows while "Auto trade" is pressed. Now may close trade window with "Back" button
[ADD] Yet another tab in begin of tabs: "Options". Have several checkboxes:
  • Show notify - Raise a notify while merchant has sit on a chair
  • Pause - Pause game while merchant has sit on a chair
  • Center market - Centers market while merchant has sit on a chair
  • Show trade UI while merchant has sit on a chair
  • Auto trade while merchant has sit on a chair

v1.0:
[ADD] Merchant save count functionality. With adding good to merchant auto trading with setting save count not equal zero this good will buy only if your goods is lesser than this save count value.
[FIX] Options XML is fully filled. Write to this topic if you find any reality differences
[ADD] Adding "Get my goods" and "Get merchant goods" buttons for semi-automatic good-align. This stuff works next way: You add goods for sell to your offered goods list box, click the "Get merchant goods" button and mod lineup merchant goods automatically. Your offered goods not re-aligned, so if merchant does not have enough goods, mod add only what find. I.E. no jew style in this tow buttons. Same way works second button. I use this functionality for one-time trading.
[ADD] "Auto trading while merchant has sit on a chair" functionality. Notifying started with "[TS]" and "[TF]" what means "Trade successfull" and "Trade failed" plus result or reson of trade operation.
[FIX] Several minor fixes and code-reviews.

v1.1:
[ADD] Added "Sell excesses" to market stall form. If you click "Auto trade" button with checked this box, algorithm skip fortress goods alignment.
[ADD] Added "Notify successful trading" and "Notify failed trading" checkboxes in auto trade section. With this options you see notify only if this CBs checked.

v1.2:
[ADD] Add a checkbox option that play sound if trading is success.

v1.3:
[ADD] Added an option checkbox 'Keep "Sell excess" checkbox by default' in Auto trade group. Once checked, its allow sell goods not aligned by kingdom cost in automatic mode.
[FIX] Rare bug with excess, which do not buy some goods in merchant.
[FIX] Now if excess is set, may sell items even if merchant has nothing to sell

v1.4:
[ADD] Two options in group "Show trading window when merchant sit on a chair in market" - "Show only if merchant has goods to sell" and "Show only if your kingdom has goods to sell". Only checked they allow to open trading window only if there has something to trade. It feature added because I sometimes use manual trading for one-time trading. I go to opts, activate "Show trade" and wait merchant, which can buy my stuff (~400 windmils). And I got a tons empy-opens. So here the solution.
[PRF] If saveCount = 0 now string " save 0" not viewed.

v2.0:
[FIX] Support of new mod ingame-liver. No need AutomaticTradingInMarket_Items.xml now, all fills from internal structures. Theoretically support steam-mod-goods.

Unfortunately, all goods now have a quality (remember what no-quality stuff has quality equals Average) and material types available only if it available in game.

v2.0.lazydumb:
[FIX] Filter by quality and by material not working, add all stuff.

v2.1:
[FIX] After closing options by "Back" button, now may trade with new options, no need reopen market stall.
[PRF] Now each line in options may be enabled or disabled for tiny adjustments
[PRF] You may edit old lines for tiny adjustments
[PRF] Move up, move down and delete now buttons, no more right-clicking spam.
[PRF] Change "save" to "up to" string representation in lines.
[ADD] Cheque from market which contains all buyed goods with. Enables in options first tab.
[PRF] Now market has MyTotalWorth and MerchantTotalWorth labels. This lines exists in cheque.
[FIX] If not sellexcess, no more "first gift" lag
« Last Edit: December 15, 2015, 10:46:17 AM by Wild Braas »
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

MegaHamster

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod] Automatic trading
« Reply #1 on: February 01, 2015, 10:44:29 AM »
This sounds very interesting but your images aren't working!

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #2 on: February 01, 2015, 11:13:53 AM »
I reload images  :-[
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

Aynslei

  • Sr. Member
  • ****
  • Posts: 350
    • View Profile
Re: [Mod] Automatic trading
« Reply #3 on: February 01, 2015, 11:18:08 AM »
I have world that I only stopped playing because selling the massive load of crap I made each game week was necessary to prevent lag but took forever.

I will load this up and see how it functions.
RoboB0b has permission to use anything I post for any reason.
Feel free to contact me about any questions you have.
Wisdom and Knowledge are the most sacred things.

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #4 on: February 01, 2015, 11:28:45 AM »
I have world that I only stopped playing because selling the massive load of crap I made each game week was necessary to prevent lag but took forever.

I will load this up and see how it functions.
I think tomorrow i shall done the Xml with quality and material to the end.
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

Rephath

  • Sr. Member
  • ****
  • Posts: 337
    • View Profile
Re: [Mod] Automatic trading
« Reply #5 on: February 01, 2015, 03:00:22 PM »
Must have. Must have!

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #6 on: February 01, 2015, 09:38:04 PM »
Thanks a lot  :D
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #7 on: February 02, 2015, 12:33:54 PM »
v0.3:
[FIX] Added sort rule-priority to merchant. Occur buy different goods if "Auto trade" button is pressed several times
[FIX] Now no more windows while "Auto trade" is pressed. Now may close trade window with "Back" button
[ADD] Yet another tab in begin of tabs: "Options". Have several checkboxes:
  • Show notify - Raise a notify while merchant has sit on a chair
  • Pause - Pause game while merchant has sit on a chair
  • Center market - Centers market while merchant has sit on a chair
  • Show trade UI while merchant has sit on a chair
  • Auto trade while merchant has sit on a chair (not implemented yet)
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #8 on: February 10, 2015, 03:22:30 AM »
So I done with this stuff  8)

v1.0:
[ADD] Merchant save count functionality. With adding good to merchant auto trading with setting save count not equal zero this good will buy only if your goods is lesser than this save count value.
[FIX] Options XML is fully filled. Write to this topic if you find any reality differences
[ADD] Adding "Get my goods" and "Get merchant goods" buttons for semi-automatic good-align. This stuff works next way: You add goods for sell to your offered goods list box, click the "Get merchant goods" button and mod lineup merchant goods automatically. Your offered goods not re-aligned, so if merchant does not have enough goods, mod add only what find. I.E. no jew style in this tow buttons. Same way works second button. I use this functionality for one-time trading.
[ADD] "Auto trading while merchant has sit on a chair" functionality. Notifying started with "[TS]" and "[TF]" what means "Trade successfull" and "Trade failed" plus result or reson of trade operation.
[FIX] Several minor fixes and code-reviews.
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

majorgetsome

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [Mod] Automatic trading
« Reply #9 on: February 13, 2015, 07:00:34 PM »
Binaries and xml items need to put in Mod folder

Where is this located? I can't find the "Mod folder"

majorgetsome

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [Mod] Automatic trading
« Reply #10 on: February 13, 2015, 11:12:19 PM »
I actually figured it out, and just used it for the first time and HOLY CRAP. You my friend, are the best. This is an amazing tool

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #11 on: February 14, 2015, 01:02:23 AM »
I am very happy that this mod was useful to you  :-[

Thank you  :D
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

hexen1024

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: [Mod] Automatic trading
« Reply #12 on: February 16, 2015, 07:36:30 PM »
Love the auto trading, but it seems the latest update (9.17 RC11 I think) broke something. It prevents the modUI loader from seeing this mod. All the other mods still show up, but this one will not. When I place a new copy of it in the mods folder, it reads and gives the security error. But as soon as that is fixed, nothing. Hope you can fix it, I love the "get my goods" button :)

Thanks!
Hexen

Wild Braas

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: [Mod] Automatic trading
« Reply #13 on: February 16, 2015, 09:43:33 PM »
Next few days I connect my new home to the internet and fix them quickly, sorry  :-[
Я художник, я так вижу.

My mods: Auto resume after saving Perfomance dreams Auto trading Herold Happy Farmer

hexen1024

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: [Mod] Automatic trading
« Reply #14 on: February 17, 2015, 12:45:59 AM »
it's no problem, I've only recently found this and now don't want to play without it.... I just appreciate your work on this