m-h-c-t / mh-hunt-helper

Tool to help collect data, estimate attraction, catch, and drop rates for a popular game.
https://www.mhct.win
MIT License
7 stars 14 forks source link

Add gold value to Convertibles #240

Closed vsong closed 1 year ago

vsong commented 1 year ago

Implement a script to insert and update gold values for convertible items from Markethunt API, as well as updating Convertibles webpage to display gold/sb value statistics.

Additional admin steps needed after deployment:

  1. Run the following migration script in converter database:
    CREATE TABLE `item_markethunt` (
    `item_id` int NOT NULL,
    `gold_value` bigint DEFAULT NULL,
    `sb_value` double DEFAULT NULL,
    PRIMARY KEY (`item_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
    -- set 1 Gold equal to 1 Gold. Do not set to 0, or the MH economy will collapse!
    INSERT INTO item_values (item_id, gold_value) VALUES(431, 1);
  2. Add insert_gold_values.php to the daily cron. Markethunt refreshes its data at 12:05am UTC, I recommend running the cron at 12:15am UTC.
  3. Copy new config.php variables from config.php.example

Preview of UI changes:

image

vsong commented 1 year ago

Updated PR summary with new table name