The provided code snippet is a description of a TypeScript application designed to optimize the upgrade choices in the "Hamster Combat" game. The application calculates the worth of each upgrade based on its efficiency, which is determined by the ratio of extra profit per hour to the cost of the upgrade.
To run the application, follow these steps:
- Install TypeScript globally using the command
npm install typescript -g
. - Install Node.js.
- Populate the data from your account by manually entering the cost to upgrade and extra profit per hour for each upgrade.
- Run the script using the command
npm run start
. Results will be displayed from most valuable to less valuable.
To populate the data faster, follow these guidelines:
- Fill in the cost to upgrade for each upgrade in the corresponding
UpgradeValues
array. - Manually enter the extra profit per hour for each upgrade by opening the card's popup.
- Run the code.
- View the results in the terminal.
There are 4 types of lists as presented in the Hamster Combat: Market
, PR&Team
, Legal
, Special
. You can find them in the lists.ts
file.
For each list: MarketsList
, PRandTeamList
, LegalList
, and SpecialList
, you need to provide extraProfitPerHour and costToUpgrade.
To do it faster, you can't just open each card and provide both values inside a list. Instead, you can see costToUpgrade without opening a card popup.
There are UpgradeCosts lists also: MarketsUpgradeCosts
, PRandTeamUpgradeCosts
, LegalUpgradeCosts
, SpecialUpgradeCosts
. Each one represents a list of items with only costToUpgrade field, while its index matches the index in the same named lists (e.g., SpecialUpdateValues[7]
=== SpecialList[7].costToUpdate
). Comments are provided to help check this data in case of any misspelling.
So the recipe is simple:
- Fill in your costToUpgrade to each
UpdateValues
array. - Go through all the cards popup and fill in extraProfitPerHour manually (unfortunately, there is no faster way except this one).
- Run the code (the exact details about running were explained above in the "How to run section").
- See the result in the terminal.
If you upgrade any card after the suggestion, you can just update the values inside List
and UpdateValues
arrays and rerun the code.
extraProfitPerHour: 500 coins per hour costToUpgrade: 10,000 coins Worth: 500 coins per hour / 10,000 coins = 0.05 per hour How many hours you will wait to return spent money: 1 / 0.05 per hour = 20 hours
[
{
name: 'Licence Asia',
extraProfitPerHour: 892,
costToUpgrade: 799200,
type: 'Legal',
worth: 0.0011161161161161162,
timeToReturnString: '895.964 hours or 37.332 days' // <-- this one will be better to upgrade because you will faster return spent money
},
...,
{
name: "Security Audition",
extraProfitPerHour: 276,
costToUpgrade: 2170000,
type: "PR&Team",
worth: 0.0001271889400921659,
timeToReturnMoney: "7862.319 hours or 327.597 days",
},
{
name: "KYC",
extraProfitPerHour: 32,
costToUpgrade: 400110,
type: "Legal",
worth: 0.0000799780060483367,
timeToReturnMoney: "12503.438 hours or 520.977 days",
},
];
If you find this project useful and would like to support its development, you can buy me a coffee or a donut! Your support is greatly appreciated.
Way to support me:
- use my referral link in Hamster Combat
- buy me a coffee
- join my frontend tg channel and/or boost it
- download arc browser by my referral link