11/13/2023 0 Comments Gala games town starI have an express depot and a standard one and it is working fine. getElementById ( "trade-craft-target" ) ĬraftTarget. If ( sellItemIndex >= sellItemsAndLimits. Updates the index for the items in a circular manner (goes back to the beginning when it hits the end)Ĭonsole. ] // All above are examples, you can put as many or as few as you want, and whatever limits you want An improved version of the TownStar Auto-Sell scriptĬonst sellTimer = 300 // Seconds between selling (best setting is longest journey time divided by number of trade terminals)Ĭonst gasLimit = 16 // Minimum amount of gas to keep, script will not sell anything when gas falls below this valueĬonst sellItemsAndLimits = [ // Put each item you want to sell here, and the limit (minimum amount that will NOT be sold) I also want to save some blue steel for the last day of the competition, so I will keep 2 stacks and sell the rest. The only things I want to sell automatically are blue steel and surplus cotton yarn. I do want to keep some extra gas for myself though, as I will manually use a Freight Pier sometimes which isn't handled by this script. I have only 1 Trade Pier with a time of only 15secs and 1 gas cost. Here is my config:Ĭonst sellTimer = 40 // 180/5 = 36, going to round up to 40 to be safe const gasLimit = 2 // I don't want to keep any extra but my limit is 2 fuel per trip const sellItemsAndLimits =, // sell when I have 55 or more, // sell when I have 75 or more, // sell as soon as I can, // want to keep at least 20, sell when 30 or more, // want to keep at least 15, sell when 25 or more, // same as wheat, you get the idea, // same as above // sell pies as soon as I have at least 10 ] Example 3 Everything else is assumed to be balanced for this example. I also sometimes have a surplus of Oak Wood but I want to keep between 10 and 20 of them. I'm running a wine build and also selling grapes for cash, I have two Trade Depots and travel time is 35secs at a cost of 1 fuel (lucky me!). To illustrate the script's full functionality, here are some examples. Thats's it! Simply configure those variables and you should be good to go (remember to refresh the game to load any changes you made to the script). The threshold is the minimum amount you want to keep, so the script will only sell when you have threshold+10 of that item. sellItemsAndLimits: the most important part, here you should add every item you want to be sold automatically and a threshold value.Must also be enough for at least one trade (so 0 is not ok!) gasLimit: the minimum amount of gas you want to keep (in case you want some spare for manual sales).sellTimer: the optimal value is given by calculating longest_journey_time/number_of_trade_terminals (and it's better to always round up a bit).There are 3 things you need to configure: Point to note: when you first load the game (or after a page refresh), you should manually open a trade terminal on each edge of your town, just to let the trades load for that side or it might cause the script to glith on the first trade (if all your depots are on one side then you only need to do one) However, it does support any number of Trade Depots and Trade Piers (including a mix of both) and will use them all one after another in a loop! This is automatic and requires no configuration from the user. It does NOT currently support Freight Piers or Express Depots (though I might add it in future) If you want to use a Freight Pier you can always use the original script for that one item, or you can experiment with adding bits of your own code. This script supports both Trade Depots and Trade Piers. If you open the developper tools you will see some info messages in the console. Then open or refresh TownStar and it should load. Then you can just create a new script through Tampermonkey and paste the contents of updated_sell_script.js into it. This script is designed to be used with Tampermonkey, if you haven't used this extension before then please first install it. Use at your own risk, I have tested this and am satisfied it is free of bugs, but I am not responsible for any loss incurred by others that arose from using this script. Improved TownStar Auto-Sell Script DisclaimerĪt the time of writing scripts are allowed to be used with TownStar, as long as they don't do anything that breaks the game, but double check what the rules say to be sure:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |